Package org.jasig.portal.portlet.om

Examples of org.jasig.portal.portlet.om.IPortletPreference


            return true;
        }
        if (!(object instanceof IPortletPreference)) {
            return false;
        }
        IPortletPreference rhs = (IPortletPreference) object;
        return new EqualsBuilder()
            .append(this.name, rhs.getName())
            .append(this.readOnly, rhs.isReadOnly())
            .append(this.getValues(), rhs.getValues())
            .isEquals();
    }
View Full Code Here


            for (final IPortletPreference preference : newPreferences) {
                final String name = preference.getName();

                //Remove the existing preference from the map since it is supposed to be persisted
                final IPortletPreference existingPreference = oldPreferences.remove(name);
                if (existingPreference == null) {
                    //New preference, add it to the list
                    this.portletPreferences.add(preference);
                }
                else {
                    //Existing preference, update the fields
                    existingPreference.setValues(preference.getValues());
                    existingPreference.setReadOnly(preference.isReadOnly());
                    this.portletPreferences.add(existingPreference);
                }
            }
        }
    }
View Full Code Here

            if (name == null) {
                continue;
            }

            //Convert to a uPortal preference class to ensure quality check and persistence works
            final IPortletPreference preference = new PortletPreferenceImpl(internalPreference);
           
            //If the preference exactly equals a descriptor or definition preference ignore it
            final InternalPortletPreference basePreference = basePreferences.get(name);
            if (preference.equals(basePreference)) {
                continue;
            }
           
            //New preference, add it to the list
            preferencesList.add(preference);
View Full Code Here

       
        final PortletPreferencesDD descriptorPreferences = portletDescriptor.getPortletPreferences();
        if (descriptorPreferences != null) {
            final List<PortletPreferenceDD> descriptorPreferencesList = descriptorPreferences.getPortletPreferences();
            for (final PortletPreferenceDD descriptorPreference : descriptorPreferencesList) {
                final IPortletPreference internaldescriptorPreference = new PortletPreferenceImpl(descriptorPreference);
                preferences.add(internaldescriptorPreference);
            }
        }
       
        return preferences;
View Full Code Here

        final List<IPortletPreference> portletPreferencesList = new ArrayList<IPortletPreference>(preferencesMap.size());
        for (final Entry<String, List<String>> prefEntry : preferencesMap.entrySet()) {
            final String prefName = prefEntry.getKey();
            final List<String> prefValues = prefEntry.getValue();
           
            final IPortletPreference portletPreference = new PortletPreferenceImpl(prefName, false, prefValues.toArray(new String[prefValues.size()]));
            portletPreferencesList.add(portletPreference);
        }
       
        //Persist the changes.
        final IPortletPreferences portletPreferences = portletEntity.getPortletPreferences();
View Full Code Here

        portletPreferences.setValue("key", null);
        portletPreferences.store();
       
        assertEquals(1, this.storedPrefs.size());
       
        final IPortletPreference pref = this.storedPrefs.get("key");
        assertNotNull(pref);
        assertEquals("key", pref.getName());
        assertArrayEquals(new String[] { null }, pref.getValues());
        assertFalse(pref.isReadOnly());
    }
View Full Code Here

        portletPreferences.setValues("key", null);
        portletPreferences.store();
       
        assertEquals(1, this.storedPrefs.size());
       
        final IPortletPreference pref = this.storedPrefs.get("key");
        assertNotNull(pref);
        assertEquals("key", pref.getName());
        assertNull(pref.getValues());
        assertFalse(pref.isReadOnly());
    }
View Full Code Here

        portletPreferences.setValues("key", new String[] { null });
        portletPreferences.store();
       
        assertEquals(1, this.storedPrefs.size());
       
        final IPortletPreference pref = this.storedPrefs.get("key");
        assertNotNull(pref);
        assertEquals("key", pref.getName());
        assertArrayEquals(new String[] { null }, pref.getValues());
        assertFalse(pref.isReadOnly());
    }
View Full Code Here

        //Actually "store" the stored prefs
        this.targetPrefs = new LinkedHashMap<String, IPortletPreference>(this.storedPrefs);
       
        assertEquals(1, this.storedPrefs.size());
       
        IPortletPreference pref = this.storedPrefs.get("key");
        assertNotNull(pref);
        assertEquals("key", pref.getName());
        assertArrayEquals(new String[] { "modified" }, pref.getValues());
        assertFalse(pref.isReadOnly());
       
       
        //Set the default value
        portletPreferences.setValues("key", new String[] { "default" });
       
View Full Code Here

        //Actually "store" the stored prefs
        this.targetPrefs = new LinkedHashMap<String, IPortletPreference>(this.storedPrefs);
       
        assertEquals(1, this.storedPrefs.size());
       
        IPortletPreference pref = this.storedPrefs.get("key");
        assertNotNull(pref);
        assertEquals("key", pref.getName());
        assertArrayEquals(new String[] { "modified" }, pref.getValues());
        assertFalse(pref.isReadOnly());
       

        //Set a modified value
        portletPreferences.setValues("key", null);
       
        //Initial store, check that correct stored map is created
        portletPreferences.store();
       
        //Actually "store" the stored prefs
        this.targetPrefs = new LinkedHashMap<String, IPortletPreference>(this.storedPrefs);
       
        assertEquals(1, this.storedPrefs.size());
       
        pref = this.storedPrefs.get("key");
        assertNotNull(pref);
        assertEquals("key", pref.getName());
        assertArrayEquals(null, pref.getValues());
        assertFalse(pref.isReadOnly());
    }
View Full Code Here

TOP

Related Classes of org.jasig.portal.portlet.om.IPortletPreference

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.