Package org.gatein.pc.api

Examples of org.gatein.pc.api.StateString


      WindowState windowState = windowNS.getWindowState();
      if (update.getWindowState() != null)
      {
         windowState = update.getWindowState();
      }
      StateString portletNS = windowNS.getPortletNavigationalState();
      if (update.getNavigationalState() != null)
      {
         portletNS = update.getNavigationalState();
      }
      windowNS = new PortletWindowNavigationalState(portletNS, mode, windowState);
View Full Code Here


         windowState = WindowState.create(queryParameters.get(ControllerRequestParameterNames.WINDOW_STATE));
      }

      //
      String navigationalStateString = queryParameters.get(ControllerRequestParameterNames.NAVIGATIONAL_STATE);
      StateString navigationalState = null;
      if (navigationalStateString != null)
      {
         navigationalState = StateString.create(navigationalStateString);
      }

      //
      PortletWindowNavigationalState windowNavigationalState = new PortletWindowNavigationalState(navigationalState, mode, windowState);

      //
      String phase = queryParameters.get(ControllerRequestParameterNames.LIFECYCLE_PHASE);
      if (ControllerRequestParameterNames.RESOURCE_PHASE.equals(phase))
      {
         StateString resourceState = StateString.create(queryParameters.get(ControllerRequestParameterNames.RESOURCE_STATE));
         String resourceId = queryParameters.get(ControllerRequestParameterNames.RESOURCE_ID);

         //
         CacheLevel resourceCacheLevel = CacheLevel.create(queryParameters.get(ControllerRequestParameterNames.RESOURCE_CACHEABILITY));

         //
         PortletResourceRequest.Scope scope;
         if (CacheLevel.FULL.equals(resourceCacheLevel))
         {
            scope = new PortletResourceRequest.FullScope();
         }
         else if (CacheLevel.PORTLET.equals(resourceCacheLevel))
         {
            scope = new PortletResourceRequest.PortletScope(windowNavigationalState);
         }
         else if (CacheLevel.PAGE.equals(resourceCacheLevel))
         {
            scope = new PortletResourceRequest.PageScope(windowNavigationalState, pageNavigationalState);
         }
         else
         {
            throw new AssertionError();
         }

         //
         return new PortletResourceRequest(
            windowId,
            resourceId,
            resourceState,
            formParameterMap,
            scope);
      }
      else
      {
         if (ControllerRequestParameterNames.ACTION_PHASE.equals(phase))
         {
            StateString interactionState = StateString.create(queryParameters.get(ControllerRequestParameterNames.INTERACTION_STATE));

            //
            return new PortletActionRequest(
               windowId,
               interactionState,
View Full Code Here

            {
               parameters.put(ControllerRequestParameterNames.NAVIGATIONAL_STATE, actionURL.getNavigationalState().getStringValue());
            }

            //
            StateString interactionState = actionURL.getInteractionState();
            parameters.put(ControllerRequestParameterNames.INTERACTION_STATE, interactionState.getStringValue());
         }
         else
         {
            RenderURL renderURL = (RenderURL)containerURL;

            //
            Map<String, String[]> changes = renderURL.getPublicNavigationalStateChanges();
            byte[] bytes = IOTools.serialize(Serialization.PARAMETER_MAP, SerializationFilter.COMPRESSOR, changes);
            String ns = Base64.encodeBytes(bytes, Base64.EncodingOption.USEURLSAFEENCODING);
            parameters.put(ControllerRequestParameterNames.PUBLIC_NAVIGATIONAL_STATE_CHANGES, ns);

            //
            StateString navigationalState = renderURL.getNavigationalState();
            if (navigationalState != null)
            {
               parameters.put(ControllerRequestParameterNames.NAVIGATIONAL_STATE, navigationalState.getStringValue());
            }
         }
      }
      else
      {
         ResourceURL resourceURL = (ResourceURL)containerURL;

         //
         StateString resourceState = resourceURL.getResourceState();
         parameters.put(ControllerRequestParameterNames.RESOURCE_STATE, resourceState.getStringValue());

         //
         String resourceId = resourceURL.getResourceId();
         if (resourceId != null)
         {
View Full Code Here

      //
      Mode mode = null;
      org.gatein.pc.api.WindowState windowState = null;
      PortletPageNavigationalState pageNavigationalState = null;
      Map<String, String[]> publicNS = null;
      StateString portletNS = null;
      CacheLevel cacheability;

      PortletResourceRequest.Scope scope = portletResourceRequest.getScope();

      //
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

          * 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();
         uiPortlet.setNavigationalState(navigationalState);

         // update the public render parameters with the changes from the invocation
         setupPublicRenderParams(uiPortlet, navStateResponse.getPublicNavigationalStateUpdates());

View Full Code Here

      markupParams = WSRPTypeFactory.createMarkupParams(securityContext.isSecure(),
         WSRPUtils.convertLocalesToRFC3066LanguageTags(userContext.getLocales()),
         Collections.singletonList(streamInfo.getMediaType().getValue()), mode, windowState);
      String userAgent = WSRPConsumerImpl.getHttpRequest(invocation).getHeader(USER_AGENT);
      markupParams.setClientData(WSRPTypeFactory.createClientData(userAgent));
      StateString navigationalState = invocation.getNavigationalState();
      if (navigationalState != null)
      {
         String state = navigationalState.getStringValue();
         if (!StateString.JBPNS_PREFIX.equals(state))  // fix-me: see JBPORTAL-900
         {
            markupParams.setNavigationalState(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

             * 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

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.