Examples of StateString


Examples of org.gatein.pc.api.StateString

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

Examples of org.gatein.pc.api.StateString

         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

Examples of org.gatein.pc.api.StateString

         {
            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

Examples of org.gatein.pc.api.StateString

      }
      InteractionParams interactionParams = WSRPTypeFactory.createInteractionParams(WSRPUtils.getStateChangeFromAccessMode(accessMode));
      interactionParams.getExtensions().addAll(ExtensionAccess.getConsumerExtensionAccessor().getRequestExtensionsFor(InteractionParams.class));

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

Examples of org.gatein.pc.api.StateString

         String requestVerb = WSRPConsumerImpl.getHttpRequest(invocation).getMethod();
         getMarkupParams().setClientData(WSRPTypeFactory.createClientData(userAgent, requestVerb));
         getMarkupParams().getExtensions().addAll(ExtensionAccess.getConsumerExtensionAccessor().getRequestExtensionsFor(MarkupParams.class));

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

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))
         {
            appendParameter(baseURL, INTERACTION_STATE_PARAM_NAME, state.getStringValue());
         }

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

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

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

         appendParameter(baseURL, Constants.RESOURCE_ID_PARAMETER, resourceURL.getResourceId());

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

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

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

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

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

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

         Mode mode = renderURL.getMode();
         if (mode != null && !mode.equals(Mode.VIEW))
         {
            appendParameter(baseURL, 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)
                  {
                     appendParameter(baseURL, key, value);
                  }
               }
               else
               {
                  appendParameter(baseURL, "removePP", key);
               }
            }
         }

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

      return baseURL.toString();
   }
View Full Code Here

Examples of org.gatein.pc.api.StateString

          * 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

Examples of org.gatein.pc.api.StateString

         throw new IllegalArgumentException("Cannot construct a WSRPPortletURL from a null PortletURL!");
      }

      Mode mode = containerURL.getMode();
      WindowState windowState = containerURL.getWindowState();
      StateString navigationalState = containerURL.getNavigationalState();

      WSRPPortletURL url;
      if (containerURL instanceof ActionURL)
      {
         StateString interactionState = ((ActionURL)containerURL).getInteractionState();
         url = new WSRPActionURL(mode, windowState, secure, navigationalState, interactionState, context);
      }
      else if (containerURL instanceof RenderURL)
      {
         url = new WSRPRenderURL(mode, windowState, secure, navigationalState, ((RenderURL)containerURL).getPublicNavigationalStateChanges(), context);
View Full Code Here

Examples of org.gatein.pc.api.StateString

         // unserialize opaque state for debugging purpose
         if (log.isTraceEnabled())
         {
            if (WSRPRewritingConstants.INTERACTION_STATE.equals(name) || WSRPRewritingConstants.NAVIGATIONAL_STATE.equals(name))
            {
               StateString clear = ParametersStateString.create(value);
               log.trace(name + " value:" + clear);
            }
         }

         encodedURL = encodedURL.substring(endParamIndex + PARAM_SEPARATOR.length());
View Full Code Here

Examples of org.gatein.pc.api.StateString

      if (invocation instanceof RenderInvocation)
      {
         RenderInvocation renderInvocation = (RenderInvocation)invocation;

         //
         StateString navigationalState = renderInvocation.getNavigationalState();
         Map<String, String[]> publicNavigationalState = renderInvocation.getPublicNavigationalState();
         WindowState windowState = renderInvocation.getWindowState();
         Mode mode = renderInvocation.getMode();

         //
         CacheEntry cachedEntry = (CacheEntry)userContext.getAttribute(scopeKey);

         //
         if (cachedEntry != null)
         {
            // Check time validity for fragment
            boolean useEntry = false;
            StateString entryNavigationalState = cachedEntry.navigationalState;
            Map<String, String[]> entryPublicNavigationalState = cachedEntry.publicNavigationalState;

            // Then check nav state equality
            if (navigationalState == null)
            {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.