Package org.gatein.pc.api

Examples of org.gatein.pc.api.StateString


        }

        if (containerURL instanceof ActionURL) {
            ActionURL actionURL = (ActionURL) containerURL;

            StateString state = actionURL.getInteractionState();
            if (state != null && !state.getStringValue().equals(StateString.JBPNS_PREFIX)) {
                url.setQueryParameterValue(INTERACTION_STATE_PARAM_NAME, state.getStringValue());
            }

            state = actionURL.getNavigationalState();
            if (state != null && !state.getStringValue().equals(StateString.JBPNS_PREFIX)) {
                url.setQueryParameterValue(NAVIGATIONAL_STATE_PARAM_NAME, state.getStringValue());
            }

            WindowState windowState = actionURL.getWindowState();
            if (windowState != null) {
                url.setQueryParameterValue(Constants.WINDOW_STATE_PARAMETER, windowState.toString());
            }

            Mode mode = actionURL.getMode();
            if (mode != null) {
                url.setQueryParameterValue(Constants.PORTLET_MODE_PARAMETER, mode.toString());
            }
        } else if (containerURL instanceof ResourceURL) {
            ResourceURL resourceURL = (ResourceURL) containerURL;

            url.setQueryParameterValue(Constants.RESOURCE_ID_PARAMETER, resourceURL.getResourceId());

            CacheLevel cachability = resourceURL.getCacheability();
            if (cachability != null) {
                url.setQueryParameterValue(Constants.CACHELEVEL_PARAMETER, cachability.name());
            }

            StateString resourceState = resourceURL.getResourceState();
            if (resourceState != null && !resourceState.getStringValue().equals(StateString.JBPNS_PREFIX)) {
                url.setQueryParameterValue(RESOURCE_STATE_PARAM_NAME, resourceState.getStringValue());
            }

            resourceState = resourceURL.getNavigationalState();
            if (resourceState != null && !resourceState.getStringValue().equals(StateString.JBPNS_PREFIX)) {
                url.setQueryParameterValue(NAVIGATIONAL_STATE_PARAM_NAME, resourceState.getStringValue());
            }

            WindowState windowState = resourceURL.getWindowState();
            if (windowState != null) {
                url.setQueryParameterValue(Constants.WINDOW_STATE_PARAMETER, windowState.toString());
            }

            Mode mode = resourceURL.getMode();
            if (mode != null) {
                url.setQueryParameterValue(Constants.PORTLET_MODE_PARAMETER, mode.toString());
            }
        } else {
            RenderURL renderURL = (RenderURL) containerURL;

            WindowState windowState = renderURL.getWindowState();
            if (windowState != null)// && !windowState.equals(WindowState.NORMAL))
            {
                url.setQueryParameterValue(Constants.WINDOW_STATE_PARAMETER, windowState.toString());
            }

            Mode mode = renderURL.getMode();
            if (mode != null) {
                url.setQueryParameterValue(Constants.PORTLET_MODE_PARAMETER, mode.toString());
            }

            Map<String, String[]> publicNSChanges = renderURL.getPublicNavigationalStateChanges();
            if (ParameterValidation.existsAndIsNotEmpty(publicNSChanges)) {
                for (String key : publicNSChanges.keySet()) {
                    String[] values = publicNSChanges.get(key);
                    if (values != null && values.length > 0) {
                        for (String value : values) {
                            url.setQueryParameterValue(key, value);
                        }
                    } else {
                        url.setQueryParameterValue("removePP", key);
                    }
                }
            }

            StateString state = renderURL.getNavigationalState();
            if (state != null && !state.getStringValue().equals(StateString.JBPNS_PREFIX)) {
                url.setQueryParameterValue(NAVIGATIONAL_STATE_PARAM_NAME, state.getStringValue());
            }
        }

        //
        Map<String, String> props = containerURL.getProperties();
