ICEpush
  1. ICEpush
  2. PUSH-327

Make use of Browser-ID and Sub-ID from Push-ID

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.BETA
    • Fix Version/s: 4.0
    • Component/s: Push Library
    • Labels:
      None
    • Environment:
      ICEpush

      Description

      The Push-ID is built from a combination of Browser-ID and Sub-ID. We should make these available from the PushID class and use them.

        Activity

        Hide
        Jack Van Ooststroom added a comment - - edited

        Sending core/src/main/java/org/icepush/Browser.java
        Sending core/src/main/java/org/icepush/PushID.java
        Transmitting file data ..
        Committed revision 41534.

        Sending eps/src/main/java/com/icesoft/push/PushID.java
        Transmitting file data .
        Committed revision 38759.

        Sending src/main/java/com/icesoft/notify/push/PushID.java
        Transmitting file data .
        Committed revision 38761.

        Show
        Jack Van Ooststroom added a comment - - edited Sending core/src/main/java/org/icepush/Browser.java Sending core/src/main/java/org/icepush/PushID.java Transmitting file data .. Committed revision 41534. Sending eps/src/main/java/com/icesoft/push/PushID.java Transmitting file data . Committed revision 38759. Sending src/main/java/com/icesoft/notify/push/PushID.java Transmitting file data . Committed revision 38761.
        Hide
        Jack Van Ooststroom added a comment -

        The PushID class parses the Browser-ID and Sub-ID parsed out of the Push-ID upon object instantiation. In addition the setBrowserID(...) has been removed as the Browser-ID for a Push-ID never changes. Marking this one as FIXED.

        Show
        Jack Van Ooststroom added a comment - The PushID class parses the Browser-ID and Sub-ID parsed out of the Push-ID upon object instantiation. In addition the setBrowserID(...) has been removed as the Browser-ID for a Push-ID never changes. Marking this one as FIXED.
        Hide
        Carmen Cristurean added a comment -

        Re-opening because of the following issue:

        Starting with ICEfaces4 Trunk Jenkins Build #458, showcase application cannot be accessed in any browser because of a server-side exception.
        The same error is seen when building QA test applications for the ACE Components:

        HTTP Status 500 -

        type Exception report
        message

        description The server encountered an internal error () that prevented it from fulfilling this request.

        exception
        javax.servlet.ServletException: String index out of range: -1
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)

        root cause
        java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        java.lang.String.substring(String.java:1911)
        org.icepush.PushID.<init>(PushID.java:42)
        org.icepush.LocalPushGroupManager.newPushID(LocalPushGroupManager.java:661)
        org.icepush.LocalPushGroupManager.addMember(LocalPushGroupManager.java:500)
        org.icepush.LocalPushGroupManager.addMember(LocalPushGroupManager.java:123)
        org.icepush.PushContext.addGroupMember(PushContext.java:131)
        org.icefaces.impl.push.SessionViewManager.addView(SessionViewManager.java:51)
        org.icefaces.impl.event.BridgeSetup$2.encode(BridgeSetup.java:200)
        org.icefaces.impl.event.UIOutputWriter.encodeBegin(UIOutputWriter.java:27)
        javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854)
        com.sun.faces.renderkit.html_basic.BodyRenderer.encodeEnd(BodyRenderer.java:105)
        javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
        javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
        javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
        com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
        com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
        javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
        com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
        com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)

        Show
        Carmen Cristurean added a comment - Re-opening because of the following issue: Starting with ICEfaces4 Trunk Jenkins Build #458, showcase application cannot be accessed in any browser because of a server-side exception. The same error is seen when building QA test applications for the ACE Components: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: String index out of range: -1 javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) root cause java.lang.StringIndexOutOfBoundsException: String index out of range: -1 java.lang.String.substring(String.java:1911) org.icepush.PushID.<init>(PushID.java:42) org.icepush.LocalPushGroupManager.newPushID(LocalPushGroupManager.java:661) org.icepush.LocalPushGroupManager.addMember(LocalPushGroupManager.java:500) org.icepush.LocalPushGroupManager.addMember(LocalPushGroupManager.java:123) org.icepush.PushContext.addGroupMember(PushContext.java:131) org.icefaces.impl.push.SessionViewManager.addView(SessionViewManager.java:51) org.icefaces.impl.event.BridgeSetup$2.encode(BridgeSetup.java:200) org.icefaces.impl.event.UIOutputWriter.encodeBegin(UIOutputWriter.java:27) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854) com.sun.faces.renderkit.html_basic.BodyRenderer.encodeEnd(BodyRenderer.java:105) javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456) com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133) javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
        Hide
        Mircea Toma added a comment - - edited

        Modified BridgeSetup to use the PushContext when generating view IDs since these IDs are also push IDs (previously the IDs where not respecting the browserID:pushID format). Modified client ID creation to normalise the string used for *-retrieve-update and *-single-submit forms.

        Show
        Mircea Toma added a comment - - edited Modified BridgeSetup to use the PushContext when generating view IDs since these IDs are also push IDs (previously the IDs where not respecting the browserID:pushID format). Modified client ID creation to normalise the string used for *-retrieve-update and *-single-submit forms.
        Hide
        Deryk Sinotte added a comment -

        Running showcase-portlet results in the following exception:

        Caused by: java.lang.ClassCastException: com.liferay.portlet.PortletContextImpl cannot be cast to javax.servlet.ServletContext
        	at org.icefaces.impl.event.BridgeSetup.generateViewID(BridgeSetup.java:267)
        	at org.icefaces.impl.event.BridgeSetup.assignViewID(BridgeSetup.java:259)
        	at org.icefaces.impl.event.BridgeSetup.access$300(BridgeSetup.java:47)
        	at org.icefaces.impl.event.BridgeSetup$AssignViewID.beforePhase(BridgeSetup.java:291)
        	at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
        	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
        

        The code in question is non-portlet friendly since it casts to servlet specific classes (ServletContext and HttpServlet*):

            private String generateViewID(ExternalContext externalContext) {
                if (EnvUtils.isICEpushPresent()) {
                    PushContext pushContext = PushContext.getInstance((ServletContext) externalContext.getContext());
                    return pushContext.createPushId((HttpServletRequest) externalContext.getRequest(), (HttpServletResponse) externalContext.getResponse());
                }
        
                return "v" + Integer.toString(hashCode(), 36) + Integer.toString(++seed, 36);
            }
        
        Show
        Deryk Sinotte added a comment - Running showcase-portlet results in the following exception: Caused by: java.lang.ClassCastException: com.liferay.portlet.PortletContextImpl cannot be cast to javax.servlet.ServletContext at org.icefaces.impl.event.BridgeSetup.generateViewID(BridgeSetup.java:267) at org.icefaces.impl.event.BridgeSetup.assignViewID(BridgeSetup.java:259) at org.icefaces.impl.event.BridgeSetup.access$300(BridgeSetup.java:47) at org.icefaces.impl.event.BridgeSetup$AssignViewID.beforePhase(BridgeSetup.java:291) at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99) The code in question is non-portlet friendly since it casts to servlet specific classes (ServletContext and HttpServlet*): private String generateViewID(ExternalContext externalContext) { if (EnvUtils.isICEpushPresent()) { PushContext pushContext = PushContext.getInstance((ServletContext) externalContext.getContext()); return pushContext.createPushId((HttpServletRequest) externalContext.getRequest(), (HttpServletResponse) externalContext.getResponse()); } return "v" + Integer.toString(hashCode(), 36) + Integer.toString(++seed, 36); }
        Hide
        Mircea Toma added a comment -

        Modified BridgeSetup.generateViewID method to use EnvUtils.getSafe* methods for extracting servlet's context, request and response from the FacesContext.

        Show
        Mircea Toma added a comment - Modified BridgeSetup.generateViewID method to use EnvUtils.getSafe* methods for extracting servlet's context, request and response from the FacesContext .

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Jack Van Ooststroom
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: