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

          Deryk Sinotte created issue -
          Deryk Sinotte made changes -
          Field Original Value New Value
          Assignee Ken Fyten [ ken.fyten ]
          Ken Fyten made changes -
          Salesforce Case []
          Fix Version/s 1.8.2 [ 10190 ]
          Assignee Priority P2
          Assignee Ken Fyten [ ken.fyten ] Adnan Durrani [ adnan.durrani ]
          Ken Fyten made changes -
          Salesforce Case []
          Affects [Compatibility/Configuration]
          Adnan Durrani made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Adnan Durrani made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Adnan Durrani made changes -
          Link This issue blocks ICE-4367 [ ICE-4367 ]
          Ken Fyten made changes -
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          Salesforce Case []
          Ken Fyten made changes -
          Fix Version/s 1.8.2-RC1 [ 10210 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Priority P2

            People

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

              Dates

              • Created:
                Updated:
                Resolved: