Package org.apache.jetspeed.om.portlet

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


            String cats = request.getParameter("jsCats");
            String page = request.getParameter(JSPAGE);
            PortletApplication pa = registry.getPortletApplication("j2-admin");
            String portletName = this.getPortletName();
            PortletDefinition portlet = (PortletDefinition) pa.getPortlet(portletName);
            Preferences prefs = portlet.getPortletPreferences();
            boolean updated = updateNumericPref("Columns", columns, 10, prefs);
            updated = updated | updateNumericPref("Rows", rows, 100, prefs);
                       
            // process removes first
            if (!isEmpty(removes))
View Full Code Here


        if (PortletDefinitionImpl.portletPreferencesProvider == null)
        {
            return new PreferencesImpl();           
        }
        Map<String, PortletPreference> prefMap = PortletDefinitionImpl.portletPreferencesProvider.retrieveDefaultPreferences(this);       
        Preferences preferences = new PreferencesImpl();
        List<Preference> list = preferences.getPortletPreferences();
        for (PortletPreference pref : prefMap.values())
        {
            Preference p = preferences.addPreference(pref.getName());
            p.setReadOnly(pref.isReadOnly());
            for (String s : pref.getValues())
            {
                p.addValue(s);
            }
View Full Code Here

    /**
     * Jetspeed: PortletPreferencesProvider
     */   
    public void storeDefaults(org.apache.jetspeed.om.portlet.PortletDefinition pd, Preferences newprefs)
    {
        Preferences preferences = (newprefs == null) ? pd.getDescriptorPreferences() : newprefs;
        JetspeedPreferencesMap map = new JetspeedPreferencesMap();
        for (Preference preference : preferences.getPortletPreferences())
        {
            map.put(preference.getName(), new JetspeedPreferenceImpl(preference.getName(), preference.getValues().toArray(new String[preference.getValues().size()]), preference.isReadOnly()));
        }
        this.storePortletPreference(pd, null, null, map);
    }
View Full Code Here

           
            for (Map.Entry<String, List<String>> entry : clonePortletInfo.getPortletPreferences().entrySet())
            {
                String prefName = entry.getKey();
                List<String> prefValues = entry.getValue();
                Preferences prefs = clone.getPortletPreferences();
                Preference pref = prefs.getPortletPreference(prefName);
               
                if (pref == null)
                {
                    pref = prefs.addPreference(prefName);
                }
               
                List<String> values = pref.getValues();
                values.clear();
                values.addAll(prefValues);
View Full Code Here

            String cats = request.getParameter("jsCats");
            String page = request.getParameter(JSPAGE);
            PortletApplication pa = registry.getPortletApplication("j2-admin");
            String portletName = this.getPortletName();
            PortletDefinition portlet = (PortletDefinition) PortletApplicationUtils.getPortletOrClone(pa, portletName);
            Preferences prefs = portlet.getPortletPreferences();
            boolean updated = updateNumericPref("Columns", columns, 10, prefs);
            updated = updated | updateNumericPref("Rows", rows, 100, prefs);
                       
            // process removes first
            if (!isEmpty(removes))
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

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

        initParam.setParamValue("test value");
        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");
View Full Code Here

        initParam.setParamValue("test value");
        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");
View Full Code Here

        if (PortletDefinitionImpl.portletPreferencesProvider == null)
        {
            return new PreferencesImpl();           
        }
        Map<String, PortletPreference> prefMap = PortletDefinitionImpl.portletPreferencesProvider.retrieveDefaultPreferences(this);       
        Preferences preferences = new PreferencesImpl();
        List<Preference> list = preferences.getPortletPreferences();
        for (PortletPreference pref : prefMap.values())
        {
            Preference p = preferences.addPreference(pref.getName());
            p.setReadOnly(pref.isReadOnly());
            for (String s : pref.getValues())
            {
                p.addValue(s);
            }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.portlet.Preferences

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.