Search in sources :

Example 6 with Step

use of org.apereo.portal.portletpublishing.xml.Step in project uPortal by Jasig.

the class PortletAdministrationHelper method getArbitraryPortletPreferenceNames.

/**
 * Get a list of the key names of the currently-set arbitrary portlet preferences.
 *
 * @param form
 * @return
 */
public Set<String> getArbitraryPortletPreferenceNames(PortletDefinitionForm form) {
    // set default values for all portlet parameters
    PortletPublishingDefinition cpd = this.portletPublishingDefinitionDao.getChannelPublishingDefinition(form.getTypeId());
    Set<String> currentPrefs = new HashSet<>();
    currentPrefs.addAll(form.getPortletPreferences().keySet());
    for (Step step : cpd.getSteps()) {
        if (step.getPreferences() != null) {
            for (Preference pref : step.getPreferences()) {
                currentPrefs.remove(pref.getName());
            }
        }
    }
    return currentPrefs;
}
Also used : Preference(org.apereo.portal.portletpublishing.xml.Preference) IPortletPreference(org.apereo.portal.portlet.om.IPortletPreference) PortletPublishingDefinition(org.apereo.portal.portletpublishing.xml.PortletPublishingDefinition) Step(org.apereo.portal.portletpublishing.xml.Step) HashSet(java.util.HashSet)

Aggregations

Step (org.apereo.portal.portletpublishing.xml.Step)6 PortletPublishingDefinition (org.apereo.portal.portletpublishing.xml.PortletPublishingDefinition)5 IPortletPreference (org.apereo.portal.portlet.om.IPortletPreference)3 Preference (org.apereo.portal.portletpublishing.xml.Preference)3 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 MultiValuedPreferenceInputType (org.apereo.portal.portletpublishing.xml.MultiValuedPreferenceInputType)2 Parameter (org.apereo.portal.portletpublishing.xml.Parameter)2 ParameterInputType (org.apereo.portal.portletpublishing.xml.ParameterInputType)2 PreferenceInputType (org.apereo.portal.portletpublishing.xml.PreferenceInputType)2 SingleValuedPreferenceInputType (org.apereo.portal.portletpublishing.xml.SingleValuedPreferenceInputType)2 Attribute (org.apereo.portal.portlets.Attribute)2 BooleanAttribute (org.apereo.portal.portlets.BooleanAttribute)2 StringListAttribute (org.apereo.portal.portlets.StringListAttribute)2 PortletDescriptor (org.apereo.portal.xml.PortletDescriptor)2 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 MissingResourceException (java.util.MissingResourceException)1