Package org.oasis.wsrp.v1

Examples of org.oasis.wsrp.v1.ServiceDescription


   {
      GetServiceDescription getServiceDescription = WSRPTypeFactory.createGetServiceDescription(registrationContext, userContext);
      getServiceDescription.getDesiredLocales().addAll(desiredLocales);
      getServiceDescription.getPortletHandles().addAll(portletHandles);

      ServiceDescription description = producer.getServiceDescription(getServiceDescription);

      requiresRegistration.value = description.isRequiresRegistration();
      offeredPortlets.value = description.getOfferedPortlets();
      userCategoryDescriptions.value = description.getUserCategoryDescriptions();
      extensionDescriptions.value = description.getExtensionDescriptions();
      customWindowStateDescriptions.value = description.getCustomWindowStateDescriptions();
      customModeDescriptions.value = description.getCustomModeDescriptions();
      requiresInitCookie.value = description.getRequiresInitCookie();
      registrationPropertyDescription.value = description.getRegistrationPropertyDescription();
      locales.value = description.getLocales();
      resourceList.value = description.getResourceList();
      eventDescriptions.value = description.getEventDescriptions();
      schemaType.value = description.getSchemaType();
      supportedOptions.value = description.getSupportedOptions();
      exportDescription.value = description.getExportDescription();
      mayReturnRegistrationState.value = description.isMayReturnRegistrationState();
      extensions.value = description.getExtensions();
   }
View Full Code Here


   {
      GetServiceDescription getServiceDescription = WSRPTypeFactory.createGetServiceDescription(
         V1ToV2Converter.toV2RegistrationContext(registrationContext), null);
      getServiceDescription.getDesiredLocales().addAll(desiredLocales);

      ServiceDescription description;
      try
      {
         description = producer.getServiceDescription(getServiceDescription);
      }
      catch (InvalidRegistration invalidRegistration)
      {
         throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
      }
      catch (OperationFailed operationFailed)
      {
         throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
      }
      catch (ModifyRegistrationRequired modifyRegistrationRequired)
      {
         throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
      }
      catch (ResourceSuspended resourceSuspended)
      {
         throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
      }

      requiresRegistration.value = description.isRequiresRegistration();
      offeredPortlets.value = WSRPUtils.transform(description.getOfferedPortlets(), V2ToV1Converter.PORTLETDESCRIPTION);
      userCategoryDescriptions.value = WSRPUtils.transform(description.getUserCategoryDescriptions(), V2ToV1Converter.ITEMDESCRIPTION);
//      customUserProfileItemDescriptions.value = description.getCustomUserProfileItemDescriptions();
      customWindowStateDescriptions.value = WSRPUtils.transform(description.getCustomWindowStateDescriptions(), V2ToV1Converter.ITEMDESCRIPTION);
      customModeDescriptions.value = WSRPUtils.transform(description.getCustomModeDescriptions(), V2ToV1Converter.ITEMDESCRIPTION);
      requiresInitCookie.value = V2ToV1Converter.toV1CookieProtocol(description.getRequiresInitCookie());
      registrationPropertyDescription.value = V2ToV1Converter.toV1ModelDescription(description.getRegistrationPropertyDescription());
      locales.value = description.getLocales();
      resourceList.value = V2ToV1Converter.toV1ResourceList(description.getResourceList());
      extensions.value = WSRPUtils.transform(description.getExtensions(), V2ToV1Converter.EXTENSION);
   }
View Full Code Here

   {
      GetServiceDescription getServiceDescription = WSRPTypeFactory.createGetServiceDescription(
         V1ToV2Converter.toV2RegistrationContext(registrationContext), null);
      getServiceDescription.getDesiredLocales().addAll(desiredLocales);

      ServiceDescription description;
      try
      {
         description = producer.getServiceDescription(getServiceDescription);
      }
      catch (InvalidRegistration invalidRegistration)
      {
         throw V2ToV1Converter.toV1Exception(V1InvalidRegistration.class, invalidRegistration);
      }
      catch (OperationFailed operationFailed)
      {
         throw V2ToV1Converter.toV1Exception(V1OperationFailed.class, operationFailed);
      }
      catch (ModifyRegistrationRequired modifyRegistrationRequired)
      {
         throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Need to call modifyRegistration", modifyRegistrationRequired);
      }
      catch (ResourceSuspended resourceSuspended)
      {
         throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Resource suspended", resourceSuspended);
      }

      requiresRegistration.value = description.isRequiresRegistration();
      offeredPortlets.value = WSRPUtils.transform(description.getOfferedPortlets(), V2ToV1Converter.PORTLETDESCRIPTION);
      userCategoryDescriptions.value = WSRPUtils.transform(description.getUserCategoryDescriptions(), V2ToV1Converter.ITEMDESCRIPTION);
//      customUserProfileItemDescriptions.value = description.getCustomUserProfileItemDescriptions();
      customWindowStateDescriptions.value = WSRPUtils.transform(description.getCustomWindowStateDescriptions(), V2ToV1Converter.ITEMDESCRIPTION);
      customModeDescriptions.value = WSRPUtils.transform(description.getCustomModeDescriptions(), V2ToV1Converter.ITEMDESCRIPTION);
      requiresInitCookie.value = V2ToV1Converter.toV1CookieProtocol(description.getRequiresInitCookie());
      registrationPropertyDescription.value = V2ToV1Converter.toV1ModelDescription(description.getRegistrationPropertyDescription());
      locales.value = description.getLocales();
      resourceList.value = V2ToV1Converter.toV1ResourceList(description.getResourceList());
      extensions.value = WSRPUtils.transform(description.getExtensions(), V2ToV1Converter.EXTENSION);
   }
