Package org.oasis.wsrp.v2

Examples of org.oasis.wsrp.v2.ResourceValue


               }
            }
         }

         //TODO: handle resourceLists better (should be using for things like errors)
         ResourceList resourceList = null;

         byte[] exportContextBytes = exportManager.encodeExportContextData(exportContext);

         Lifetime lifetime = null;
View Full Code Here


                  failedPortlets.getImportID().add(importPortlet.getImportID());
               }
            }
         }

         ResourceList resourceList = null; //TODO: figure out what exactly should be stored in the resource list here

         return WSRPTypeFactory.createImportPortletsResponse(importedPortlets, new ArrayList<ImportPortletsFailed>(failedPortletsMap.values()), resourceList);
      }
      finally
      {
View Full Code Here

   protected PortletInvocation internalInitInvocation(WSRPPortletInvocationContext context)
   {
      ResourceInvocation resourceInvocation = new ResourceInvocation(context);

      ResourceParams resourceParams = this.request.getResourceParams();

      // only set the resource id if it's different from the place holder we use if the portlet doesn't set one
      String id = this.request.getResourceParams().getResourceID();
      if (!WSRPResourceURL.DEFAULT_RESOURCE_ID.equals(id))
      {
         resourceInvocation.setResourceId(id);
      }

      WSRPRequestContext requestContext = WSRPRequestContext.createRequestContext(markupRequest, resourceParams);
      resourceInvocation.setRequestContext(requestContext);
      resourceInvocation.setForm(requestContext.getForm());

      //TODO: property set validation token for caching (ie ETAG)
      String validationToken = null;
      resourceInvocation.setValidationToken(validationToken);

      resourceInvocation.setResourceState(createNavigationalState(resourceParams.getResourceState()));

      String resourceCacheability = resourceParams.getResourceCacheability();
      if (resourceCacheability != null)
      {
         CacheLevel cacheLevel = WSRPUtils.getCacheLevelFromResourceCacheability(resourceParams.getResourceCacheability());
         resourceInvocation.setCacheLevel(cacheLevel);
      }
      else
      {
         // according to JSR 286, cache level must default to ResourceURL.PAGE
View Full Code Here

      {
         throw new IllegalArgumentException("GetResource needs a valid resource id.");
      }

      // Create ResourceParams
      ResourceParams resourceParams = WSRPTypeFactory.createResourceParams(params.isSecureClientCommunication(),
         params.getLocales(), params.getMimeTypes(), params.getMode(), params.getWindowState(), resourceId,
         WSRPUtils.getStateChangeFromAccessMode(accessMode));

      resourceParams.setNavigationalContext(params.getNavigationalContext());
      resourceParams.setClientData(params.getClientData());
      resourceParams.setResourceCacheability(WSRPUtils.getResourceCacheabilityFromCacheLevel(invocation.getCacheLevel()));

      for (Map.Entry<String, String[]> entry : invocation.getForm().entrySet())
      {
         String name = entry.getKey();
         for (String value : entry.getValue())
         {
            resourceParams.getFormParameters().add(WSRPTypeFactory.createNamedString(name, value));
         }
      }

      StateString resourceState = invocation.getResourceState();
      if (resourceState != null)
      {
         String state = resourceState.getStringValue();
         if (!StateString.JBPNS_PREFIX.equals(state))  // fix-me: see JBPORTAL-900
         {
            resourceParams.setResourceState(state);
         }
      }

      return WSRPTypeFactory.createGetResource(requestPrecursor.getRegistrationContext(), portletContext,
         requestPrecursor.getRuntimeContext(), requestPrecursor.getUserContext(), resourceParams);
View Full Code Here

      GetResource getResource = ResourceServingUtil.decode(req);

      try
      {
         ResourceResponse resource = producer.getResource(getResource);
         ResourceContext resourceContext = resource.getResourceContext();
         byte[] itemBinary = resourceContext.getItemBinary();
         String itemString = resourceContext.getItemString();

         final String mimeType = resourceContext.getMimeType();
         if (!ParameterValidation.isNullOrEmpty(mimeType))
View Full Code Here

      Holder<PortletContext> portletContextHolder = new Holder<PortletContext>(request.getPortletContext());

      consumer.getMarkupService().getResource(request.getRegistrationContext(), portletContextHolder, request.getRuntimeContext(),
         request.getUserContext(), request.getResourceParams(), resourceContextHolder, sessionContextHolder, new Holder<List<Extension>>());

      ResourceResponse resourceResponse = WSRPTypeFactory.createResourceResponse(resourceContextHolder.value);
      resourceResponse.setPortletContext(portletContextHolder.value);
      resourceResponse.setSessionContext(sessionContextHolder.value);
      return resourceResponse;
   }
View Full Code Here

   {
      public ResourceValue apply(V1ResourceValue from)
      {
         if (from != null)
         {
            ResourceValue result = WSRPTypeFactory.createResourceValue(from.getLang(), from.getValue());
           
            List<Extension> extensions = WSRPUtils.transform(from.getExtensions(), EXTENSION);
            if (extensions != null)
            {
               result.getExtensions().addAll(extensions);
            }

            return result;
         }
         else
View Full Code Here

   }

   public static ResourceValue createResourceValue(String lang, String value)
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(lang, "Lang");
      ResourceValue resourceValue = new ResourceValue();
      resourceValue.setLang(value);
      resourceValue.setValue(value);

      return resourceValue;
   }
View Full Code Here

   }

   public static ResourceValue createResourceValue(String lang, String value)
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(lang, "Lang");
      ResourceValue resourceValue = new ResourceValue();
      resourceValue.setLang(value);
      resourceValue.setValue(value);

      return resourceValue;
   }
View Full Code Here

   }

   public static ResourceValue createResourceValue(String lang, String value)
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(lang, "Lang");
      ResourceValue resourceValue = new ResourceValue();
      resourceValue.setLang(value);
      resourceValue.setValue(value);

      return resourceValue;
   }
View Full Code Here

TOP

Related Classes of org.oasis.wsrp.v2.ResourceValue

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.