Examples of Registration


Examples of org.gatein.registration.Registration

      try
      {
         Collection registrations = persistenceManager.getRegistrations();
         for (Object registration : registrations)
         {
            Registration reg = (Registration)registration;

            // pending instead of invalid as technically, the registration is not yet invalid
            reg.setStatus(RegistrationStatus.PENDING);

            // make changes persistent
            Consumer consumer = reg.getConsumer();
            try
            {
               persistenceManager.saveChangesTo(consumer);
            }
            catch (RegistrationException e)
View Full Code Here

Examples of org.gatein.registration.Registration

      return serviceDescriptionHandler.getPortletDescription(portletContext, locales, registration);
   }

   public Registration getRegistrationOrFailIfInvalid(RegistrationContext registrationContext) throws InvalidRegistration, OperationFailed, ModifyRegistrationRequired
   {
      Registration registration = registrationHandler.getRegistrationFrom(registrationContext);
      registrationHandler.isRegistrationValid(registration, true);

      return registration;
   }
View Full Code Here

Examples of org.gatein.registration.Registration

   {
      // the context name for error messages
      final String contextName = request.getClass().getSimpleName();

      // retrieve the registration associated with the request or fail
      Registration registration = producer.getRegistrationOrFailIfInvalid(getRegistrationContext());

      // get session information and deal with it
      final RuntimeContext runtimeContext = getRuntimeContext();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(runtimeContext, "RuntimeContext", contextName);
      checkForSessionIDs(runtimeContext);
View Full Code Here

Examples of org.gatein.registration.Registration

         // add contextual information to help URL generation
         WSRPPortletURL.URLContext context = new WSRPPortletURL.URLContext(WSRPPortletURL.URLContext.SERVER_ADDRESS,
            URLTools.getServerAddressFrom(request), WSRPPortletURL.URLContext.PORTLET_CONTEXT, instanceContext.getPortletContext());

         Registration registration = RegistrationLocal.getRegistration();
         if (registration != null)
         {
            context.setValueFor(WSRPPortletURL.URLContext.REGISTRATION_HANDLE, registration.getRegistrationHandle());
         }
         context.setValueFor(WSRPPortletURL.URLContext.INSTANCE_KEY, WSRPTypeFactory.getPortletInstanceKey(instanceContext));
         context.setValueFor(WSRPPortletURL.URLContext.NAMESPACE, WSRPTypeFactory.getNamespacePrefix(windowContext, instanceContext.getPortletContext().getId()));
         context.setValueFor(WSRPPortletURL.URLContext.ESCAPE_XML, urlFormat.getWantEscapeXML());
View Full Code Here

Examples of org.gatein.registration.Registration

      try
      {
         log.debug(invocationType + " on portlet '" + handle + "'");

         // check the registration and make it available to other parts of the code via RegistrationLocal
         Registration registration = producer.getRegistrationOrFailIfInvalid(requestProcessor.getRegistrationContext());
         RegistrationLocal.setRegistration(registration);

         // get the portlet container invocation from the RequestProcessor
         final PortletInvocation invocation = requestProcessor.getInvocation();
View Full Code Here

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

Examples of org.gatein.registration.Registration

   }

   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

Examples of org.gatein.registration.Registration

      return portlets;
   }

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

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

Examples of org.gatein.registration.Registration

   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

Examples of org.gatein.registration.Registration

      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
TOP
Copyright © 2018 www.massapi.com. 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.