Examples of JSEntity


Examples of org.apache.jetspeed.serializer.objects.JSEntity

    private void importPD(JSApplication app, JSPortlet portlet, PortletDefinition pd, Map settings, Logger log) throws SerializerException
    {
        Iterator it = portlet.getEntities().iterator();
        while (it.hasNext())
        {
            JSEntity entity = (JSEntity) it.next();
            importEntityPref(app, portlet, entity, pd, settings, log);
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSEntity

            if ((windowIds == null) || (windowIds.size() == 0))
                return null;
            JSEntities entities = new JSEntities();
            for (String windowId : windowIds)
            {
                JSEntity jsEntity = exportEntityPref(pd, windowId, settings, log);
                if (jsEntity != null)
                    entities.add(jsEntity);
            }
            if (!entities.isEmpty())
            {
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSEntity

        return jsPortlet;
    }

    JSEntity exportEntityPref(PortletDefinition definition, String windowId, Map settings, Logger log)
    {
        JSEntity jsEntity = null;
        jsEntity = new JSEntity();
        jsEntity.setId(windowId);
        JSEntityPreferences entityPreferences = new JSEntityPreferences();
        Set<String> userNames = prefsProvider.getUserNames(definition, windowId);
        for (String userName : userNames)
        {
            Map<String, PortletPreference> userPreferences = prefsProvider.getUserPreferences(definition, windowId, userName);
            JSEntityPreference userPreference = new JSEntityPreference();
            userPreference.setPrincapalName(userName);
            Iterator<String> preferences = userPreferences.keySet().iterator();
            JSNVPElements v = new JSNVPElements("preference");
            while (preferences.hasNext())
            {
                String pKey = preferences.next();
                PortletPreference portletPreference = userPreferences.get(pKey);
                JSNVPElement element = new JSNVPElement();
                element.setKey(pKey);
                element.setValues(portletPreference.getValues());
                element.setReadOnly(portletPreference.isReadOnly());
                v.add(element);
            }
            if (v.size() > 0)
            {
                userPreference.setPreferences(v);
                entityPreferences.add(userPreference);
            }
            if (!entityPreferences.isEmpty())
            {
                log.debug("processed preferences for entity=" + windowId);
                jsEntity.setEntityPreferences(entityPreferences);
            }
        }
        return jsEntity;
    }
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSEntity

      while (list.hasNext())
      {
        MutablePortletEntity entity = (MutablePortletEntity) list
            .next();
        JSEntity jsEntity = exportEntityPref(entity);
        if (jsEntity != null)
          entities.add(jsEntity);

      }
      System.out.println("-----processedAnyEntities for PD="
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSEntity

    }
  }

  JSEntity exportEntityPref(MutablePortletEntity entity)
  {
    JSEntity jsEntity = new JSEntity();
    jsEntity.setId(entity.getId().toString());
    String rootForEntity = MutablePortletEntity.PORTLET_ENTITY_ROOT + "/"
        + entity.getId();
    try
    {
      if (!(Preferences.userRoot().nodeExists(rootForEntity)))
      {
        // System.out.println("No preferences exist for entity "+
        // entity.getId());
        return jsEntity;
      }

      Preferences prefNode = Preferences.userRoot().node(rootForEntity);
      String[] children = prefNode.childrenNames();
      if ((children != null) && (children.length > 0))
      {
        JSEntityPreferences permissions = new JSEntityPreferences();

        for (int i = 0; i < children.length; i++)
        {
          JSEntityPreference permission = processPreferenceNode(
              entity, children[i]);
          if (permission != null)
            permissions.add(permission);
        }
        System.out.println("processed preferences for entity="
            + entity.getId());
        jsEntity.setEntityPreferences(permissions);
        return jsEntity;
        // processPreferenceNode(entity,prefNode,null);
      }
      return jsEntity;
    } catch (Exception e)
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSEntity

    JSEntities entities = portlet.getEntities();
    Iterator it = entities.iterator();
    while (it.hasNext())
    {
      JSEntity entity = (JSEntity)it.next();
      MutablePortletEntity portletEntity = entityAccess.getPortletEntity(entity.getId());
      if (portletEntity == null)
      {
        portletEntity = entityAccess.newPortletEntityInstance(pd, entity.getId());
        try
        {
          entityAccess.storePortletEntity(portletEntity);
        }
        catch (Exception e)
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSEntity

      while (list.hasNext())
      {
        MutablePortletEntity entity = (MutablePortletEntity) list
            .next();
        JSEntity jsEntity = exportEntityPref(entity);
        if (jsEntity != null)
          entities.add(jsEntity);

      }
      System.out.println("-----processedAnyEntities for PD="
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSEntity

    }
  }

  JSEntity exportEntityPref(MutablePortletEntity entity)
  {
    JSEntity jsEntity = new JSEntity();
    jsEntity.setId(entity.getId().toString());
    String rootForEntity = MutablePortletEntity.PORTLET_ENTITY_ROOT + "/"
        + entity.getId();
    try
    {
      if (!(Preferences.userRoot().nodeExists(rootForEntity)))
      {
        // System.out.println("No preferences exist for entity "+
        // entity.getId());
        return jsEntity;
      }

      Preferences prefNode = Preferences.userRoot().node(rootForEntity);
      String[] children = prefNode.childrenNames();
      if ((children != null) && (children.length > 0))
      {
        JSEntityPreferences permissions = new JSEntityPreferences();

        for (int i = 0; i < children.length; i++)
        {
          JSEntityPreference permission = processPreferenceNode(
              entity, children[i]);
          if (permission != null)
            permissions.add(permission);
        }
        System.out.println("processed preferences for entity="
            + entity.getId());
        jsEntity.setEntityPreferences(permissions);
        return jsEntity;
        // processPreferenceNode(entity,prefNode,null);
      }
      return jsEntity;
    } catch (Exception e)
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSEntity

    JSEntities entities = portlet.getEntities();
    Iterator it = entities.iterator();
    while (it.hasNext())
    {
      JSEntity entity = (JSEntity)it.next();
      MutablePortletEntity portletEntity = entityAccess.getPortletEntity(entity.getId());
      if (portletEntity == null)
      {
        portletEntity = entityAccess.newPortletEntityInstance(pd, entity.getId());
        try
        {
          entityAccess.storePortletEntity(portletEntity);
        }
        catch (Exception e)
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSEntity

      while (list.hasNext())
      {
        MutablePortletEntity entity = (MutablePortletEntity) list
            .next();
        JSEntity jsEntity = exportEntityPref(entity);
        if (jsEntity != null)
          entities.add(jsEntity);

      }
      portlet.setEntities(entities);
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.