ICEfaces
  1. ICEfaces
  2. ICE-2546

CLONE -It would be useful to split MainPortlet.render(..) method in order to make it more convenient for subclassing

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7DR#3
    • Fix Version/s: 1.7Beta1, 1.7
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      JBoss 4.2.1, Lifera 4.3.2, Sun RI 1.2, Facelets

      Description

      Wouldn't it be possible to extract the getting viewId logic from MainPortlet.render method to separate protected method To be more precisely, this code:

              // Get the inital view that is configured in the portlet.xml file
              PortletMode portletMode = renderRequest.getPortletMode();
              String viewId = null;
              if (portletMode == PortletMode.VIEW) {
                  viewId = portletConfig.getInitParameter(Constants.VIEW_KEY);
                  if (viewId == null) {
                      if (log.isErrorEnabled()) {
                          log.error(Constants.VIEW_KEY + " is not properly configured");
                      }
                      throw new PortletException(Constants.VIEW_KEY + " is not properly configured");
                  }
              } else if (portletMode == PortletMode.EDIT) {
                  viewId = portletConfig.getInitParameter(Constants.EDIT_KEY);
                  if (viewId == null) {
                      if (log.isErrorEnabled()) {
                          log.error(Constants.EDIT_KEY + " is not properly configured");
                      }
                      throw new PortletException(Constants.EDIT_KEY + " is not properly configured");
                  }
              } else if (portletMode == PortletMode.HELP) {
                  viewId = portletConfig.getInitParameter(Constants.HELP_KEY);
                  if (viewId == null) {
                      if (log.isErrorEnabled()) {
                          log.error(Constants.HELP_KEY + " is not properly configured");
                      }
                      throw new PortletException(Constants.HELP_KEY + " is not properly configured");
                  }
              }

      It would be useful to have an ability to override this logic in the subclasses. Personally, I'd like to add an ability to show some view based on request parameters.

        Activity

        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Deryk Sinotte [ deryk.sinotte ]
        Ken Fyten made changes -
        Fix Version/s 1.7 [ 10080 ]
        Ken Fyten made changes -
        Fix Version/s 1.7Beta1 [ 10121 ]
        Fix Version/s 1.7 [ 10080 ]
        Deryk Sinotte made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Deryk Sinotte added a comment -

        Made the requested changes. This should now be more friendly for subclassing.

        Show
        Deryk Sinotte added a comment - Made the requested changes. This should now be more friendly for subclassing.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #15533 Thu Jan 10 14:11:45 MST 2008 deryk.sinotte ICE-2546: Making the class for friendly for subclassing.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/MainPortlet.java
        Ken Fyten made changes -
        Field Original Value New Value
        Fix Version/s 1.7 [ 10080 ]
        Fix Version/s 1.7DR#3 [ 10112 ]
        Affects Version/s 1.7DR#3 [ 10112 ]
        Affects Version/s 1.7DR#2 [ 10110 ]
        Hide
        Vadim Lotarev added a comment -

        It would be useful:

        • to make method getViewID protected;
        • to make portletConfig field protected.
        Show
        Vadim Lotarev added a comment - It would be useful: to make method getViewID protected; to make portletConfig field protected.
        Vadim Lotarev created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Vadim Lotarev
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: