Package org.gatein.pc.api

Examples of org.gatein.pc.api.ParametersStateString


      this.version = version;
   }

   protected byte[] internalEncodeAsBytes() throws UnsupportedEncodingException
   {
      ParametersStateString parameterStateString = ParametersStateString.create();

      parameterStateString.setValue(REFIDKEY, refID);
      parameterStateString.setValue(TYPEKEY, type);
     
      String stateString = parameterStateString.getStringValue();
      return stateString.getBytes(ENCODING);
   }
View Full Code Here


      //
      byte b = in.readByte();
      switch (b)
      {
         case EMPTY:
            return new ParametersStateString();
         case SERIALIZED:
            return new ParametersStateString(in);
         case OPAQUE:
            return new OpaqueStateString(in.readUTF());
      }

      //
View Full Code Here

      {
         throw new IllegalArgumentException();
      }
      if (opaqueValue.startsWith(JBPNS_PREFIX))
      {
         return new ParametersStateString(opaqueValue);
      }
      else
      {
         return new OpaqueStateString(opaqueValue);
      }
View Full Code Here

      }
   }

   private Conversation loadConversation(PortletInvocation invocation)
   {
      ParametersStateString parameters = (ParametersStateString)invocation.getNavigationalState();

      //
      if (parameters != null)
      {
         String id = parameters.getValue("javax.portlet.as");

         //
         if (id != null)
         {
            // Get the http session if any
View Full Code Here

      PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
   {
      invocation.setRequestAttributes(conversation.getAttributes());

      // Set the id parameter
      ParametersStateString inNS = (ParametersStateString)invocation.getNavigationalState();
      if (inNS == null)
      {
         inNS = ParametersStateString.create();
         invocation.setNavigationalState(inNS);
      }
      inNS.setValue("javax.portlet.as", conversation.id);

      //
      PortletInvocationResponse response = super.invoke(invocation);

      //
      if (response instanceof UpdateNavigationalStateResponse)
      {
         UpdateNavigationalStateResponse update = (UpdateNavigationalStateResponse)response;

         //
         Map<String, Object> attributes = update.getAttributes();

         //
         if (attributes != null && attributes.size() > 0)
         {
            ParametersStateString outNS = (ParametersStateString)update.getNavigationalState();
            outNS.setValue("javax.portlet.as", conversation.id);

            //
            conversation.setAttributes(attributes);

            //
View Full Code Here

      }
   }

   private Conversation loadConversation(PortletInvocation invocation)
   {
      ParametersStateString parameters = (ParametersStateString)invocation.getNavigationalState();

      //
      if (parameters != null)
      {
         String id = parameters.getValue("javax.portlet.as");

         //
         if (id != null)
         {
            // Get the http session if any
View Full Code Here

      PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
   {
      invocation.setRequestAttributes(conversation.getAttributes());

      // Set the id parameter
      ParametersStateString inNS = (ParametersStateString)invocation.getNavigationalState();
      if (inNS == null)
      {
         inNS = ParametersStateString.create();
         invocation.setNavigationalState(inNS);
      }
      inNS.setValue("javax.portlet.as", conversation.id);

      //
      PortletInvocationResponse response = super.invoke(invocation);

      //
      if (response instanceof UpdateNavigationalStateResponse)
      {
         UpdateNavigationalStateResponse update = (UpdateNavigationalStateResponse)response;

         //
         Map<String, Object> attributes = update.getAttributes();

         //
         if (attributes != null && attributes.size() > 0)
         {
            ParametersStateString outNS = (ParametersStateString)update.getNavigationalState();
            outNS.setValue("javax.portlet.as", conversation.id);

            //
            conversation.setAttributes(attributes);

            //
View Full Code Here

            {
               strings[1] = "windowstate=" + updateResponse.getWindowState();
            }

            // Should be ok, we are not consuming remote portlets
            ParametersStateString newNS = (ParametersStateString)updateResponse.getNavigationalState();
            if (newNS != null)
            {
               StringBuilder sb = new StringBuilder();
               sb.append("private=");
               formatMap(newNS.getParameters(), sb);
               strings[2] = sb.toString();
            }

            //
            Map<String, String[]> publicChanges = updateResponse.getPublicNavigationalStateUpdates();
View Full Code Here

      assertMarshallable(pageNS);
   }

   public void testMarshalling2()
   {
      ParametersStateString params = ParametersStateString.create();
      params.setValue("foo", "bar");
      test(null, null, null);
      test(null, Mode.VIEW, null);
      test(null, null, org.gatein.pc.api.WindowState.NORMAL);
      test(null, Mode.VIEW, org.gatein.pc.api.WindowState.NORMAL);
      test(null, Mode.create("foo"), null);
View Full Code Here

TOP

Related Classes of org.gatein.pc.api.ParametersStateString

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.