Package org.apache.pluto.om.common

Examples of org.apache.pluto.om.common.Preference


    // PreferenceSet implementation.

    public Preference get(String name) {
        Iterator iterator = this.preferences.iterator();
        while (iterator.hasNext()) {
            Preference preference = (Preference)iterator.next();
            if (preference.getName().equals(name)) {
                return preference;
            }
        }
        return null;
    }
View Full Code Here



    public Preference remove(String name) {
        Iterator iterator = this.iterator();
        while (iterator.hasNext()) {
            Preference preference = (Preference)iterator.next();
            if (preference.getName().equals(name)) {
                this.preferences.remove(preference);
                return preference;
            }
        }
        return null;
View Full Code Here

    static public HashMap createPreferenceMap(Collection preferences)
    {
        HashMap returnValue = new HashMap();
        Iterator iterator = preferences.iterator();
        while (iterator.hasNext()) {
            Preference preference = (Preference)iterator.next();           
            returnValue.put(preference.getName(), preference.getValues());
        }
        return returnValue;
    }
View Full Code Here

    public Preference get(String name)
    {
        Iterator iterator = this.iterator();
        while (iterator.hasNext()) {
            Preference preference = (Preference)iterator.next();
            if (preference.getName().equals(name)) {
                return preference;
            }
        }
        return null;
    }
View Full Code Here

    public Preference remove(String name)
    {
        Iterator iterator = this.iterator();
        while (iterator.hasNext()) {
            Preference preference = (Preference)iterator.next();
            if (preference.getName().equals(name)) {
                super.remove(preference);
                return preference;
            }
        }
        return null;
View Full Code Here

    public Preference get(String name)
    {
        Iterator iterator = this.iterator();
        while (iterator.hasNext()) {
            Preference preference = (Preference)iterator.next();
            if (preference.getName().equals(name)) {
                return preference;
            }
        }
        return null;
    }
View Full Code Here

    public Preference remove(String name)
    {
        Iterator iterator = this.iterator();
        while (iterator.hasNext()) {
            Preference preference = (Preference)iterator.next();
            if (preference.getName().equals(name)) {
                super.remove(preference);
                return preference;
            }
        }
        return null;
View Full Code Here

    static public HashMap createPreferenceMap(Collection preferences)
    {
        HashMap returnValue = new HashMap();
        Iterator iterator = preferences.iterator();
        while (iterator.hasNext()) {
            Preference preference = (Preference)iterator.next();           
            returnValue.put(preference.getName(), preference.getValues());
        }
        return returnValue;
    }
View Full Code Here

              log.error(e,e);
              preferences = null;
          }
          if (preferences != null){
            for (Iterator prefItr = preferences.iterator(); prefItr.hasNext();) {
                Preference pref = (Preference)prefItr.next();
 
                String name = pref.getName();
                String value = "";
                String override;
 
                if (pref.isReadOnly()) {
                    override = "N";
                }
                else {
                    override = "Y";
                }
 
                //Since publish params only support single valued params just look for the first value.
                Iterator valuesItr = pref.getValues();
                if (valuesItr.hasNext())
                    value = (String)valuesItr.next();
 
                channelDef.addParameter(CPortletAdapter.portletPreferenceNamePrefix + name, value, override);
            }
View Full Code Here

                deletePrefNamesPstmt.executeUpdate();
               
                //Loop through the prefs, inserting each name then the values
                for (Iterator prefItr = prefs.iterator(); prefItr.hasNext();) {
                   
                    final Preference pref = (Preference)prefItr.next();
                    int prefId = -1;
                   
                    insertPrefNamePstmt.setInt(1, chanId);
                    insertPrefNamePstmt.setString(2, pref.getName());
                   
                    if (pref.isReadOnly()) {
                        insertPrefNamePstmt.setString(3, READ_ONLY_TRUE);
                    } else {
                        insertPrefNamePstmt.setString(3, READ_ONLY_FALSE);
                    }
                   
                    //Use the list of removed ids to re-use IDs before generating new ones
                    if (prefIds.size() > 0) {
                        prefId = ((Integer)prefIds.removeLast()).intValue();
                    } else {
                        final ICounterStore counterStore = CounterStoreFactory.getCounterStoreImpl();
                        prefId = counterStore.getIncrementIntegerId(UP_PORTLET_PREFERENCE_VALUE);
                    }
                   
                    insertPrefNamePstmt.setInt(4, prefId);
                   
                    //Insert the name row
                    if (log.isDebugEnabled())
                        log.debug("RDBMPortletPreferencesStore::setDefinitionPreferences(): " + insertPrefName);
                    insertPrefNamePstmt.executeUpdate();
                   
                    //For each value a row will be inserted in the values table
                    for (final Iterator valueItr = pref.getValues(); valueItr.hasNext();) {
                        String value = (String)valueItr.next();
                       
                        if (log.isDebugEnabled())
                            log.debug("RDBMPortletPreferencesStore::setDefinitionPreferences(): " + insertPrefValue);
                        insertPrefValuePstmt.setInt(1, prefId);
View Full Code Here

TOP

Related Classes of org.apache.pluto.om.common.Preference

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.