Package org.apache.jetspeed.om.portlet

Examples of org.apache.jetspeed.om.portlet.Preference


        }
    }

    private boolean addPref(String prefName, String keywords, Preferences prefs)
    {
        Preference pref = prefs.getPortletPreference(prefName);
        if (pref == null)
        {
            pref = prefs.addPreference(prefName);
            pref.setReadOnly(false);
            pref.addValue(keywords);           
        }
        else
        {
            return modifyPref(prefName, keywords, prefs);          
        }       
View Full Code Here


        return true;
    }
   
    private boolean modifyPref(String prefName, String keywords, Preferences prefs)
    {
        Preference pref = prefs.getPortletPreference(prefName);
        if (pref == null)
        {
            return addPref(prefName, keywords, prefs);
        }
        else
        {
            List<String> values = pref.getValues();
            if (!values.get(0).equals(keywords))
            {
                values.set(0, keywords);
                return true;
            }
View Full Code Here

            {
                return false;               
            }
            if (val > max)
                return false;
            Preference pref = (Preference) prefs.getPortletPreference(prefName);
            List<String> values = pref.getValues();
            if(!values.get(0).equals(param))
            {
                values.set(0, param);
                return true;
            }                          
View Full Code Here

        }
    }

    private boolean addPref(String prefName, String keywords, PortletDefinition portlet)
    {
        Preference pref = portlet.getPortletPreferences().getPortletPreference(prefName);       
        if (pref == null)
        {
            portlet.getPortletPreferences().addPreference(prefName);
            pref = portlet.getPortletPreferences().getPortletPreference(prefName);
            pref.addValue(keywords);
        }
        else
        {
            return modifyPref(prefName, keywords, portlet);          
        }       
View Full Code Here

        return true;
    }
   
    private boolean modifyPref(String prefName, String keywords, PortletDefinition portlet)
    {
        Preference prefComp =  portlet.getPortletPreferences().getPortletPreference(prefName);
        List<String> values = prefComp.getValues();
        if(!values.get(0).equals(keywords))
        {
            values.set(0, keywords);
            return true;
        }
View Full Code Here

            {
                return false;               
            }
            if (val > max)
                return false;
            Preference pref = (Preference) portlet.getPortletPreferences().getPortletPreference(prefName);
            List<String> values = pref.getValues();
            if(!values.get(0).equals(param))
            {
                values.set(0, param);
                return true;
            }                          
View Full Code Here

        InitParam initParam = portlet.addInitParam("testparam");
        initParam.setParamValue("test value");
        initParam.addDescription(lang).setDescription("This is a test portlet parameter");
       
        Preferences prefs = portlet.getPortletPreferences();
        Preference pref = prefs.addPreference("pref1");
        pref.addValue("1");

        registry.registerPortletApplication(app);
    }
View Full Code Here

    List<Preference> preferences = new LinkedList<Preference>();
    String preferencesValidator;
   
    public Preference addPreference(String name)
    {
        Preference preference = new PreferenceImpl(name);
        preferences.add(preference);
        return preference;
    }
View Full Code Here

        InitParam initParam = portlet.addInitParam("testparam");
        initParam.setParamValue("test value");
        initParam.addDescription(lang).setDescription("This is a test portlet parameter");

        Preferences prefs = portlet.getPortletPreferences();
        Preference pref = prefs.addPreference("preference 1");
        pref.addValue("value 1");
        pref.addValue("value 2");

        Language language = portlet.addLanguage(Locale.getDefault());
        language.setTitle("Portlet 1");
        language.setShortTitle("Portlet 1");
View Full Code Here

        initParam.addDescription(lang).setDescription("This is a test portlet parameter");

        addDublinCore(portlet.getMetadata());

        Preferences prefs = portlet.getPortletPreferences();
        Preference pref = prefs.addPreference("preference 1");
        pref.addValue("value 1");
        pref.addValue("value 2");
       
        Language language = portlet.addLanguage(Locale.getDefault());
        language.setTitle("Portlet 1");
        language.setShortTitle("Portlet 1");
       
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.portlet.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.