ICEfaces
  1. ICEfaces
  2. ICE-1625

Make Portlet specific artifacts and APIs accessible to developers

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7DR#1, 1.7
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Portlets
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Compatibility/Configuration

      Description

      Due to the fact that we dispatch calls from MainPortlet -> MainServlet, the resulting portlet specific artifacts (like request, response, etc.) are wrapped to look like servlet artifacts and certain types and APIs that are specific to portlets are not available to the developer.

        Issue Links

          Activity

          Repository Revision Date User Message
          ICEsoft Public SVN Repository #13954 Wed May 23 13:21:10 MDT 2007 deryk.sinotte ICE-1625 Adding a very temporary solution for getting access to portlet specific artifacts and APIs.
          Files Changed
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletArtifactHack.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/MainPortlet.java
          Deryk Sinotte created issue -
          Deryk Sinotte made changes -
          Field Original Value New Value
          Link This issue is duplicated by ICE-1620 [ ICE-1620 ]
          Deryk Sinotte made changes -
          Link This issue is duplicated by ICE-1615 [ ICE-1615 ]
          Deryk Sinotte made changes -
          Assignee Deryk Sinotte [ deryk.sinotte ]
          Hide
          Deryk Sinotte added a comment -

          I checked in a very, very temporary mechanism for accessing portlet artifacts and APIs for this release. This should not be relied upon in any way, shape, or form in future releases.

          To access the PortletRequest, PortletConfig, and their associated APIs, you can do the following:

          First, you need to get an attribute from the request that was placed there before the dispatch:

          FacesContext fc = FacesContext.getCurrentInstance();
          ExternalContext ec = fc.getExternalContext();
          HttpServletRequest req = (HttpServletRequest)ec.getRequest();
          Object obj = req.getAttribute(PortletArtifactHack.PORTLET_HACK_KEY);

          The resulting object is an instance of PortletArtifactHack but it implements both PortletRequest and PortletConfig interfaces so you can cast it in any one of the following three ways depending on your requirements.

          PortletArtifactHack hack = (PortletArtifactHack)obj;
          PortletRequest portletRequest = (PortletRequest)obj;
          PortletConfig portletConfig = (PortletConfig)obj;

          Many of the methods throw UnsupportedOperationException()s. I've only exposed a few things that people need right away, like getPreferences().

          Show
          Deryk Sinotte added a comment - I checked in a very, very temporary mechanism for accessing portlet artifacts and APIs for this release. This should not be relied upon in any way, shape, or form in future releases. To access the PortletRequest, PortletConfig, and their associated APIs, you can do the following: First, you need to get an attribute from the request that was placed there before the dispatch: FacesContext fc = FacesContext.getCurrentInstance(); ExternalContext ec = fc.getExternalContext(); HttpServletRequest req = (HttpServletRequest)ec.getRequest(); Object obj = req.getAttribute(PortletArtifactHack.PORTLET_HACK_KEY); The resulting object is an instance of PortletArtifactHack but it implements both PortletRequest and PortletConfig interfaces so you can cast it in any one of the following three ways depending on your requirements. PortletArtifactHack hack = (PortletArtifactHack)obj; PortletRequest portletRequest = (PortletRequest)obj; PortletConfig portletConfig = (PortletConfig)obj; Many of the methods throw UnsupportedOperationException()s. I've only exposed a few things that people need right away, like getPreferences().
          Hide
          Deryk Sinotte added a comment -

          This hack doesn't seem to work well due to the intricacies of the JSF lifecycle. We need to sit down and decide how we want to do this properly for 1.6.

          Show
          Deryk Sinotte added a comment - This hack doesn't seem to work well due to the intricacies of the JSF lifecycle. We need to sit down and decide how we want to do this properly for 1.6.
          Ken Fyten made changes -
          Fix Version/s 1.6 [ 10031 ]
          Hide
          Neil Griffin added a comment -

          Deryk,

          Attached is is a simplified version of the PortletArtifactHack.java file that should do me well until you guys reach 1.7.

          Thanks,

          Neil

          Show
          Neil Griffin added a comment - Deryk, Attached is is a simplified version of the PortletArtifactHack.java file that should do me well until you guys reach 1.7. Thanks, Neil
          Neil Griffin made changes -
          Attachment PortletArtifactHack.java [ 10461 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #14104 Mon Jun 11 14:30:13 MDT 2007 deryk.sinotte ICE-1625: Simplified version of hack for this release to accomodate Liferay release
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletArtifactHack.java
          Hide
          Deryk Sinotte added a comment -

          I've checked in the supplied file so that it will be there for the 1.6 release.

          Show
          Deryk Sinotte added a comment - I've checked in the supplied file so that it will be there for the 1.6 release.
          Hide
          Deryk Sinotte added a comment -

          Marking as FIXED for 1.6. The current solution is completely temporary. A more comprehensive solution is required for the 1.7 release. A new case will be opened for that work.

          Show
          Deryk Sinotte added a comment - Marking as FIXED for 1.6. The current solution is completely temporary. A more comprehensive solution is required for the 1.7 release. A new case will be opened for that work.
          Deryk Sinotte made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Issue Type Bug [ 1 ] New Feature [ 2 ]
          Ken Fyten made changes -
          Fix Version/s 1.6DR#6 [ 10090 ]
          Fix Version/s 1.6 [ 10031 ]
          Ken Fyten made changes -
          Fix Version/s 1.6 [ 10031 ]
          Ken Fyten made changes -
          Link This issue blocks ICE-1809 [ ICE-1809 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Deryk Sinotte [ deryk.sinotte ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #14512 Mon Jul 16 11:04:48 MDT 2007 mircea.toma Refactor framework to detect and provide environment (servlet/portlet) specific functionality -- ICE-1625
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/inputfile/InputFile.java
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/component/FileUploadComponent.java
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/core/AsyncServerDetector.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletView.java
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/common/standard/StreamingContentHandler.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/core/DisposeViews.java
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/core/SingleViewServer.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/env/ServletEnvironmentRequest.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/FileUploadComponent.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/util/event/servlet/AbstractSessionEvent.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/EnvironmentAdaptingServlet.java
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/core/ViewBoundServer.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletRequestResponse.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletSessionMap.java
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/AbstractCopyingAttributeMap.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/common/RequestProxy.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletApplicationMap.java
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/env/PortletEnvironmentRenderRequest.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/env/CommonEnvironmentRequest.java
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/common/standard/FixedSizeContentHandler.java
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/core/MultiViewServer.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/common/Request.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ViewBoundAdaptingServlet.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/MainSessionBoundServlet.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletArtifactHack.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/DirectRequestAttributeMap.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/CopyingRequestAttributesMap.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/env/CommonEnvironmentResponse.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/common/standard/ChunkedXMLContentHandler.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/SingleViewServlet.java
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/View.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/env/ServletEnvironmentResponse.java
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/core/UploadServer.java
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletExternalContext.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/UploadServlet.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/SessionMap.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/BridgeExternalContext.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletExternalContext.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/MultiViewServlet.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/MainPortlet.java
          Commit graph DEL /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/portlet
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/common/standard/FixedXMLContentHandler.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #14516 Tue Jul 17 11:48:48 MDT 2007 mircea.toma Refactor -- ICE-1625
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/BridgeExternalContext.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletExternalContext.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletExternalContext.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #14517 Tue Jul 17 13:53:55 MDT 2007 mircea.toma Recreate map wrapper to capture new request attributes -- ICE-1625
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletExternalContext.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletExternalContext.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #14518 Tue Jul 17 14:03:49 MDT 2007 mircea.toma More refactoring -- ICE-1625
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/BridgeExternalContext.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletExternalContext.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletExternalContext.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #14523 Wed Jul 18 16:24:26 MDT 2007 mircea.toma Copy the enumeration to avoid concurrency problems -- ICE-1625
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/AbstractCopyingAttributeMap.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #14610 Fri Aug 03 12:37:56 MDT 2007 jack.van.ooststroom Backing out change for ICE-1625: 'Refactor framework to detect and provide environment (servlet/portlet) specific functionality -- ICE-1625'; This change was put it for some refactoring work done after the release of ICEfaces 1.6.0.
          Files Changed
          Commit graph MODIFY /projects/icefaces-ahs/trunk/icefaces-ahs/src/com/icesoft/faces/async/server/AsyncHttpServerAdaptingServlet.java
          Ken Fyten made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Ken Fyten made changes -
          Fix Version/s 1.6.1 [ 10070 ]
          Fix Version/s 1.7DR#1 [ 10100 ]
          Fix Version/s 1.6 [ 10031 ]
          Fix Version/s 1.6DR#6 [ 10090 ]
          Affects Version/s 1.6 [ 10031 ]
          Affects Version/s 1.6DR#4 [ 10060 ]
          Ken Fyten made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Affects [Documentation (User Guide, Ref. Guide, etc.), Compatibility/Configuration]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Fix Version/s 1.6.1 [ 10070 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #14770 Wed Aug 29 16:46:52 MDT 2007 jack.van.ooststroom Mircea: Refactor framework to detect and provide environment (servlet/portlet) specific functionality -- ICE-1625
          Files Changed
          Commit graph MODIFY /projects/icefaces-ahs/trunk/icefaces-ahs/src/com/icesoft/faces/async/server/AsyncHttpServerAdaptingServlet.java
          Ken Fyten made changes -
          Fix Version/s 1.7 [ 10080 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Deryk Sinotte
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: