Package org.gatein.pc.portlet.state

Examples of org.gatein.pc.portlet.state.SimplePropertyMap


            return marshall(stateType, statefulContext.getPortletId(), statefulContext.getProperties());
         }
      }
      else
      {
         PropertyMap newState = new SimplePropertyMap();
         getPropertiesFromMetaData(portletContext, newState);
         if (persistLocally)
         {
            String cloneId = persistenceManager.createState(portletId, newState);
            return PortletContext.createPortletContext(PRODUCER_CLONE_ID_PREFIX + cloneId);
View Full Code Here


      if (context.isStateful())
      {
         StatefulContext statefulContext = (StatefulContext)context;

         // Get the content
         PropertyMap props = new SimplePropertyMap(statefulContext.getProperties());

         // Dereference the portlet
         PortletContext refPortletContext = context.getPortletContext();

         // Get the referenced portlet
         Portlet refPortlet = super.getPortlet(refPortletContext);

         // We need the referenced portlet
         if (refPortlet == null)
         {
            throw new PortletInvokerException("The portlet " + refPortletContext + " referenced by this clone " + portletId + " is not available");
         }

         //
         getPropertiesFromMetaData(refPortletContext, props);

         //
         return props;
      }
      else
      {
         // Get the container
         PropertyMap props = new SimplePropertyMap();
         getPropertiesFromMetaData(context.getPortletContext(), props);
         return props;
      }
   }
View Full Code Here

      //
      PreferencesInfo prefs = referencedPortletInfo.getPreferences();

      // Clone the current state
      PropertyMap properties = new SimplePropertyMap(statefulContext.getProperties());

      // Clone argument
      for (PropertyChange change : changes)
      {
         String key = change.getKey();
         int type = change.getType();

         // If the original value exist and is read only we perform a reset instead
         PreferenceInfo pref = prefs.getPreference(key);
         if (pref != null)
         {
            if (Boolean.TRUE.equals(pref.isReadOnly()))
            {
               type = PropertyChange.PREF_RESET;
            }
         }

         //
         if (type == PropertyChange.PREF_UPDATE)
         {
            properties.setProperty(key, change.getValue());
         }
         else
         {
            properties.remove(key);
         }
      }

      //
      if (statefulContext.isLocal())
View Full Code Here

      }
      else
      {
         if (persistLocally)
         {
            PropertyMap newState = new SimplePropertyMap();
            getPropertiesFromMetaData(originalPortletContext, newState);
            try
            {
               PortletState sstate = new PortletState(portletId, newState);
               Serializable marshalledState = stateConverter.marshall(stateType, sstate);
View Full Code Here

   /** . */
   private Date terminationTime;

   public PortletState(String portletId)
   {
      this(portletId, new SimplePropertyMap());
   }
View Full Code Here

         );

         List<Property> props = properties.value;
         if (props != null)
         {
            PropertyMap result = new SimplePropertyMap(props.size());

            for (Property prop : props)
            {
               String name = prop.getName().toString();
               String value = prop.getStringValue();
               List<String> list = new ArrayList<String>();
               list.add(value);
               result.put(name, list); // todo: is that all?!?
            }

            return result;
         }
         else
         {
            return new SimplePropertyMap();
         }
      }
      catch (OperationNotSupported operationNotSupported)
      {
         throw new UnsupportedOperationException(operationNotSupported);
View Full Code Here

   {
      Map<String, Object> map = getProperties();

      if (!map.isEmpty())
      {
         return new SimplePropertyMap(mappedMap.toExternalMap(map));
      }
      else
      {
         return new SimplePropertyMap();
      }
   }
View Full Code Here

         );

         List<Property> props = properties.value;
         if (props != null)
         {
            PropertyMap result = new SimplePropertyMap(props.size());

            for (Property prop : props)
            {
               String name = prop.getName();
               String value = prop.getStringValue();
               List<String> list = new ArrayList<String>();
               list.add(value);
               result.put(name, list); // todo: is that all?!?
            }

            return result;
         }
         else
         {
            return new SimplePropertyMap();
         }
      }
      catch (Exception e)
      {
         // something went wrong but support for getPortletProperties is optional so return an empty PropertyMap
         log.debug("Couldn't get properties for portlet '" + portletContext.getId() + "'", e);
         return new SimplePropertyMap();
      }
   }
View Full Code Here

            return marshall(stateType, statefulContext.getPortletId(), statefulContext.getProperties());
         }
      }
      else
      {
         PropertyMap newState = new SimplePropertyMap();
         getPropertiesFromMetaData(portletContext, newState);
         if (persistLocally)
         {
            String cloneId = persistenceManager.createState(portletId, newState);
            return PortletContext.createPortletContext(PRODUCER_CLONE_ID_PREFIX + cloneId);
View Full Code Here

      if (context.isStateful())
      {
         StatefulContext statefulContext = (StatefulContext)context;

         // Get the content
         PropertyMap props = new SimplePropertyMap(statefulContext.getProperties());

         // Dereference the portlet
         PortletContext refPortletContext = context.getPortletContext();

         // Get the referenced portlet
         Portlet refPortlet = super.getPortlet(refPortletContext);

         // We need the referenced portlet
         if (refPortlet == null)
         {
            throw new PortletInvokerException("The portlet " + refPortletContext + " referenced by this clone " + portletId + " is not available");
         }

         //
         getPropertiesFromMetaData(refPortletContext, props);

         //
         return props;
      }
      else
      {
         // Get the container
         PropertyMap props = new SimplePropertyMap();
         getPropertiesFromMetaData(context.getPortletContext(), props);
         return props;
      }
   }
View Full Code Here

TOP

Related Classes of org.gatein.pc.portlet.state.SimplePropertyMap

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.