Package org.apache.pluto.om.common

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


     
      while (it.hasNext())
      {
        String key = (String)it.next();
        String value = (String)prefList.getMyMap().get(key);
        Preference p = preferenceSet.get(key);
        if ((p == null) || (overwrite))
        {
         
          Vector v = new Vector();
          v.add(value);
View Full Code Here


        assertNotNull(pd);

        assertNotNull(pd.getPreferenceSet());

        Preference pref1 = pd.getPreferenceSet().get("pref1");

        assertNotNull(pref1);

        Iterator itr = pref1.getValues();
        int count = 0;
        while (itr.hasNext())
        {
            count++;
            System.out.println("Value " + count + "=" + itr.next());
View Full Code Here

        // add global portlet definition defaults to prefs
        Iterator iterator = preferenceSet.iterator();
        while(iterator.hasNext())
        {
            Preference pref = (Preference) iterator.next();
            prefs.put(pref.getName(), pref);
        }       

        // add/override global portlet definition defaults
        // using more specific fragment preferences
        if (fragment != null && fragment.getPreferences() != null)
        {
            Iterator itr = fragment.getPreferences().iterator();       
            while(itr.hasNext())
            {
                Preference pref = (Preference) itr.next();
                prefs.put(pref.getName(), pref);
            }
        }
    }
View Full Code Here

        }
    }

    public Preference add(String arg0, List arg1)
    {       
        Preference pref = preferenceSet.add(arg0, arg1);
        prefs.put(arg0, pref);
        return pref;
    }
View Full Code Here

        preferenceSet.remove(pref);
    }

    public Preference remove(String name)
    {
        Preference pref = (Preference) prefs.remove(name);
        preferenceSet.remove(name);
        return pref;
    }
View Full Code Here

            HttpServletRequest request)
    {
        Locale locale = request.getLocale();
        String titleKey = createTitleKey(locale, false);

        Preference titlePref = window.getPortletEntity().getPreferenceSet()
                .get(titleKey);
        if (titlePref == null)
        {
            titleKey = createTitleKey(locale, true);
            titlePref = window.getPortletEntity().getPreferenceSet().get(
                    titleKey);
        }

        if (titlePref != null)
        {
            Iterator values = titlePref.getValues();
            if (values.hasNext())
            {
                return (String) titlePref.getValues().next();
            }
        }

        return null;
    }
View Full Code Here

        Fragment fragment = (Fragment) unmar.unmarshal(new InputSource(getClass().getClassLoader().getResourceAsStream(
                "fragment-test.xml")));
       
        assertNotNull(fragment);
        assertEquals(1, fragment.getPreferences().size());
        Preference pref = (Preference) fragment.getPreferences().get(0);
       
        assertEquals("Google", pref.getName());
        assertEquals(false, pref.isReadOnly());
        Iterator itr = pref.getValues();
        String value = (String )itr.next();
        assertEquals("http://www.google.com", value );

    }
View Full Code Here

     */
    public Preference get( String key )
    {
        try
        {
            Preference pref = null;
            if (prefsRootNode.nodeExists(key))
            {
                pref = new PrefsPreference(prefsRootNode.node(key), key);
            }
            else if(defaults != null)
View Full Code Here

        // add global portlet definition defaults to prefs
        Iterator iterator = preferenceSet.iterator();
        while(iterator.hasNext())
        {
            Preference pref = (Preference) iterator.next();
            prefs.put(pref.getName(), pref);
        }       

        // add/override global portlet definition defaults
        // using more specific fragment preferences
        if (fragment != null && fragment.getPreferences() != null)
        {
            Iterator itr = fragment.getPreferences().iterator();       
            while(itr.hasNext())
            {
                Preference pref = (Preference) itr.next();
                prefs.put(pref.getName(), pref);
            }
        }
    }
View Full Code Here

        }
    }

    public Preference add(String arg0, List arg1)
    {       
        Preference pref = preferenceSet.add(arg0, arg1);
        prefs.put(arg0, pref);
        return pref;
    }
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.