View Full Code Here


            // update the portlet with the next mode to display
            PortletMode mode = new PortletMode(getPortletModeOrDefault(navResponse));
            setNextMode(uiPortlet, mode);

            StateString navState = navResponse.getNavigationalState();
            if (navState != null) {
                uiPortlet.setNavigationalState(navResponse.getNavigationalState());
            }
            setupPublicRenderParams(uiPortlet, navResponse.getPublicNavigationalStateUpdates());
View Full Code Here

             * rendered (except using directly a RenderURL) those parameters are added to the portlet request to preserve the
             * portlet state among all the portal clicks
             */

            //
            StateString navigationalState = navStateResponse.getNavigationalState();
            if (navigationalState != null) {
                uiPortlet.setNavigationalState(navigationalState);
            }

            // update the public render parameters with the changes from the invocation
View Full Code Here

      invocation.setMode(WSRPUtils.getJSR168PortletModeFromWSRPName(markupRequest.getMode()));

      NavigationalContext navigationalContext = params.getNavigationalContext();
      if (navigationalContext != null)
      {
         StateString navigationalState = createNavigationalState(navigationalContext.getOpaqueValue());
         invocation.setNavigationalState(navigationalState);

         List<NamedString> publicParams = navigationalContext.getPublicValues();

View Full Code Here

      // Request context
      WSRPRequestContext requestContext = WSRPRequestContext.createRequestContext(markupRequest, interactionParams);
      invocation.setRequestContext(requestContext);

      // Interaction state, navigational state is already taken care of in RequestProcessor.prepareInvocation
      StateString interactionState = createNavigationalState(interactionParams.getInteractionState());
      invocation.setInteractionState(interactionState);

      // Form parameters
      invocation.setForm(requestContext.getForm());
View Full Code Here

         {
            resourceParams.getFormParameters().add(WSRPTypeFactory.createNamedString(name, value));
         }
      }

      StateString resourceState = invocation.getResourceState();
      if (resourceState != null)
      {
         String state = resourceState.getStringValue();
         if (!StateString.JBPNS_PREFIX.equals(state))  // fix-me: see JBPORTAL-900
         {
            resourceParams.setResourceState(state);
         }
      }
View Full Code Here

         log.debug("Portlet is requesting " + accessMode + " access mode");
      }
      InteractionParams interactionParams = WSRPTypeFactory.createInteractionParams(WSRPUtils.getStateChangeFromAccessMode(accessMode));

      // interaction state
      StateString interactionState = actionInvocation.getInteractionState();
      if (interactionState != null)
      {
         String state = interactionState.getStringValue();
         if (!StateString.JBPNS_PREFIX.equals(state))  // fix-me: see JBPORTAL-900
         {
            interactionParams.setInteractionState(state);
         }
      }
View Full Code Here

            Collections.singletonList(streamInfo.getMediaType().getValue()), mode, windowState);
         String userAgent = WSRPConsumerImpl.getHttpRequest(invocation).getHeader(USER_AGENT);
         getMarkupParams().setClientData(WSRPTypeFactory.createClientData(userAgent));

         // navigational state
         StateString navigationalState = invocation.getNavigationalState();
         Map<String, String[]> publicNavigationalState = invocation.getPublicNavigationalState();

         // it is possible to get additional public navigational state from the invocation attributes if the producer used templates:
         String publicNS = (String)invocation.getAttribute(WSRP2RewritingConstants.NAVIGATIONAL_VALUES);
         if (!ParameterValidation.isNullOrEmpty(publicNS))
View Full Code Here

      }

      //
      org.gatein.pc.api.Mode mode = Mode.VIEW;
      org.gatein.pc.api.WindowState windowState = org.gatein.pc.api.WindowState.NORMAL;
      StateString portletNS = null;

      //
      if (windowNS != null)
      {
         if (windowNS.getMode() != null)
View Full Code Here

      int size = data.readInt();
      while (size-- > 0)
      {
         String windowId = data.readUTF();
         byte header = data.readByte();
         StateString portletNS = null;
         if ((header & 1) != 0)
         {
            portletNS = StateString.create(data);
         }
         org.gatein.pc.api.WindowState windowState = null;
View Full Code Here

TOP

Related Classes of org.gatein.pc.api.StateString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.