Package com.datasift.client.managedsource

Examples of com.datasift.client.managedsource.ManagedSource$ResourceParams


      ParameterValidation.throwIllegalArgExceptionIfNull(stateChange, "State Change");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(mode, "mode", "ResourceParams");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(windowState, "window state", "ResourceParams");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(resourceID, "Resource ID", "ResourceParams");

      ResourceParams resourceParams = new ResourceParams();
      resourceParams.setSecureClientCommunication(secureClientCommunication);
      resourceParams.setMode(mode);
      resourceParams.setWindowState(windowState);
      if (ParameterValidation.existsAndIsNotEmpty(locales))
      {
         resourceParams.getLocales().addAll(locales);
      }

      if (ParameterValidation.existsAndIsNotEmpty(mimeTypes))
      {
         resourceParams.getMimeTypes().addAll(mimeTypes);
      }

      resourceParams.setResourceID(resourceID);
      resourceParams.setPortletStateChange(stateChange);

      return resourceParams;
   }
View Full Code Here


      List<String> locales = WSRPUtils.convertLocalesToRFC3066LanguageTags(Collections.list(reqLocales));
      List<String> mimeTypes = WSRPConstants.getDefaultMimeTypes();

      Map<String, String[]> parameters = req.getParameterMap();

      ResourceParams resourceParams = WSRPTypeFactory.createResourceParams(req.isSecure(), locales, mimeTypes,
         WSRPConstants.VIEW_MODE, WSRPConstants.NORMAL_WINDOW_STATE, resourceId, StateChange.READ_ONLY, parameters);
      resourceParams.setResourceState(req.getParameter(RESOURCE_STATE));

      String navState = req.getParameter(NAV_STATE);
      if (!ParameterValidation.isNullOrEmpty(navState))
      {
         resourceParams.setNavigationalContext(WSRPTypeFactory.createNavigationalContext(navState, Collections.<NamedString>emptyList()));
      }

      return WSRPTypeFactory.createGetResource(registrationContext, portletContext, runtimeContext, null, resourceParams);
   }
View Full Code Here

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

      ResourceParams resourceParams = this.getResource.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.getResource.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

      ParameterValidation.throwIllegalArgExceptionIfNull(stateChange, "State Change");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(mode, "mode", "ResourceParams");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(windowState, "window state", "ResourceParams");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(resourceID, "Resource ID", "ResourceParams");

      ResourceParams resourceParams = new ResourceParams();
      resourceParams.setSecureClientCommunication(secureClientCommunication);
      resourceParams.setMode(mode);
      resourceParams.setWindowState(windowState);
      if (ParameterValidation.existsAndIsNotEmpty(locales))
      {
         resourceParams.getLocales().addAll(locales);
      }

      if (ParameterValidation.existsAndIsNotEmpty(mimeTypes))
      {
         resourceParams.getMimeTypes().addAll(mimeTypes);
      }

      resourceParams.setResourceID(resourceID);
      resourceParams.setPortletStateChange(stateChange);

      return resourceParams;
   }
View Full Code Here

      Enumeration reqLocales = req.getLocales();
      List<String> locales = WSRPUtils.convertLocalesToRFC3066LanguageTags(Collections.list(reqLocales));
      List<String> mimeTypes = WSRPConstants.getDefaultMimeTypes();

      ResourceParams resourceParams = WSRPTypeFactory.createResourceParams(req.isSecure(), locales, mimeTypes,
         WSRPConstants.VIEW_MODE, WSRPConstants.NORMAL_WINDOW_STATE, resourceId, StateChange.READ_ONLY);
      resourceParams.setResourceState(req.getParameter(RESOURCE_STATE));

      String navState = req.getParameter(NAV_STATE);
      if (!ParameterValidation.isNullOrEmpty(navState))
      {
         resourceParams.setNavigationalContext(WSRPTypeFactory.createNavigationalContext(navState, Collections.<NamedString>emptyList()));
      }

      return WSRPTypeFactory.createGetResource(registrationContext, portletContext, runtimeContext, null, resourceParams);
   }
View Full Code Here

      ParameterValidation.throwIllegalArgExceptionIfNull(stateChange, "State Change");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(mode, "mode", "ResourceParams");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(windowState, "window state", "ResourceParams");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(resourceID, "Resource ID", "ResourceParams");

      ResourceParams resourceParams = new ResourceParams();
      resourceParams.setSecureClientCommunication(secureClientCommunication);
      resourceParams.setMode(mode);
      resourceParams.setWindowState(windowState);
      if (ParameterValidation.existsAndIsNotEmpty(locales))
      {
         resourceParams.getLocales().addAll(locales);
      }

      if (ParameterValidation.existsAndIsNotEmpty(mimeTypes))
      {
         resourceParams.getMimeTypes().addAll(mimeTypes);
      }

      resourceParams.setResourceID(resourceID);
      resourceParams.setPortletStateChange(stateChange);

      return resourceParams;
   }
View Full Code Here

TOP

Related Classes of com.datasift.client.managedsource.ManagedSource$ResourceParams

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.