Package de.innovationgate.wgpublisher.plugins

Examples of de.innovationgate.wgpublisher.plugins.WGAPluginSet$RuntimeContext


   public static GetMarkup toV2GetMarkup(V1GetMarkup getMarkup)
   {
      if (getMarkup != null)
      {
         PortletContext portletContext = toV2PortletContext(getMarkup.getPortletContext());
         RuntimeContext runtimeContext = toV2RuntimeContext(getMarkup.getRuntimeContext(), portletContext.getPortletHandle());
         MarkupParams markupParams = toV2MarkupParams(getMarkup.getMarkupParams());
         RegistrationContext registrationContext = toV2RegistrationContext(getMarkup.getRegistrationContext());
         UserContext userContext = toV2UserContext(getMarkup.getUserContext());

         return WSRPTypeFactory.createGetMarkup(registrationContext, portletContext, runtimeContext, userContext, markupParams);
View Full Code Here


      if (performBlockingInteraction != null)
      {
         InteractionParams interactionParams = toV2InteractionParams(performBlockingInteraction.getInteractionParams());
         MarkupParams markupParams = toV2MarkupParams(performBlockingInteraction.getMarkupParams());
         PortletContext portletContext = toV2PortletContext(performBlockingInteraction.getPortletContext());
         RuntimeContext runtimeContext = toV2RuntimeContext(performBlockingInteraction.getRuntimeContext(), portletContext.getPortletHandle());

         return WSRPTypeFactory.createPerformBlockingInteraction(toV2RegistrationContext(performBlockingInteraction.getRegistrationContext()),
            portletContext, runtimeContext, toV2UserContext(performBlockingInteraction.getUserContext()), markupParams, interactionParams);
      }
      else
View Full Code Here

   {
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(userAuthentication, "user authentication", "RuntimeContext");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletInstanceKey, "Portlet Instance Key", "RuntimeContext");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(namespacePrefix, "Namespace Prefix", "RuntimeContext");

      RuntimeContext runtimeContext = new RuntimeContext();
      runtimeContext.setUserAuthentication(userAuthentication);
      runtimeContext.setPortletInstanceKey(portletInstanceKey);
      runtimeContext.setNamespacePrefix(namespacePrefix);
      return runtimeContext;
   }
View Full Code Here

         registrationContext = WSRPTypeFactory.createRegistrationContext(registrationHandle);
      }

      String instanceKey = URLTools.decodeXWWWFormURL(req.getParameter(INSTANCE_KEY));
      String ns = req.getParameter(NS);
      RuntimeContext runtimeContext = WSRPTypeFactory.createRuntimeContext(WSRPConstants.NONE_USER_AUTHENTICATION, instanceKey, ns);

      Enumeration reqLocales = req.getLocales();
      List<String> locales = WSRPUtils.convertLocalesToRFC3066LanguageTags(Collections.list(reqLocales));
      List<String> mimeTypes = WSRPConstants.getDefaultMimeTypes();
