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

PortletURLImpl can't be wrapped correctly

    Details

    • Branch Version/s:
      7.0.x
    • Backported to Branch:
      Committed
    • Story Points:
      1.75

      Description

      PortletURLFactoryUtil is set up to be able to handle custom factory classes which instantiate custom PortletURL implementations – that's the idea with the Factory pattern.

      To do this, one must:

      1. write a class that extends PortletURLWrapper and implements LiferayPortletURL
      2. write another class that implements PortletURLFactory and creates instances of the custom PortletURL class
      3. register the custom factory with portal's factory util using ext-spring.xml.

      All of this works correctly.

      However, JSP compile errors are encountered at runtime, because render_portlet.jsp assumes that PortletURLFactoryUtil.create returns an instance of PortletURLImpl – the default LiferayPortletURL implementation (which defeats the purpose of the Factory pattern). When a custom factory is registered, this causes the site to break if there's a portlet (any portlet) added to the front page – the theme's portal_normal template fails to compile correctly, so a nasty error message is shown.

      Core code should not be dependent on any particular implementation of LiferayPortletURL.

        Attachments

          Activity

            People

            • Assignee:
              joyce.wang Joyce Wang
              Reporter:
              ethan.bustad Ethan Bustad
              Participants of an Issue:
              Recent user:
              Csaba Turcsan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 13 weeks, 3 days ago

                Packages

                Version Package
                7.0.0 DXP FP11
                7.0.0 DXP SP2
                7.0.3 CE GA4
                7.1.X
                Master