ICEfaces
  1. ICEfaces
  2. ICE-10282

ACE File Upload not working in portal environment

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.BETA
    • Fix Version/s: 4.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Portal portlet
    • Assignee Priority:
      P1

      Description

      When trying to upload a file with any of the File Entry examples, errors are logged on both the server and the client:

      Server:

      java.lang.NullPointerException
      at org.icefaces.impl.util.DOMUtils.printNode(DOMUtils.java:298)
      at org.icefaces.impl.util.DOMUtils.printNodeCDATA(DOMUtils.java:286)
      at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:208)
      at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:1004)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:430)
      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
      at com.liferay.faces.bridge.application.ViewHandlerCompatImpl.renderView(ViewHandlerCompatImpl.java:52)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
      at com.liferay.faces.bridge.BridgePhaseResourceImpl.execute(BridgePhaseResourceImpl.java:107)
      at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:128)
      at javax.portlet.faces.GenericFacesPortlet.serveResource(GenericFacesPortlet.java:178)
      at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:122)
      at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:82)
      at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:116)
      at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
      at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:112)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


      Client

      POST http://localhost:8080/web/guest/sc-solo?p_p_id=fileEntry_WAR_showcaseportle…&_fileEntry_WAR_showcaseportlet__facesViewIdResource=%2Fportlet-view.xhtml net::ERR_CONTENT_DECODING_FAILED sc-solo?p_p_id=fileEntry_WAR_showcaseportlet&p_p_lifecycle=2&p_p_state=norm…fileEntry_WAR_showcaseportlet__facesViewIdResource=%2Fportlet-view.xhtml:1
      POST http://localhost:8080/web/guest/sc-solo?p_p_id=fileEntry_WAR_showcaseportle…&_fileEntry_WAR_showcaseportlet__facesViewIdResource=%2Fportlet-view.xhtml net::ERR_CONTENT_DECODING_FAILED sc-solo?p_p_id=fileEntry_WAR_showcaseportlet&p_p_lifecycle=2&p_p_state=norm…fileEntry_WAR_showcaseportlet__facesViewIdResource=%2Fportlet-view.xhtml:1
      Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://localhost:8080" from accessing a frame with origin "null". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "data". Protocols must match.

        Activity

        Hide
        Mircea Toma added a comment -

        Modified ace:fileEntry to provide the view state key in the encodeURL field so that the state key can be read in portal environment and run the restore phase as expected. Also modified FileEntryUpload to read the 'file-entry-id' parameter of the parameter map extracted from the request's body.

        Show
        Mircea Toma added a comment - Modified ace:fileEntry to provide the view state key in the encodeURL field so that the state key can be read in portal environment and run the restore phase as expected. Also modified FileEntryUpload to read the 'file-entry-id' parameter of the parameter map extracted from the request's body.
        Hide
        Deryk Sinotte added a comment -

        All of the File Entry examples now work except for the Validation one. The size validation slider starts at a file size of 0KB and trying to upload a file results in it being invalid. This is correct because it exceeds the allowed size. However, changing the slider to a different value (e.g. 200KB) doesn't seem to work as all future uploads are still validated against the 0KB limit. It appears that the change to the slider value is not being transferred and/or persisted.

        Show
        Deryk Sinotte added a comment - All of the File Entry examples now work except for the Validation one. The size validation slider starts at a file size of 0KB and trying to upload a file results in it being invalid. This is correct because it exceeds the allowed size. However, changing the slider to a different value (e.g. 200KB) doesn't seem to work as all future uploads are still validated against the 0KB limit. It appears that the change to the slider value is not being transferred and/or persisted.
        Hide
        Mircea Toma added a comment -

        Added ice.window and ice.view parameters to the encoded URL of the uploading form so that window and view scopes are setup during request processing. In this case the window scoped bean holding the maximum file size is properly looked up instead of being re-instantiated like previously to this fix (with the maximum value set to zero).

        Show
        Mircea Toma added a comment - Added ice.window and ice.view parameters to the encoded URL of the uploading form so that window and view scopes are setup during request processing. In this case the window scoped bean holding the maximum file size is properly looked up instead of being re-instantiated like previously to this fix (with the maximum value set to zero).
        Hide
        Deryk Sinotte added a comment -

        Closing as I re-ran it in my environment and everything seems good with the validation slider now.

        Show
        Deryk Sinotte added a comment - Closing as I re-ran it in my environment and everything seems good with the validation slider now.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: