Examples of SimplePropertyMap


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

         );

         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

Examples of org.jboss.portal.portlet.state.SimplePropertyMap

         {
            throw new StateConversionException("Bad version id " + versionId);
         }
         String portletId = dis.readUTF();
         int size = dis.readInt();
         PropertyMap properties = new SimplePropertyMap(size);
         while (size-- > 0)
         {
            String key = dis.readUTF();
            int length = dis.readInt();
            String[] strings = new String[length];
            for (int i = 0; i < strings.length; i++)
            {
               boolean isNull = dis.readBoolean();
               if (isNull == false)
               {
                  String string = dis.readUTF();
                  strings[i] = string;
               }
            }
            List<String> value = Arrays.asList(strings.clone());
            properties.setProperty(key, value);
         }
         return new PortletState(portletId, properties);
      }
      catch (IOException e)
      {
View Full Code Here

Examples of org.jboss.portal.portlet.state.SimplePropertyMap

      {
         throw new NoSuchPortletException(portletContext.getId());
      }
      ContainerPortletInfo info = (ContainerPortletInfo)portlet.getInfo();
      ContainerPreferencesInfo prefs = (ContainerPreferencesInfo)info.getPreferences();
      PropertyMap result = new SimplePropertyMap();
      for (String key : keys)
      {
         ContainerPreferenceInfo pref = prefs.getContainerPreference(key);
         if (pref != null)
         {
            result.put(key, pref.getDefaultValue());
         }
      }
      return result;
   }
View Full Code Here

Examples of org.jboss.portal.portlet.state.SimplePropertyMap

      {
         throw new NoSuchPortletException(portletContext.getId());
      }
      ContainerPortletInfo info = (ContainerPortletInfo)portlet.getInfo();
      ContainerPreferencesInfo prefs = (ContainerPreferencesInfo)info.getPreferences();
      PropertyMap result = new SimplePropertyMap();
      for (String key : prefs.getKeys())
      {
         ContainerPreferenceInfo pref = prefs.getContainerPreference(key);
         if (pref != null)
         {
            result.put(key, pref.getDefaultValue());
         }
      }
      return result;
   }
View Full Code Here

Examples of org.jboss.portal.portlet.state.SimplePropertyMap

   /** . */
   private Date terminationTime;

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

Examples of org.jboss.portal.portlet.state.SimplePropertyMap

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

Examples of org.jboss.portal.portlet.state.SimplePropertyMap

      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

Examples of org.metagrid.gatekeeper.node.property.SimplePropertyMap

    public void testUnknownElement()
    throws Exception
        {
        //
        // Create our PropertyMap (null node).
        final PropertyMap properties = new SimplePropertyMap(null);
        //
        // Create our reader.
        final XMLPropertiesReader reader = new XMLPropertiesReaderImpl(
            new XMLPropertyReaderImpl()
            );
View Full Code Here

Examples of org.metagrid.gatekeeper.node.property.SimplePropertyMap

    public void testGenericProperties()
    throws Exception
        {
        //
        // Create our PropertyMap (null node).
        final PropertyMap properties = new SimplePropertyMap(null);
        //
        // Create our reader.
        final XMLPropertiesReader reader = new XMLPropertiesReaderImpl(
            new XMLPropertyReaderImpl()
            );
        //
        // Parse the test XML.
        reader.read(
            new StringResource(
                  "<properties xmlns='urn:metagrid'>"
                + "  <property type='urn:metagrid/property/type/frog'>property.frog</property>"
                + "  <property type='urn:metagrid/property/type/toad'>property.toad</property>"
                + "</properties>"
                ).reader(),
            properties
            );
        //
        // Check the property values.
        assertEquals(
            "property.frog",
            properties.get(
                new URI(
                    "urn:metagrid/property/type/frog"
                    )
                ).value()
            );
        assertEquals(
            "property.toad",
            properties.get(
                new URI(
                    "urn:metagrid/property/type/toad"
                    )
                ).value()
            );
View Full Code Here

Examples of org.metagrid.gatekeeper.node.property.SimplePropertyMap

    public void testSkipComments()
    throws Exception
        {
        //
        // Create our PropertyMap (null node).
        final PropertyMap properties = new SimplePropertyMap(null);
        //
        // Create our reader.
        final XMLPropertiesReader reader = new XMLPropertiesReaderImpl(
            new XMLPropertyReaderImpl()
            );
        //
        // Parse the test XML.
        reader.read(
            new StringResource(
                  "<!-- skip this comment -->"
                + "<properties xmlns='urn:metagrid'>"
                + "  <!-- skip this comment -->"
                + "  <property type='urn:metagrid/property/type/frog'>property.frog</property>"
                + "  <!-- skip this comment -->"
                + "  <property type='urn:metagrid/property/type/toad'>property.toad</property>"
                + "  <!-- skip this comment -->"
                + "</properties>"
                + "<!-- skip this comment -->"
                ).reader(),
            properties
            );
        //
        // Check the property values.
        assertEquals(
            "property.frog",
            properties.get(
                new URI(
                    "urn:metagrid/property/type/frog"
                    )
                ).value()
            );
        assertEquals(
            "property.toad",
            properties.get(
                new URI(
                    "urn:metagrid/property/type/toad"
                    )
                ).value()
            );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.