Package org.oasis.wsrp.v1

Examples of org.oasis.wsrp.v1.PortletContext


               producer.getPortletInvoker().getPortlet(portalPC);

               org.gatein.pc.api.PortletContext exportedPortalPC = producer.getPortletInvoker().exportPortlet(PortletStateType.OPAQUE, portalPC);

               PortletContext exportedPortalContext = WSRPUtils.convertToWSRPPortletContext(exportedPortalPC);
               portletHandle = exportedPortalContext.getPortletHandle();
               portletState = exportedPortalContext.getPortletState();

               if (exportedPortalPC == null)
               {
                  WSRP2ExceptionFactory.throwWSException(InvalidHandle.class, "Could not find a portlet with handle " + portletHandle + " in the producer", null);
               }
View Full Code Here


               }

               String portletHandle = exportPortletData.getPortletHandle();
               byte[] portletState = exportPortletData.getPortletState();

               PortletContext pc = WSRPTypeFactory.createPortletContext(portletHandle, portletState);
               org.gatein.pc.api.PortletContext pcPortletContext = WSRPUtils.convertToPortalPortletContext(pc);

               org.gatein.pc.api.PortletContext cpc = producer.getPortletInvoker().importPortlet(PortletStateType.OPAQUE, pcPortletContext);
               PortletContext wpc = WSRPUtils.convertToWSRPPortletContext(cpc);

               ImportedPortlet importedPortlet = WSRPTypeFactory.createImportedPortlet(importPortlet.getImportID(), wpc);

               importedPortlets.add(importedPortlet);
            }
View Full Code Here

      }

      // deal with implicit cloning and state modification
      if (instanceContext.wasModified())
      {
         PortletContext updatedPortletContext = WSRPUtils.convertToWSRPPortletContext(instanceContext.getPortletContext());
         updateResponse.setPortletContext(updatedPortletContext);
      }
      return updateResponse;
   }
View Full Code Here

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

    * @return
    * @since 2.4.1
    */
   public static GetPortletDescription createGetPortletDescription(RegistrationContext registrationContext, String portletHandle)
   {
      PortletContext portletContext = createPortletContext(portletHandle);
      ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "portlet context");
      GetPortletDescription description = new GetPortletDescription();
      description.setPortletContext(portletContext);
      description.setRegistrationContext(registrationContext);
      return description;
View Full Code Here

   public static GetPortletDescription createGetPortletDescription(RegistrationContext registrationContext,
                                                                   org.gatein.pc.api.PortletContext portletContext)
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "portlet context");

      PortletContext wsrpPC = createPortletContext(portletContext.getId());
      if (portletContext instanceof StatefulPortletContext)
      {
         StatefulPortletContext context = (StatefulPortletContext)portletContext;
         if (PortletStateType.OPAQUE.equals(context.getType()))
         {
            wsrpPC.setPortletState(((StatefulPortletContext<byte[]>)context).getState());
         }
      }

      GetPortletDescription getPortletDescription = new GetPortletDescription();
      getPortletDescription.setRegistrationContext(registrationContext);
View Full Code Here

   public static PortletContext createPortletContext(String portletHandle)
   {
      checkPortletHandle(portletHandle);

      PortletContext portletContext = new PortletContext();
      portletContext.setPortletHandle(portletHandle);
      return portletContext;
   }
View Full Code Here

   }


   public static PortletContext createPortletContext(String portletHandle, byte[] portletState)
   {
      PortletContext pc = createPortletContext(portletHandle);
      pc.setPortletState(portletState);
      return pc;
   }
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

TOP

Related Classes of org.oasis.wsrp.v1.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.