View Full Code Here

   {
      GetServiceDescription getServiceDescription = WSRPTypeFactory.createGetServiceDescription(registrationContext, userContext);
      getServiceDescription.getDesiredLocales().addAll(desiredLocales);
      getServiceDescription.getPortletHandles().addAll(portletHandles);

      ServiceDescription description = producer.getServiceDescription(getServiceDescription);

      requiresRegistration.value = description.isRequiresRegistration();
      offeredPortlets.value = description.getOfferedPortlets();
      userCategoryDescriptions.value = description.getUserCategoryDescriptions();
//      customUserProfileItemDescriptions.value = description.getCustomUserProfileItemDescriptions();
      customWindowStateDescriptions.value = description.getCustomWindowStateDescriptions();
      customModeDescriptions.value = description.getCustomModeDescriptions();
      requiresInitCookie.value = description.getRequiresInitCookie();
      registrationPropertyDescription.value = description.getRegistrationPropertyDescription();
      locales.value = description.getLocales();
      resourceList.value = description.getResourceList();
      extensions.value = description.getExtensions();
   }
View Full Code Here

      return initCookie;
   }

   public static ServiceDescription createServiceDescription(boolean requiresRegistration)
   {
      ServiceDescription serviceDescription = new ServiceDescription();
      serviceDescription.setRequiresRegistration(requiresRegistration);
      return serviceDescription;
   }
