Affects Version/s: 7.0.X, 7.1.X, 7.2.X, Master
Component/s: Dynamic Data Mapping
As a developer, I want to overwrite an TemplateHandler using service ranking (ex: JournalTemplateHandler).
The TemplateHandlerRegistryImpl ignores the ranking of service and it records Handler by calling addTemplateHandler order.
It does not reflect the order of service activation.
If the default JournalTemplateHandler is recorded after my custom Handler it is ignored.
The order seems random and it does not seem possible to fix it by inject any dependencies into custom bundle.
Is there a way to overwrite an TemplateHandler ?
Steps to Reproduce:
- Create a custom module adding CustomJournalTemplateHandler (template.handler.test.jar can be used).
- Deploy the module in the server.
- Restart the server.
- Execute the following Groovy script and check that CustomJournalTemplateHandler appears.
CustomJournalTemplateHandler should appear as it has higher service ranking than JournalArticleTemplateHandler.
JournalArticleTemplateHandler appears as we are using a map to save the handlers ignoring the priority.