Package org.oasis.wsrp.v1

Examples of org.oasis.wsrp.v1.V1ModelDescription


      if (portletHandles.isEmpty())
      {
         throw new IllegalArgumentException("Cannot create a DestroyPortlets with an empty list of portlet handles!");
      }

      V1DestroyPortlets destroyPortlets = new V1DestroyPortlets();
      destroyPortlets.setRegistrationContext(registrationContext);
      if (ParameterValidation.existsAndIsNotEmpty(portletHandles))
      {
         destroyPortlets.getPortletHandles().addAll(portletHandles);
      }
      return destroyPortlets;
   }
View Full Code Here


   {
      if (destroyPortletResponse != null)
      {

         List<V1DestroyFailed> destroyedFailed = WSRPUtils.transform(destroyPortletResponse.getFailedPortlets(), FAILEDPORTLET);
         V1DestroyPortletsResponse result = WSRP1TypeFactory.createDestroyPortletsResponse(destroyedFailed);

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

         return result;
      }
      else
View Full Code Here

   public static V1EmployerInfo toV1EmployerInfo(EmployerInfo employerInfo)
   {
      if (employerInfo != null)
      {
         V1EmployerInfo v1EmployerInfo = new V1EmployerInfo();
         v1EmployerInfo.setDepartment(employerInfo.getDepartment());
         v1EmployerInfo.setEmployer(employerInfo.getEmployer());
         v1EmployerInfo.setJobtitle(employerInfo.getJobtitle());

         List<Extension> extensions = employerInfo.getExtensions();
         if (extensions != null)
         {
            v1EmployerInfo.getExtensions().addAll(WSRPUtils.transform(extensions, EXTENSION));
         }

         return v1EmployerInfo;
      }
      else
View Full Code Here

   {
      public V1Extension apply(Extension from)
      {
         if (from != null)
         {
            V1Extension extension = new V1Extension();
            extension.setAny(from.getAny());
            return extension;
         }
         else
         {
            return null;
View Full Code Here

   public static V1InteractionParams toV1InteractionParams(InteractionParams interactionParams)
   {
      if (interactionParams != null)
      {
         V1InteractionParams v1InteractionParams = WSRP1TypeFactory.createInteractionParams(toV1StateChange(interactionParams.getPortletStateChange()));
         v1InteractionParams.setInteractionState(interactionParams.getInteractionState());

         List<Extension> extensions = interactionParams.getExtensions();
         if (extensions != null)
         {
            v1InteractionParams.getExtensions().addAll(Lists.transform(extensions, EXTENSION));
         }

         List<NamedString> formParameters = interactionParams.getFormParameters();
         if (formParameters != null)
         {
            v1InteractionParams.getFormParameters().addAll(Lists.transform(formParameters, NAMEDSTRING));
         }

         List<UploadContext> uploadContext = interactionParams.getUploadContexts();
         if (uploadContext != null)
         {
            v1InteractionParams.getUploadContexts().addAll(Lists.transform(uploadContext, UPLOADCONTEXT));
         }

         return v1InteractionParams;
      }
      else
View Full Code Here

      public V1ItemDescription apply(ItemDescription from)
      {
         if (from != null)
         {
            V1ItemDescription result = new V1ItemDescription();
            result.setItemName(from.getItemName());
            if (from.getDescription() != null)
            {
               result.setDescription(LOCALIZEDSTRING.apply(from.getDescription()));
            }
            else if (from.getDisplayName() != null)
            {
               result.setDescription(LOCALIZEDSTRING.apply(from.getDisplayName()));
            }
            else
            {
               result.setDescription(WSRP1TypeFactory.createLocalizedString("No Description Available"));
            }
            List<V1Extension> extensions = WSRPUtils.transform(from.getExtensions(), EXTENSION);
            if (extensions != null)
            {
               result.getExtensions().addAll(extensions);
            }
            return result;
         }
         else
         {
View Full Code Here

         List<V1DestroyFailed> result = new ArrayList<V1DestroyFailed>(failedPortletsList.size());

         for (FailedPortlets failedPortlets : failedPortletsList)
         {
            QName errorCode = failedPortlets.getErrorCode();
            V1LocalizedString reason = toV1LocalizedString(failedPortlets.getReason());
           
            String v1Reason;
            //failedPortlets.getReason is optional in V2, but errorCode is required.
            //for V2DestroyFailed the reason is required
            if (reason != null && reason.getValue() != null)
            {
               v1Reason = errorCode.toString() + ": " + reason.getValue();
            }
            else
            {
               v1Reason = errorCode.toString();
            }
View Full Code Here

   public static V1MarkupContext toV1MarkupContext(MarkupContext markupContext)
   {
      if (markupContext != null)
      {        
         V1MarkupContext v1MarkupContext = WSRP1TypeFactory.createMarkupContext(markupContext.getMimeType(), markupContext.getItemString(), markupContext.getItemBinary(), markupContext.isUseCachedItem());
         v1MarkupContext.setCacheControl(toV1CacheControl(markupContext.getCacheControl()));
         v1MarkupContext.setLocale(markupContext.getLocale());
         v1MarkupContext.setPreferredTitle(markupContext.getPreferredTitle());
         v1MarkupContext.setRequiresUrlRewriting(markupContext.isRequiresRewriting());

         List<Extension> extensions = markupContext.getExtensions();
         if (extensions != null)
         {
            v1MarkupContext.getExtensions().addAll(WSRPUtils.transform(extensions, EXTENSION));
         }

         return v1MarkupContext;
      }
      else
View Full Code Here

   public static V1MarkupParams toV1MarkupParams(MarkupParams markupParams)
   {
      if (markupParams != null)
      {
         V1MarkupParams v1MarkupParams = WSRP1TypeFactory.createMarkupParams(markupParams.isSecureClientCommunication(), markupParams.getLocales(),
            markupParams.getMimeTypes(), markupParams.getMode(), markupParams.getWindowState());

         v1MarkupParams.setClientData(toV1ClientData(markupParams.getClientData()));
         NavigationalContext navigationalContext = markupParams.getNavigationalContext();
         if (navigationalContext != null)
         {
            v1MarkupParams.setNavigationalState(navigationalContext.getOpaqueValue());
         }
         v1MarkupParams.setValidateTag(markupParams.getValidateTag());

         List<String> charSets = markupParams.getMarkupCharacterSets();
         if (charSets != null)
         {
            v1MarkupParams.getMarkupCharacterSets().addAll(charSets);
         }

         List<String> validNewModes = markupParams.getValidNewModes();
         if (validNewModes != null)
         {
            v1MarkupParams.getValidNewModes().addAll(validNewModes);
         }

         List<String> validNewWindowStates = markupParams.getValidNewWindowStates();
         if (validNewWindowStates != null)
         {
            v1MarkupParams.getValidNewWindowStates().addAll(validNewWindowStates);
         }

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

         return v1MarkupParams;
      }
      else
View Full Code Here

   public static V1MarkupResponse toV1MarkupResponse(MarkupResponse markupResponse)
   {
      if (markupResponse != null)
      {
         V1MarkupResponse result = WSRP1TypeFactory.createMarkupResponse(toV1MarkupContext(markupResponse.getMarkupContext()));
         result.setSessionContext(toV1SessionContext(markupResponse.getSessionContext()));

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

         return result;
      }
      else
View Full Code Here

TOP

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

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.