View Full Code Here

      return result;
   }

   private RefreshResult internalRefresh(boolean forceRefresh) throws PortletInvokerException
   {
      ServiceDescription serviceDescription;

      if (isModifyRegistrationRequired())
      {
         return new RefreshResult(RefreshResult.Status.MODIFY_REGISTRATION_REQUIRED);
      }
View Full Code Here

      return new RefreshResult(RefreshResult.Status.BYPASSED);
   }

   private RefreshResult handleModifyRegistrationNeeded(RefreshResult result) throws PortletInvokerException
   {
      ServiceDescription serviceDescription;
      serviceDescription = getServiceDescription(true); // attempt to get unregistered service description
      result.setServiceDescription(serviceDescription);

      // re-validate the registration information
      RefreshResult registrationResult = internalRefreshRegistration(serviceDescription, false, true, true);
View Full Code Here

   }

   private ServiceDescription getUnmanagedServiceDescription(boolean asUnregistered) throws PortletInvokerException, OperationFailed, InvalidRegistration, ModifyRegistrationRequired
   {
      //todo: might need to implement customization of default service description
      ServiceDescription serviceDescription;
      try
      {
         Holder<Boolean> requiresRegistration = new Holder<Boolean>();
         Holder<List<PortletDescription>> offeredPortlets = new Holder<List<PortletDescription>>();
         Holder<List<ItemDescription>> userCategoryDescriptions = new Holder<List<ItemDescription>>();
         Holder<List<ItemDescription>> windowStateDescriptions = new Holder<List<ItemDescription>>();
         Holder<List<ItemDescription>> modeDescriptions = new Holder<List<ItemDescription>>();
         Holder<CookieProtocol> requiresInitCookie = new Holder<CookieProtocol>();
         Holder<ModelDescription> registrationPropertyDescription = new Holder<ModelDescription>();
         Holder<List<String>> locales = new Holder<List<String>>();
         Holder<ResourceList> resourceList = new Holder<ResourceList>();
         Holder<List<EventDescription>> eventDescriptions = new Holder<List<EventDescription>>();
         Holder<ModelTypes> schemaTypes = new Holder<ModelTypes>();
         Holder<List<String>> supportedOptions = new Holder<List<String>>();
         Holder<ExportDescription> exportDescription = new Holder<ExportDescription>();
         Holder<Boolean> mayReturnRegistrationState = new Holder<Boolean>();
         final Holder<List<ExtensionDescription>> extensionDescriptions = new Holder<List<ExtensionDescription>>();
         final Holder<List<Extension>> extensions = new Holder<List<Extension>>();

         // invocation
         persistentEndpointInfo.getServiceDescriptionService().getServiceDescription(
            asUnregistered ? null : getRegistrationContext(),
            WSRPConstants.getDefaultLocales(), // todo: deal with locales better
            null, // todo: provide a way to only request info on some portlets?
            UserAccess.getUserContext(),
            requiresRegistration,
            offeredPortlets,
            userCategoryDescriptions,
            extensionDescriptions,
            windowStateDescriptions,
            modeDescriptions,
            requiresInitCookie,
            registrationPropertyDescription,
            locales,
            resourceList,
            eventDescriptions,
            schemaTypes,
            supportedOptions,
            exportDescription,
            mayReturnRegistrationState,
            extensions);

         // TODO: fix-me
         serviceDescription = WSRPTypeFactory.createServiceDescription(requiresRegistration.value);
         serviceDescription.setRegistrationPropertyDescription(registrationPropertyDescription.value);
         serviceDescription.setRequiresInitCookie(requiresInitCookie.value);
         serviceDescription.setResourceList(resourceList.value);
         serviceDescription.setSchemaType(schemaTypes.value);
         serviceDescription.setExportDescription(exportDescription.value);
         serviceDescription.setMayReturnRegistrationState(mayReturnRegistrationState.value);

         if (ParameterValidation.existsAndIsNotEmpty(modeDescriptions.value))
         {
            serviceDescription.getCustomModeDescriptions().addAll(modeDescriptions.value);
         }
         if (ParameterValidation.existsAndIsNotEmpty(windowStateDescriptions.value))
         {
            serviceDescription.getCustomWindowStateDescriptions().addAll(windowStateDescriptions.value);
         }
         if (ParameterValidation.existsAndIsNotEmpty(locales.value))
         {
            serviceDescription.getLocales().addAll(locales.value);
         }
         if (ParameterValidation.existsAndIsNotEmpty(offeredPortlets.value))
         {
            serviceDescription.getOfferedPortlets().addAll(offeredPortlets.value);
         }
         if (ParameterValidation.existsAndIsNotEmpty(userCategoryDescriptions.value))
         {
            serviceDescription.getUserCategoryDescriptions().addAll(userCategoryDescriptions.value);
         }
         if (ParameterValidation.existsAndIsNotEmpty(eventDescriptions.value))
         {
            serviceDescription.getEventDescriptions().addAll(eventDescriptions.value);
         }
         if (ParameterValidation.existsAndIsNotEmpty(extensionDescriptions.value))
         {
            serviceDescription.getExtensionDescriptions().addAll(extensionDescriptions.value);
         }
         if (ParameterValidation.existsAndIsNotEmpty(extensions.value))
         {
            serviceDescription.getExtensions().addAll(extensions.value);
         }
         if (ParameterValidation.existsAndIsNotEmpty(supportedOptions.value))
         {
            serviceDescription.getSupportedOptions().addAll(supportedOptions.value);
         }

         return serviceDescription;
      }
      catch (Exception e)
View Full Code Here

      {
         initIfNeeded();

         ModelDescription registrationProperties = needsRegistrationProperties ? this.registrationProperties : null;

         ServiceDescription serviceDescription = WSRPTypeFactory.createServiceDescription(false);
         serviceDescription.setRequiresInitCookie(BEA_8_CONSUMER_FIX);
         List<String> supportedLocales = producer.getSupportedLocales();
         serviceDescription.getLocales().addAll(supportedLocales);
         serviceDescription.getSupportedOptions().addAll(OPTIONS);
         serviceDescription.setRegistrationPropertyDescription(registrationProperties);
         serviceDescription.setRequiresRegistration(requireRegistrations);

         Collection<PortletDescription> portlets;
         if (needsPortletDescriptions)
         {
            // if we have a list of portlet handles, filter the list of offered portlets
            if (!ParameterValidation.existsAndIsNotEmpty(portletHandles))
            {
               portletHandles = new ArrayList<String>(portletDescriptions.keySet());
            }

            portlets = new ArrayList<PortletDescription>(portletHandles.size());
            for (String handle : portletHandles)
            {
               PortletDescription description = getPortletDescription(handle, desiredLocales);
               if (description != null)
               {
                  portlets.add(description);
               }
            }
            serviceDescription.getOfferedPortlets().addAll(portlets);
         }

         // events
         Collection<EventDescription> events = eventDescriptions.values();
         serviceDescription.getEventDescriptions().addAll(events);

         return serviceDescription;
      }
View Full Code Here

      return result;
   }

   private RefreshResult internalRefresh(boolean forceRefresh) throws PortletInvokerException
   {
      ServiceDescription serviceDescription;

      if (isModifyRegistrationRequired())
      {
         return new RefreshResult(RefreshResult.Status.MODIFY_REGISTRATION_REQUIRED);
      }
View Full Code Here

TOP

Related Classes of org.oasis.wsrp.v1.ServiceDescription

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.