Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-77595

TemplateHandlerRegistry ignores service ranking of TemplateHandler services

    Details

      Description

      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:

      1. Create a custom module adding CustomJournalTemplateHandler (template.handler.test.jar can be used).
      2. Deploy the module in the server.
      3. Restart the server.
      4. Execute the following Groovy script and check that CustomJournalTemplateHandler appears.
      for(th in com.liferay.portal.kernel.template.TemplateHandlerRegistryUtil.getTemplateHandlers()) {
          out.println(th);
      }

       

      Expected Result:

      CustomJournalTemplateHandler should appear as it has higher service ranking than JournalArticleTemplateHandler.

       

      Actual Result:

      JournalArticleTemplateHandler appears as we are using a map to save the handlers ignoring the priority.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dereck.portela Dereck Portela
              Reporter:
              riccardo Riccardo Martini
              Participants of an Issue:
              Recent user:
              Yunlin "Steven" Sun
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                31 weeks ago

                  Packages

                  Version Package
                  7.0.0 DXP FP94
                  7.0.10.15 DXP SP15
                  7.0.X
                  7.1.10 DXP FP19
                  7.1.10.5 SP5
                  7.1.X
                  7.2.10 DXP FP8
                  7.2.10.2 DXP SP3
                  7.2.X
                  7.3.4 CE GA5
                  7.3.10 DXP GA1
                  Master