tuub / kitodo-mediaserver

Kitodo Mediaserver
GNU General Public License v3.0
7 stars 6 forks source link

Performance of configurable actions in the importer #128

Closed pbroman closed 5 years ago

pbroman commented 6 years ago

During the import process, it should be possible to perform actions before the indexing and after the indexing (provided that it was successful). Additionally, it should also be possible to request actions for execution by another process. The latter is for bigger tasks such as conversions etc. Which actions are performed must be configurable in simple lists of actions with parameter maps. For this pupose, the ImporterProperties should be extended with appropriate variables. Morover the ImporterFlowControl should be extended with the execution of the configured actions.

pbroman commented 6 years ago

There is a draft for this in https://github.com/tuub/kitodo-mediaserver/tree/128_importer_actions This solution works as configuered, but it has a drawback: If an action is defined without parameter map, you get a BindingException. The same happens if the list af actions is empty. (You may play around with actionsBeforeIndexing in local.yml to test this) Thus, with this solution, you would always have to define a parameter map with bullshit params, if none should be given, and all default lists must be something like this:

actionsBeforeIndexing: - dummyAction foo: bar

Not very nice. If we only allow actions with no parameter map to be configured in this way, we could simply list the action names as strings. These lists may be emtpy, no problem. But it would be nice to be able to defined param maps as well. I don't have a good idea for this, though.

ponchofiesta commented 5 years ago

I like it. For the empty list problem I added two type converters (217386c) which allow the user to write empty lists like this:

actionsBeforeIndexing:
actionsBeforeIndexing:
- testAction
actionsBeforeIndexing:
- testAction: