ICEfaces
  1. ICEfaces
  2. ICE-4826

DataExporter uses API that is not functional in portlets

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 1.8.2-RC1, 1.8.2
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      portlets dataexporter

      Description

      In the DataExporter.createFile method, the following logic is used:

              ServletContext context = ((HttpSession) FacesContext
                      .getCurrentInstance().getExternalContext().getSession(false))
                      .getServletContext();

      Casting to an HttpSession and attempting to retrieve the ServletContext will not work in portlets. In this case, the context is used to access the getRealPath() API to determine the location in the filesystem for storing/reading documents. The Portlet API also makes this available via the PortletContext. The code would need to look something like this:

              PortletContext pContext = ((PortletSession) FacesContext
                      .getCurrentInstance().getExternalContext().getSession(false))
                      .getPortletContext();

      There is no JSF way to do this that will work in both environments unfortunately so we'll need to ensure that this is done in a way that doesn't require a runtime dependency on the portlet.jar as it will not be available in plain web-apps.

        Issue Links

          Activity

          Repository Revision Date User Message
          ICEsoft Public SVN Repository #20024 Fri Dec 18 11:36:35 MST 2009 adnan.durrani 1.8.2EE DataExporter changes moved to Compat DataExporter towards ICE-4481. The changes include the fix of following JIRAs ICE-4484, ICE-4390, ICE-4660, ICE-4223, ICE-4823, ICE-4836, ICE-4837, ICE-4764, ICE-4730, ICE-4844, ICE-4289, ICE-4826, ICE-4863, ICE-4934, ICE-4955
          Files Changed
          Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/component-metadata/src/main/resources/conf/ice_cust_properties/cust-dataExporter-props.xml
          Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/core/src/main/resources/META-INF/resources/ice-extras.js
          Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/samples/component-showcase/web/WEB-INF/includes/examples/custom/dataTable-dataExporter.xhtml
          Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/components/src/main/java/com/icesoft/faces/component/dataexporter/DataExporter.java
          Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/components/src/main/java/com/icesoft/faces/component/dataexporter/DataExporterRenderer.java
          Commit graph MODIFY /icefaces/scratchpads/glimmer/compat/core/src/main/java/com/icesoft/faces/util/CoreUtils.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #19188 Mon Aug 24 08:41:37 MDT 2009 adnan.durrani Fix for ICE-4826 (DataExporter uses API that is not functional in portlets )
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/util/CoreUtils.java
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/dataexporter/DataExporter.java

            People

            • Assignee:
              Adnan Durrani
              Reporter:
              Deryk Sinotte
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: