Package org.gatein.registration

Examples of org.gatein.registration.Registration


         return true;
      }
      else
      {
         // otherwise, check the current registration
         Registration registration = RegistrationLocal.getRegistration();
         if (registration != null)
         {
            if (registration.knows(portletContext))
            {
               return true;
            }
            else
            {
               String id = portletContext.getId();
               throw new NoSuchPortletException("Registration '" + registration.getRegistrationHandle() + "' does not know the '" + id + "' portlet", id);
            }
         }
         else
         {
            // if we don't have a registration, decide based on status
View Full Code Here


   }

   public Set<Portlet> getPortlets() throws PortletInvokerException
   {
      Set<Portlet> portlets = new HashSet<Portlet>(super.getPortlets());
      Registration registration = RegistrationLocal.getRegistration();

      if (registration != null)
      {
         // add all the portlets that the current Registration knows about to the set of offered portlets
         Set<PortletContext> contexts = registration.getKnownPortletContexts();
         for (PortletContext context : contexts)
         {
            try
            {
               portlets.add(super.getPortlet(context));
            }
            catch (NoSuchPortletException e)
            {
               final RegistrationSPI registrationSPI = getRegistrationAsSPI();
               try
               {
                  registrationSPI.removePortletContext(context);
                  log.debug("Removed '" + context + "' from Registration '" + registration.getRegistrationHandle() + "' because it cannot be resolved anymore.");
               }
               catch (RegistrationException e1)
               {
                  throw new PortletInvokerException(e1);
               }
View Full Code Here

      return portlets;
   }

   private RegistrationSPI getRegistrationAsSPI() throws PortletInvokerException
   {
      Registration registration = RegistrationLocal.getRegistration();

      if (registration == null)
      {
         return null;
      }
View Full Code Here

   public PortletDescriptionResponse getPortletDescription(GetPortletDescription getPortletDescription)
      throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
      MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
   {
      WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(getPortletDescription, GET_PORTLET_DESCRIPTION);
      Registration registration = producer.getRegistrationOrFailIfInvalid(getPortletDescription.getRegistrationContext());

      PortletContext portletContext = getPortletDescription.getPortletContext();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(portletContext, PORTLET_CONTEXT, GET_PORTLET_DESCRIPTION);

      UserContext userContext = getPortletDescription.getUserContext();
View Full Code Here

      PortletContext portletContext = getPortletPropertyDescription.getPortletContext();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(portletContext, PORTLET_CONTEXT, GET_PORTLET_PROPERTY_DESCRIPTION);

      try
      {
         Registration registration = producer.getRegistrationOrFailIfInvalid(getPortletPropertyDescription.getRegistrationContext());
         RegistrationLocal.setRegistration(registration);

         UserContext userContext = getPortletPropertyDescription.getUserContext();
         checkUserAuthorization(userContext);
View Full Code Here

      WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(clonePortlet, "ClonePortlet");

      PortletContext portletContext = clonePortlet.getPortletContext();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(portletContext, "PortletContext", "ClonePortlet");

      Registration registration = producer.getRegistrationOrFailIfInvalid(clonePortlet.getRegistrationContext());

      UserContext userContext = clonePortlet.getUserContext();
      checkUserAuthorization(userContext);

      org.gatein.pc.api.PortletContext portalPC = WSRPUtils.convertToPortalPortletContext(portletContext);
View Full Code Here

      List<String> handles = destroyPortlets.getPortletHandles();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(handles, "portlet handles to be destroyed", "DestroyPortlets");
      handles = WSRPUtils.replaceByEmptyListIfNeeded(handles);

      Registration registration = producer.getRegistrationOrFailIfInvalid(destroyPortlets.getRegistrationContext());

      List<org.gatein.pc.api.PortletContext> portletContexts = new ArrayList<org.gatein.pc.api.PortletContext>(handles.size());
      for (String handle : handles)
      {
         portletContexts.add(org.gatein.pc.api.PortletContext.createPortletContext(handle));
View Full Code Here

      if (!ParameterValidation.existsAndIsNotEmpty(portletContexts) || WSRPUtils.isSingletonListWithNullOrEmptyElement(portletContexts))
      {
         throw WSRP2ExceptionFactory.createWSException(MissingParameters.class, "Missing required portletContext in CopyPortlets.", null);
      }

      Registration fromRegistration = producer.getRegistrationOrFailIfInvalid(copyPortlets.getFromRegistrationContext());

      RegistrationContext toRegistationContext = copyPortlets.getToRegistrationContext();

      //if toRegistrationContext is null, then we use the fromRegistrationContext (from spec).
      //NOTE: this means we can't move between a PortletContext on a registered consumer to a non-registered consumer
      // between two non-registered consumers will still be ok.
      if (toRegistationContext == null)
      {
         toRegistationContext = copyPortlets.getFromRegistrationContext();
      }

      Registration toRegistration = producer.getRegistrationOrFailIfInvalid(toRegistationContext);

      UserContext fromUserContext = copyPortlets.getFromUserContext();
      checkUserAuthorization(fromUserContext);
      UserContext toUserContext = copyPortlets.getToUserContext();
      checkUserAuthorization(toUserContext);
View Full Code Here

      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(portletContext, "PortletContext", "SetPortletProperties");

      PropertyList propertyList = setPortletProperties.getPropertyList();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(propertyList, "PropertyList", "SetPortletProperties");

      Registration registration = producer.getRegistrationOrFailIfInvalid(setPortletProperties.getRegistrationContext());

      checkUserAuthorization(setPortletProperties.getUserContext());

      List<Property> properties = propertyList.getProperties();
      properties = WSRPUtils.replaceByEmptyListIfNeeded(properties);
View Full Code Here

      WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(getPortletProperties, GET_PORTLET_PROPERTIES);

      PortletContext portletContext = getPortletProperties.getPortletContext();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(portletContext, PORTLET_CONTEXT, GET_PORTLET_PROPERTIES);

      Registration registration = producer.getRegistrationOrFailIfInvalid(getPortletProperties.getRegistrationContext());

      UserContext userContext = getPortletProperties.getUserContext();
      checkUserAuthorization(userContext);

      List<String> names = getPortletProperties.getNames();
View Full Code Here

TOP

Related Classes of org.gatein.registration.Registration

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.