Examples of JSEntityPreference


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

                Object preference = it.next();
                String userName = null;
                JSNVPElements preferenceElements = null;
                if (preference instanceof JSEntityPreference)
                {
                    JSEntityPreference pref = (JSEntityPreference)preference;
                    userName = pref.getPrincapalName();
                    preferenceElements = pref.getPreferences();
                }
                else if (preference instanceof JSEntityPreferenceCompat)
                {
                    JSEntityPreferenceCompat pref = (JSEntityPreferenceCompat)preference;
                    userName = pref.getName();
                    preferenceElements = pref.getPreferences();                   
                }
                for (JSNVPElement element : preferenceElements.getValues())
                {
                    if (element.getValues() == null)
                    {
View Full Code Here

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

        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);
View Full Code Here

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

      {
        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="
View Full Code Here

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

        + PrefsPreference.PORTLET_PREFERENCES_ROOT;
    Preferences prefNode = Preferences.userRoot().node(prefNodePath);

    if (prefNode == null)
      return null;
    JSEntityPreference permission = new JSEntityPreference();
    permission.setName(child);

    try
    {
      PrefsPreferenceSetImpl preferenceSet = new PrefsPreferenceSetImpl(
          prefNode);
      if (preferenceSet.size() == 0)
        return null;
      Iterator it = preferenceSet.iterator();
      JSNVPElements v = new JSNVPElements();

      while (it.hasNext())
      {
        Preference pref = (Preference) it.next();
        String name = pref.getName();
        Iterator ii = pref.getValues();
        while (ii.hasNext())
        {
          Object o = ii.next();
          v.add(name, o.toString());
        }
      }
      if (v.size() > 0)
      {
        permission.setPreferences(v);
        return permission;
      }
      return null;
    } catch (Exception e)
    {
View Full Code Here

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

     
     
      Iterator it = preferences.iterator();
      while (it.hasNext())
      {
        JSEntityPreference preference = (JSEntityPreference)it.next();
       
        // do we have preferences for this one?
        importPreferenceNode(preference,portletEntity);
      }
     
View Full Code Here

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

      {
        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="
View Full Code Here

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

        + PrefsPreference.PORTLET_PREFERENCES_ROOT;
    Preferences prefNode = Preferences.userRoot().node(prefNodePath);

    if (prefNode == null)
      return null;
    JSEntityPreference permission = new JSEntityPreference();
    permission.setName(child);

    try
    {
      PrefsPreferenceSetImpl preferenceSet = new PrefsPreferenceSetImpl(
          prefNode);
      if (preferenceSet.size() == 0)
        return null;
      Iterator it = preferenceSet.iterator();
      JSNVPElements v = new JSNVPElements();

      while (it.hasNext())
      {
        Preference pref = (Preference) it.next();
        String name = pref.getName();
        Iterator ii = pref.getValues();
        while (ii.hasNext())
        {
          Object o = ii.next();
          v.add(name, o.toString());
        }
      }
      if (v.size() > 0)
      {
        permission.setPreferences(v);
        return permission;
      }
      return null;
    } catch (Exception e)
    {
View Full Code Here

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

     
     
      Iterator it = preferences.iterator();
      while (it.hasNext())
      {
        JSEntityPreference preference = (JSEntityPreference)it.next();
       
        // do we have preferences for this one?
        importPreferenceNode(preference,portletEntity);
      }
     
View Full Code Here

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

      {
        JSEntityPreferences permissions = new JSEntityPreferences();

        for (int i = 0; i < children.length; i++)
        {
          JSEntityPreference permission = processPreferenceNode(
              entity, children[i]);
          if (permission != null)
            permissions.add(permission);
        }
        jsEntity.setEntityPreferences(permissions);
View Full Code Here

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

        + PrefsPreference.PORTLET_PREFERENCES_ROOT;
    Preferences prefNode = Preferences.userRoot().node(prefNodePath);

    if (prefNode == null)
      return null;
    JSEntityPreference permission = new JSEntityPreference();
    permission.setName(child);

    try
    {
      PrefsPreferenceSetImpl preferenceSet = new PrefsPreferenceSetImpl(
          prefNode);
      if (preferenceSet.size() == 0)
        return null;
      Iterator it = preferenceSet.iterator();
      JSNVPElements v = new JSNVPElements();

      while (it.hasNext())
      {
        Preference pref = (Preference) it.next();
        String name = pref.getName();
        Iterator ii = pref.getValues();
        while (ii.hasNext())
        {
          Object o = ii.next();
          v.add(name, o.toString());
        }
      }
      if (v.size() > 0)
      {
        permission.setPreferences(v);
        return permission;
      }
      return null;
    } catch (Exception e)
    {
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.