Package org.gatein.pc.api

Examples of org.gatein.pc.api.WindowState


            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());
View Full Code Here


         {
            mode = org.gatein.pc.api.Mode.VIEW;
         }

         //
         WindowState windowState = portletActionRequest.getWindowNavigationalState().getWindowState();
         if (windowState == null)
         {
            windowState = WindowState.NORMAL;
         }
View Full Code Here

      org.gatein.pc.api.Mode mode = windowNS.getMode();
      if (update.getMode() != null)
      {
         mode = update.getMode();
      }
      WindowState windowState = windowNS.getWindowState();
      if (update.getWindowState() != null)
      {
         windowState = update.getWindowState();
      }
      StateString portletNS = windowNS.getPortletNavigationalState();
View Full Code Here

      {
         mode = org.gatein.pc.api.Mode.create(queryParameters.get(ControllerRequestParameterNames.MODE));
      }

      //
      WindowState windowState = null;
      if (queryParameters.get(ControllerRequestParameterNames.WINDOW_STATE) != null)
      {
         windowState = WindowState.create(queryParameters.get(ControllerRequestParameterNames.WINDOW_STATE));
      }
View Full Code Here

      {
         mode = org.gatein.pc.api.Mode.create(queryParameters.get(ControllerRequestParameterNames.MODE));
      }

      //
      WindowState windowState = null;
      if (queryParameters.get(ControllerRequestParameterNames.WINDOW_STATE) != null)
      {
         windowState = WindowState.create(queryParameters.get(ControllerRequestParameterNames.WINDOW_STATE));
      }
View Full Code Here

         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))
         {
View Full Code Here

   }

   public static WindowState getJSR168WindowStateFromWSRPName(String wsrpWindowStateName)
   {
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(wsrpWindowStateName, WSRP_WINDOW_STATE_NAME, null);
      WindowState windowState = WSRP_JSR168_WINDOW_STATES.get(wsrpWindowStateName);
      return (windowState == null) ? WindowState.create(wsrpWindowStateName) : windowState;
   }
View Full Code Here

      {
         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)
      {
View Full Code Here

         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)
            {
               if (entryNavigationalState == null)
               {
                  useEntry = true;
               }
               else if (entryNavigationalState instanceof ParametersStateString)
               {
                  // We consider a parameters state string empty equivalent to a null value
                  useEntry = ((ParametersStateString)entryNavigationalState).getSize() == 0;
               }
            }
            else if (entryNavigationalState == null)
            {
               if (navigationalState instanceof ParametersStateString)
               {
                  useEntry = ((ParametersStateString)navigationalState).getSize() == 0;
               }
            }
            else
            {
               useEntry = navigationalState.equals(entryNavigationalState);
            }

            // Check public nav state equality
            if (useEntry)
            {
               if (publicNavigationalState == null)
               {
                  if (entryPublicNavigationalState == null)
                  {
                     //
                  }
                  else
                  {
                     useEntry = entryPublicNavigationalState.size() == 0;
                  }
               }
               else if (entryPublicNavigationalState == null)
               {
                  useEntry = publicNavigationalState.size() == 0;
               }
               else
               {
                  ParameterMap publicPM = ParameterMap.wrap(publicNavigationalState);
                  ParameterMap entryPM = ParameterMap.wrap(entryPublicNavigationalState);
                  useEntry = publicPM.equals(entryPM);
               }
            }

            // Then check window state equality
            useEntry &= windowState.equals(cachedEntry.windowState);

            // Then check mode equality
            useEntry &= mode.equals(cachedEntry.mode);

            // Clean if it is null
View Full Code Here

      {
         mode = org.gatein.pc.api.Mode.create(queryParameters.get(ControllerRequestParameterNames.MODE));
      }

      //
      WindowState windowState = null;
      if (queryParameters.get(ControllerRequestParameterNames.WINDOW_STATE) != null)
      {
         windowState = WindowState.create(queryParameters.get(ControllerRequestParameterNames.WINDOW_STATE));
      }
View Full Code Here

TOP

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

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.