View Full Code Here

      UnsupportedMimeType, UnsupportedWindowState, UnsupportedMode, MissingParameters, ModifyRegistrationRequired, UnsupportedLocale
   {
      Registration registration = producer.getRegistrationOrFailIfInvalid(getRegistrationContext());

      // get session information and deal with it
      final RuntimeContext runtimeContext = getRuntimeContext();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(runtimeContext, "RuntimeContext", getContextName());

      checkForSessionIDs(runtimeContext);

      // get parameters
      final MimeRequest params = getParams();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(params, "MarkupParams", getContextName());

      // get portlet handle
      PortletContext wsrpPC = getPortletContext();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(wsrpPC, "PortletContext", getContextName());
      org.gatein.pc.api.PortletContext portletContext = WSRPUtils.convertToPortalPortletContext(wsrpPC);

      // check locales
      final List<String> desiredLocales = params.getLocales();
      for (String locale : desiredLocales)
      {
         try
         {
            WSRPUtils.getLocale(locale);
         }
         catch (IllegalArgumentException e)
         {
            throw WSRP2ExceptionFactory.throwWSException(UnsupportedLocale.class, e.getLocalizedMessage(), null);
         }
      }

      // retrieve the portlet
      try
      {
         // calls RegistrationLocal.setRegistration so no need to here
         portlet = producer.getPortletWith(portletContext, registration);
      }
      catch (PortletInvokerException e)
      {
         throw WSRP2ExceptionFactory.throwWSException(OperationFailed.class, "Could not retrieve portlet '" + portletContext + "'", e);
      }

      // get portlet description for the desired portlet...
      portletDescription = producer.getPortletDescription(wsrpPC, null, registration);
      if (Boolean.TRUE.equals(portletDescription.isUsesMethodGet()))
      {
         throw WSRP2ExceptionFactory.throwWSException(OperationFailed.class, "Portlets using GET method in forms are not currently supported.", null);
      }

      List<MarkupType> markupTypes = portletDescription.getMarkupTypes();

      // based on the markup parameters and portlet description generate the most appropriate markup request
      markupRequest = createMarkupRequestFrom(markupTypes, params, portlet);

      // prepare information for invocation
      final org.oasis.wsrp.v2.UserContext wsrpUserContext = getUserContext();
      checkUserContext(wsrpUserContext);

      SecurityContext securityContext = createSecurityContext(params, runtimeContext, wsrpUserContext);
      final MediaType mediaType = createMediaType(markupRequest);
      PortalContext portalContext = createPortalContext(params, markupRequest);
      UserContext userContext = createUserContext(wsrpUserContext, markupRequest.getLocale(), desiredLocales);
      String portletInstanceKey = runtimeContext.getPortletInstanceKey();
      instanceContext = createInstanceContext(portletContext, getAccessMode(), portletInstanceKey);
      WindowContext windowContext = createWindowContext(portletContext.getId(), runtimeContext);

      // prepare the invocation
      WSRPPortletInvocationContext context = new WSRPPortletInvocationContext(mediaType, securityContext, portalContext, userContext, instanceContext, windowContext);
View Full Code Here

            log.debug("performRequest: " + retryCount + " attempt(s) out of " + MAXIMUM_RETRY_NUMBER + " possible");
         }
         SessionHandler sessionHandler = consumer.getSessionHandler();

         // prepare everything for the request
         RuntimeContext runtimeContext = getRuntimeContextFrom(request);

         if (runtimeContext != null)
         {
            WindowContext windowContext = invocation.getWindowContext();
            runtimeContext.setNamespacePrefix(WSRPTypeFactory.getNamespaceFrom(windowContext));

            InstanceContext instanceContext = invocation.getInstanceContext();
            runtimeContext.setPortletInstanceKey(instanceContext == null ? null : instanceContext.getId());
         }

         try
         {
            sessionHandler.initCookieIfNeeded(invocation);
View Full Code Here

            log.debug("performRequest: " + retryCount + " attempt(s) out of " + MAXIMUM_RETRY_NUMBER + " possible");
         }
         SessionHandler sessionHandler = consumer.getSessionHandler();

         // prepare everything for the request
         RuntimeContext runtimeContext = getRuntimeContextFrom(request);

         if (runtimeContext != null)
         {
            WindowContext windowContext = invocation.getWindowContext();
            runtimeContext.setNamespacePrefix(WSRPTypeFactory.getNamespaceFrom(windowContext));

            // GTNWSRP-369: InstanceContext doesn't actually provide any useful information, use WindowContext's id instead
            /*InstanceContext instanceContext = invocation.getInstanceContext();
            runtimeContext.setPortletInstanceKey(WSRPTypeFactory.getPortletInstanceKey(instanceContext));*/
            runtimeContext.setPortletInstanceKey(windowContext.getId());
         }

         try
         {
            sessionHandler.initCookieIfNeeded(invocation);
View Full Code Here

   {
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(userAuthentication, "user authentication", "RuntimeContext");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletInstanceKey, "Portlet Instance Key", "RuntimeContext");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(namespacePrefix, "Namespace Prefix", "RuntimeContext");

      RuntimeContext runtimeContext = new RuntimeContext();
      runtimeContext.setUserAuthentication(userAuthentication);
      runtimeContext.setPortletInstanceKey(portletInstanceKey);
      runtimeContext.setNamespacePrefix(namespacePrefix);
      return runtimeContext;
   }
View Full Code Here

            log.debug("performRequest: " + retryCount + " attempt(s) out of " + MAXIMUM_RETRY_NUMBER + " possible");
         }
         SessionHandler sessionHandler = consumer.getSessionHandler();

         // prepare everything for the request
         RuntimeContext runtimeContext = getRuntimeContextFrom(request);

         if (runtimeContext != null)
         {
            WindowContext windowContext = invocation.getWindowContext();
            runtimeContext.setNamespacePrefix(WSRPTypeFactory.getNamespaceFrom(windowContext));

            InstanceContext instanceContext = invocation.getInstanceContext();
            runtimeContext.setPortletInstanceKey(instanceContext == null ? null : instanceContext.getId());
         }

         try
         {
            sessionHandler.initCookieIfNeeded(invocation);
View Full Code Here

         registrationContext = WSRPTypeFactory.createRegistrationContext(registrationHandle);
      }

      String instanceKey = URLTools.decodeXWWWFormURL(req.getParameter(INSTANCE_KEY));
      String ns = req.getParameter(NS);
      RuntimeContext runtimeContext = WSRPTypeFactory.createRuntimeContext(WSRPConstants.NONE_USER_AUTHENTICATION, instanceKey, ns);

      Enumeration reqLocales = req.getLocales();
      List<String> locales = WSRPUtils.convertLocalesToRFC3066LanguageTags(Collections.list(reqLocales));
      List<String> mimeTypes = WSRPConstants.getDefaultMimeTypes();
View Full Code Here

TOP

Related Classes of de.innovationgate.wgpublisher.plugins.WGAPluginSet$RuntimeContext

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.