Package jar1

Examples of jar1.GetResource


   @Override
   protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
   {
      WSRP2Producer producer = ProducerHolder.getProducer();

      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))
         {
            resp.setContentType(mimeType);
         }

         if (itemBinary != null && itemBinary.length > 0)
         {
            resp.getOutputStream().write(itemBinary);
         }

         if (!ParameterValidation.isNullOrEmpty(itemString))
         {
            resp.getWriter().write(itemString);
         }
      }
      catch (Exception exception)
      {
         throw new ServletException("Couldn't get resource " + getResource.getResourceParams().getResourceID()
            + " for portlet " + getResource.getPortletContext(), exception);
      }
   }
View Full Code Here


   @Override
   protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
   {
      WSRP2Producer producer = ProducerHolder.getProducer();

      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))
         {
            resp.setContentType(mimeType);
         }

         if (itemBinary != null && itemBinary.length > 0)
         {
            resp.getOutputStream().write(itemBinary);
         }

         if (!ParameterValidation.isNullOrEmpty(itemString))
         {
            resp.getWriter().write(itemString);
         }
      }
      catch (Exception exception)
      {
         throw new ServletException("Couldn't get resource " + getResource.getResourceParams().getResourceID()
            + " for portlet " + getResource.getPortletContext(), exception);
      }
   }
View Full Code Here

   ) throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession,
      InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
      ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState
   {
      forceSessionAccess();
      GetResource getResource = WSRPTypeFactory.createGetResource(registrationContext, portletContext.value, runtimeContext, userContext, resourceParams);

      ResourceResponse response = producer.getResource(getResource);

      resourceContext.value = response.getResourceContext();
      sessionContext.value = response.getSessionContext();
View Full Code Here

   ) throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession,
      InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
      ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState
   {
      forceSessionAccess();
      GetResource getResource = WSRPTypeFactory.createGetResource(registrationContext, portletContext.value, runtimeContext, userContext, resourceParams);

      ResourceResponse response = producer.getResource(getResource);

      resourceContext.value = response.getResourceContext();
      sessionContext.value = response.getSessionContext();
View Full Code Here

   ) throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession,
      InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
      ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState
   {
      forceSessionAccess();
      GetResource getResource = WSRPTypeFactory.createGetResource(registrationContext, portletContext.value, runtimeContext, userContext, resourceParams);

      ResourceResponse response = producer.getResource(getResource);

      resourceContext.value = response.getResourceContext();
      sessionContext.value = response.getSessionContext();
View Full Code Here

      ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletContext.getPortletHandle(), "portlet handle", "PortletContext");
      ParameterValidation.throwIllegalArgExceptionIfNull(runtimeContext, "RuntimeContext");
      ParameterValidation.throwIllegalArgExceptionIfNull(resourceParams, "ResourceParams");

      GetResource getResource = new GetResource();
      getResource.setRegistrationContext(registrationContext);
      getResource.setPortletContext(portletContext);
      getResource.setRuntimeContext(runtimeContext);
      getResource.setUserContext(userContext);
      getResource.setResourceParams(resourceParams);
      return getResource;
   }
View Full Code Here

   @Override
   protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
   {
      WSRP2Producer producer = ProducerHolder.getProducer();

      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))
         {
            resp.setContentType(mimeType);
         }

         if (itemBinary != null && itemBinary.length > 0)
         {
            resp.getOutputStream().write(itemBinary);
         }

         if (!ParameterValidation.isNullOrEmpty(itemString))
         {
            resp.getWriter().write(itemString);
         }
      }
      catch (Exception exception)
      {
         throw new ServletException("Couldn't get resource " + getResource.getResourceParams().getResourceID()
            + " for portlet " + getResource.getPortletContext(), exception);
      }
   }
View Full Code Here

               "Couldn't initiate EventRequestProcessor", operationNotSupported);
         }
      }
      else if (request instanceof GetResource)
      {
         GetResource getResource = (GetResource)request;
         return new ResourceRequestProcessor(producer, getResource);
      }
      else
      {
         throw new IllegalArgumentException("Unknown request type: " + request.getClass().getSimpleName());
View Full Code Here

      ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletContext.getPortletHandle(), "portlet handle", "PortletContext");
      ParameterValidation.throwIllegalArgExceptionIfNull(runtimeContext, "RuntimeContext");
      ParameterValidation.throwIllegalArgExceptionIfNull(resourceParams, "ResourceParams");

      GetResource getResource = new GetResource();
      getResource.setRegistrationContext(registrationContext);
      getResource.setPortletContext(portletContext);
      getResource.setRuntimeContext(runtimeContext);
      getResource.setUserContext(userContext);
      getResource.setResourceParams(resourceParams);
      return getResource;
   }
View Full Code Here

   ) throws AccessDenied, InconsistentParameters, InvalidCookie, InvalidHandle, InvalidRegistration, InvalidSession,
      InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported,
      ResourceSuspended, UnsupportedLocale, UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState
   {
      forceSessionAccess();
      GetResource getResource = WSRPTypeFactory.createGetResource(registrationContext, portletContext.value, runtimeContext, userContext, resourceParams);

      ResourceResponse response = producer.getResource(getResource);

      resourceContext.value = response.getResourceContext();
      sessionContext.value = response.getSessionContext();
View Full Code Here

TOP

Related Classes of jar1.GetResource

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.