Package org.gatein.pc.api.info

Examples of org.gatein.pc.api.info.PreferenceInfo


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


      // Collect missing or read only properties from the referenced portlet
      Set<String> keys = new HashSet<String>();
      for (String key : prefs.getKeys())
      {
         PreferenceInfo pref = prefs.getPreference(key);
         if (Boolean.TRUE.equals(pref.isReadOnly()) || !props.keySet().contains(pref.getKey()))
         {
            keys.add(key);
         }
      }
View Full Code Here

        } else {
            Map<String, String> portletPreferenceMaps = new HashMap<String, String>();
            Set<String> keySet = portlet.getInfo().getPreferences().getKeys();

            for (String key : keySet) {
                PreferenceInfo preferenceInfo = portlet.getInfo().getPreferences().getPreference(key);
                if (!preferenceInfo.isReadOnly()) {
                    String ppValue = (preferenceInfo.getDefaultValue().size() > 0) ? preferenceInfo.getDefaultValue().get(0)
                            : "";
                    portletPreferenceMaps.put(key, ppValue);
                }
            }
View Full Code Here

         {
            Set keySet = prefsInfo.getKeys();
            descs = new ArrayList<PropertyDescription>(keySet.size());
            for (Object key : keySet)
            {
               PreferenceInfo prefInfo = prefsInfo.getPreference((String)key);

               // WSRP Spec 8.7: return only the portion of the Portlet's persistent state the user is allowed to modify
               // if read only status is not determined, we consider it as being read-only to be safe
               Boolean readOnly = prefInfo.isReadOnly();
               if (readOnly != null && !readOnly)
               {
                  //todo: check what we should use key
                  //todo: right now we only support String properties
                  List<String> desiredLocales = getPortletPropertyDescription.getDesiredLocales();
                  desiredLocales = WSRPUtils.replaceByEmptyListIfNeeded(desiredLocales);
                  PropertyDescription desc = WSRPTypeFactory.createPropertyDescription(prefInfo.getKey(), WSRPConstants.XSD_STRING);
                  desc.setLabel(Utils.convertToWSRPLocalizedString(prefInfo.getDisplayName(), desiredLocales));
                  desc.setHint(Utils.convertToWSRPLocalizedString(prefInfo.getDescription(), desiredLocales));
                  descs.add(desc);
               }
            }
         }
View Full Code Here

         PropertyList result = WSRPTypeFactory.createPropertyList();
         int propertyNb = properties.size();

         if (propertyNb > 0)
         {
            PreferenceInfo prefInfo;
            String key;
            List<String> values;
            LocalizedString displayName;

            for (Map.Entry<String, List<String>> entry : properties.entrySet())
            {
               key = entry.getKey();
               values = entry.getValue();
               prefInfo = info.getPreferences().getPreference(key);
               String lang = WSRPConstants.DEFAULT_LOCALE;
               if (prefInfo != null)
               {
                  displayName = prefInfo.getDisplayName();
                  if (displayName != null)
                  {
                     lang = WSRPUtils.toString(displayName.getDefaultLocale());
                  }
               }
View Full Code Here

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

      // Collect missing or read only properties from the referenced portlet
      Set<String> keys = new HashSet<String>();
      for (String key : prefs.getKeys())
      {
         PreferenceInfo pref = prefs.getPreference(key);
         if (Boolean.TRUE.equals(pref.isReadOnly()) || !props.keySet().contains(pref.getKey()))
         {
            keys.add(key);
         }
      }
View Full Code Here

    * @param key the preference key
    * @return the read only value
    */
   private boolean isDDReadOnly(String key)
   {
      PreferenceInfo pref = containerPrefs.getPreference(key);
      if (pref != null)
      {
         return Boolean.TRUE.equals(pref.isReadOnly());
      }
      return false;
   }
View Full Code Here

        } else {
            Map<String, String> portletPreferenceMaps = new HashMap<String, String>();
            Set<String> keySet = portlet.getInfo().getPreferences().getKeys();

            for (String key : keySet) {
                PreferenceInfo preferenceInfo = portlet.getInfo().getPreferences().getPreference(key);
                if (!preferenceInfo.isReadOnly()) {
                    String ppValue = (preferenceInfo.getDefaultValue().size() > 0) ? preferenceInfo.getDefaultValue().get(0)
                            : "";
                    portletPreferenceMaps.put(key, ppValue);
                }
            }
View Full Code Here

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

TOP

Related Classes of org.gatein.pc.api.info.PreferenceInfo

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.