Package org.gatein.common.util

Examples of org.gatein.common.util.ContentInfo


         // create markup params
         org.gatein.pc.api.spi.UserContext userContext = invocation.getUserContext();
         ParameterValidation.throwIllegalArgExceptionIfNull(userContext, USER_CONTEXT);
         PortletInvocationContext context = invocation.getContext();
         ParameterValidation.throwIllegalArgExceptionIfNull(context, INVOCATION_CONTEXT);
         ContentInfo streamInfo = context.getMarkupInfo();
         ParameterValidation.throwIllegalArgExceptionIfNull(streamInfo, STREAM_INFO);

         String mode;
         try
         {
            mode = WSRPUtils.getWSRPNameFromJSR168PortletMode(invocation.getMode());
         }
         catch (Exception e)
         {
            log.debug("Mode was null in context.");
            mode = WSRPConstants.VIEW_MODE;
         }

         String windowState;
         try
         {
            windowState = WSRPUtils.getWSRPNameFromJSR168WindowState(invocation.getWindowState());
         }
         catch (Exception e)
         {
            log.debug("WindowState was null in context.");
            windowState = WSRPConstants.NORMAL_WINDOW_STATE;
         }

         this.markupParams = WSRPTypeFactory.createMarkupParams(securityContext.isSecure(),
            WSRPUtils.convertLocalesToRFC3066LanguageTags(userContext.getLocales()),
            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();
View Full Code Here


    * @return the set of portlet modes
    */
   private Set<org.gatein.pc.api.Mode> buildSupportedModes()
   {
      // Get content type
      ContentInfo si = invocation.getContext().getMarkupInfo();

      //
      org.gatein.pc.api.spi.PortalContext  portalContext =invocation.getPortalContext();

      // Get the modes for this content type
      CapabilitiesInfo capabilities = container.getInfo().getCapabilities();

      // Add all the modes
      Set<org.gatein.pc.api.Mode> modes = new HashSet<org.gatein.pc.api.Mode>();
      for (ModeInfo modeInfo : capabilities.getModes(si.getMediaType()))
      {
         org.gatein.pc.api.Mode mode = modeInfo.getMode();

         //
         if (modeInfo instanceof PortletManagedModeInfo || portalContext.getModes().contains(mode))
View Full Code Here

      // create markup params
      UserContext userContext = invocation.getUserContext();
      ParameterValidation.throwIllegalArgExceptionIfNull(userContext, USER_CONTEXT);
      PortletInvocationContext context = invocation.getContext();
      ParameterValidation.throwIllegalArgExceptionIfNull(context, INVOCATION_CONTEXT);
      ContentInfo streamInfo = context.getMarkupInfo();
      ParameterValidation.throwIllegalArgExceptionIfNull(streamInfo, STREAM_INFO);

      String mode;
      try
      {
         mode = WSRPUtils.getWSRPNameFromJSR168PortletMode(invocation.getMode());
      }
      catch (Exception e)
      {
         log.debug("Mode was null in context.");
         mode = WSRPConstants.VIEW_MODE;
      }

      String windowState;
      try
      {
         windowState = WSRPUtils.getWSRPNameFromJSR168WindowState(invocation.getWindowState());
      }
      catch (Exception e)
      {
         log.debug("WindowState was null in context.");
         windowState = WSRPConstants.NORMAL_WINDOW_STATE;
      }

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

         // create markup params
         org.gatein.pc.api.spi.UserContext userContext = invocation.getUserContext();
         ParameterValidation.throwIllegalArgExceptionIfNull(userContext, USER_CONTEXT);
         PortletInvocationContext context = invocation.getContext();
         ParameterValidation.throwIllegalArgExceptionIfNull(context, INVOCATION_CONTEXT);
         ContentInfo streamInfo = context.getMarkupInfo();
         ParameterValidation.throwIllegalArgExceptionIfNull(streamInfo, STREAM_INFO);

         String mode;
         try
         {
            mode = WSRPUtils.getWSRPNameFromJSR168PortletMode(invocation.getMode());
         }
         catch (Exception e)
         {
            log.debug("Mode was null in context.");
            mode = WSRPConstants.VIEW_MODE;
         }

         String windowState;
         try
         {
            windowState = WSRPUtils.getWSRPNameFromJSR168WindowState(invocation.getWindowState());
         }
         catch (Exception e)
         {
            log.debug("WindowState was null in context.");
            windowState = WSRPConstants.NORMAL_WINDOW_STATE;
         }

         this.markupParams = WSRPTypeFactory.createMarkupParams(securityContext.isSecure(),
            WSRPUtils.convertLocalesToRFC3066LanguageTags(userContext.getLocales()),
            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();
View Full Code Here

    * @return the set of portlet modes
    */
   private Set<org.gatein.pc.api.Mode> buildSupportedModes()
   {
      // Get content type
      ContentInfo si = invocation.getContext().getMarkupInfo();

      //
      org.gatein.pc.api.spi.PortalContext  portalContext =invocation.getPortalContext();

      // Get the modes for this content type
      CapabilitiesInfo capabilities = container.getInfo().getCapabilities();

      // Add all the modes
      Set<org.gatein.pc.api.Mode> modes = new HashSet<org.gatein.pc.api.Mode>();
      for (ModeInfo modeInfo : capabilities.getModes(si.getMediaType()))
      {
         org.gatein.pc.api.Mode mode = modeInfo.getMode();

         //
         if (modeInfo instanceof PortletManagedModeInfo || portalContext.getModes().contains(mode))
View Full Code Here

TOP

Related Classes of org.gatein.common.util.ContentInfo

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.