Uploaded image for project: 'Jetspeed 2'
  1. Jetspeed 2
  2. JS2-905

JSP Portlet Decorators: Decorator-specific decorator.jsp ignored

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.3
    • Fix Version/s: 2.2.0
    • Component/s: Decorations/Themes
    • Labels:
      None
    • Environment:
      All operating systems, all app servers, all JDKs

      Description

      The JSP portlet decorators always use:

      jetspeed/decorations/portlet/decorator.jsp

      If you have a decorator named "my-decorator", then the layout should check for a file named:

      jetspeed/decorations/portlet/my-decorator/decorator.jsp

      and if found, use that. Otherwise fall back to the default.

      The following info came from Woonsan Ko (thanks!):

      BEGIN QUOTE

      In the /jetspeed/WEB-INF/templates/layout/html/*/ folders, there are layout.jsp containing the some code fragments like the following:

      String _tempPath = _frag.getDecoration().getBasePath();
      String _portletJSP = _tempPath.substring(0,_tempPath.lastIndexOf('/')) +
      "/decorator.jsp";

      I think you can modify the above as follows:

      String _portletJSP = "/" + _frag.getDecoration().getResource("decorator.jsp");

      END QUOTE

      This works well.

        Activity

        Hide
        aaronmevans Aaron Evans added a comment -

        Here is a patch to apply against version 2.1.3 but I'm not sure I did it correctly.

        The patch is relative to portal/tags/JETSPEED-RELEASE-2.1.3.

        -aaron

        Show
        aaronmevans Aaron Evans added a comment - Here is a patch to apply against version 2.1.3 but I'm not sure I did it correctly. The patch is relative to portal/tags/JETSPEED-RELEASE-2.1.3. -aaron
        Hide
        woon_san Woonsan Ko added a comment -

        Thank you, Aaron.
        I think we'd better improve PortletDecorationImpl.getTemplate() method to not use "decorator.vm" literal.
        Probably it can read the configuration, and the jsp template should simply use the getTemplate() method.

        Show
        woon_san Woonsan Ko added a comment - Thank you, Aaron. I think we'd better improve PortletDecorationImpl.getTemplate() method to not use "decorator.vm" literal. Probably it can read the configuration, and the jsp template should simply use the getTemplate() method.
        Hide
        woon_san Woonsan Ko added a comment -

        Fixed to use each jsp template of decorations.
        By the way, I found that it's not proper to modify PortletDecoratorImpl to do according to the configuration. It's because our current solution implies that templating technology should be the same to serve a page. That is, one portlet fragment should not run on velocity if others are running on jsp. So, fixing jsps only is enough at this time.

        Show
        woon_san Woonsan Ko added a comment - Fixed to use each jsp template of decorations. By the way, I found that it's not proper to modify PortletDecoratorImpl to do according to the configuration. It's because our current solution implies that templating technology should be the same to serve a page. That is, one portlet fragment should not run on velocity if others are running on jsp. So, fixing jsps only is enough at this time.

          People

          • Assignee:
            woon_san Woonsan Ko
            Reporter:
            aaronmevans Aaron Evans
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development