Package org.oasis.wsrp.v2

Examples of org.oasis.wsrp.v2.PortletContext


      throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
   {
      SetPortletProperties setPortletProperties = WSRPTypeFactory.createSetPortletProperties(registrationContext, portletContext, propertyList);
      setPortletProperties.setUserContext(userContext);

      PortletContext response = producer.setPortletProperties(setPortletProperties);

      portletHandle.value = response.getPortletHandle();
      portletState.value = response.getPortletState();
      extensions.value = response.getExtensions();
   }
View Full Code Here


            V1ToV2Converter.toV2RegistrationContext(registrationContext),
            V1ToV2Converter.toV2PortletContext(portletContext),
            V1ToV2Converter.toV2PropertyList(propertyList));
         setPortletProperties.setUserContext(V1ToV2Converter.toV2UserContext(userContext));

         PortletContext response = producer.setPortletProperties(setPortletProperties);
         portletHandle.value = response.getPortletHandle();
         portletState.value = response.getPortletState();
         extensions.value = WSRPUtils.transform(response.getExtensions(), V2ToV1Converter.EXTENSION);
      }
      catch (AccessDenied accessDenied)
      {
         throw V2ToV1Converter.toV1Exception(V1AccessDenied.class, accessDenied);
      }
View Full Code Here

            V1ToV2Converter.toV2RegistrationContext(registrationContext),
            V1ToV2Converter.toV2PortletContext(portletContext),
            V1ToV2Converter.toV2UserContext(userContext)
         );

         PortletContext response = producer.clonePortlet(clonePortlet);
         portletHandle.value = response.getPortletHandle();
         portletState.value = response.getPortletState();
         extensions.value = WSRPUtils.transform(response.getExtensions(), V2ToV1Converter.EXTENSION);
      }
      catch (AccessDenied accessDenied)
      {
         throw V2ToV1Converter.toV1Exception(V1AccessDenied.class, accessDenied);
      }
View Full Code Here

   @Override
   protected HandleEvents prepareRequest(RequestPrecursor<EventInvocation> requestPrecursor, EventInvocation invocation)
   {

      PortletContext portletContext = requestPrecursor.getPortletContext();
      if (InvocationHandler.debug)
      {
         InvocationHandler.log.debug("Consumer about to attempt action on portlet '" + portletContext.getPortletHandle() + "'");
      }

      // access mode
      InstanceContext instanceContext = invocation.getInstanceContext();
      ParameterValidation.throwIllegalArgExceptionIfNull(instanceContext, "instance context");
View Full Code Here

      if (resourceId == null || !consumer.isUsingWSRP2())
      {
         resourceId = (String)invocation.getAttribute(WSRPRewritingConstants.RESOURCE_URL);
      }

      PortletContext portletContext = requestPrecursor.getPortletContext();

      // since we actually extracted the data into MarkupParams in the RequestPrecursor, use that! :)
      MarkupParams params = requestPrecursor.getMarkupParams();

      // access mode
View Full Code Here

   }

   protected GetMarkup prepareRequest(RequestPrecursor<RenderInvocation> requestPrecursor, RenderInvocation invocation)
   {
      // Create the markup request
      PortletContext portletContext = requestPrecursor.getPortletContext();
      if (debug)
      {
         log.debug("Consumer about to attempt rendering portlet '" + portletContext.getPortletHandle() + "'");
      }
      return WSRPTypeFactory.createGetMarkup(requestPrecursor.getRegistrationContext(), portletContext,
         requestPrecursor.getRuntimeContext(), requestPrecursor.getUserContext(), requestPrecursor.getMarkupParams());
   }
View Full Code Here

      // extensions
      processExtensions(wsrpResponse);

      // check if the portlet was cloned
      PortletContext portletContext = updateResponse.getPortletContext();
      SessionHandler sessionHandler = consumer.getSessionHandler();
      if (portletContext != null)
      {
         PortletContext originalContext = requestPrecursor.getPortletContext();
         InstanceContext context = invocation.getInstanceContext();

         String handle = portletContext.getPortletHandle();
         if (!originalContext.getPortletHandle().equals(handle))
         {
            if (debug)
            {
               log.debug("Portlet '" + requestPrecursor.getPortletHandle() + "' was implicitely cloned. New handle is '"
                  + handle + "'");
            }

            StateEvent event = new StateEvent(WSRPUtils.convertToPortalPortletContext(portletContext), StateEvent.Type.PORTLET_CLONED_EVENT);
            context.onStateEvent(event);
         }
         else
         {
            // check if the state was modified
            byte[] originalState = originalContext.getPortletState();
            byte[] newState = portletContext.getPortletState();
            if (!Arrays.equals(originalState, newState))
            {
               StateEvent event = new StateEvent(WSRPUtils.convertToPortalPortletContext(portletContext), StateEvent.Type.PORTLET_MODIFIED_EVENT);
               context.onStateEvent(event);
            }
         }

         // update the session information associated with the portlet handle
         sessionHandler.updateSessionInfoFor(originalContext.getPortletHandle(), handle, invocation);
      }
      else
      {
         portletContext = requestPrecursor.getPortletContext();
      }
View Full Code Here

         throw new IllegalArgumentException("ActionHandler can only handle ActionInvocations!");
      }

      ActionInvocation actionInvocation = invocation;

      PortletContext portletContext = requestPrecursor.getPortletContext();
      if (debug)
      {
         log.debug("Consumer about to attempt action on portlet '" + portletContext.getPortletHandle() + "'");
      }

      // access mode
      InstanceContext instanceContext = invocation.getInstanceContext();
      ParameterValidation.throwIllegalArgExceptionIfNull(instanceContext, "instance context");
View Full Code Here

   {
      String path = req.getPathInfo();

      int portletHandleEnd = path.indexOf(URLTools.SLASH, 1);
      String portletHandle = path.substring(1, portletHandleEnd);
      PortletContext portletContext = decode(portletHandle);

      String resourceId = path.substring(portletHandleEnd);

      String registrationHandle = req.getParameter(REG_HANDLE);
      RegistrationContext registrationContext = null;
View Full Code Here

   public static PortletContext toV2PortletContext(V1PortletContext v1PortletContext)
   {
      if (v1PortletContext != null)
      {
         PortletContext portletContext = WSRPTypeFactory.createPortletContext(v1PortletContext.getPortletHandle(), v1PortletContext.getPortletState());

         List<V1Extension> extensions = v1PortletContext.getExtensions();
         if (extensions != null)
         {
            portletContext.getExtensions().addAll(WSRPUtils.transform(extensions, EXTENSION));
         }

         return portletContext;
      }
      else
View Full Code Here

TOP

Related Classes of org.oasis.wsrp.v2.PortletContext

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.