@Override public Collection<String> getModifiedKeys() { Set<String> keys = new HashSet<>(); Enumeration<String> names = _portletPreferences.getNames(); while (names.hasMoreElements()) { keys.add(names.nextElement()); } return keys; }
@Override protected Enumeration<String> getPropertyNames() { return portletPreferences.getNames(); } }
@Override protected Enumeration<String> getPropertyNames() { return portletPreferences.getNames(); } }
public Iterator<String> iterator() { return new PreferenceValueIterator(portletPreferences.getNames()); }
public Iterator<String> iterator() { return new PreferenceValueIterator(portletPreferences.getNames()); }
/** * Returns all of the keys that have an associated value, or an empty * <code>Enumeration</code> if no keys are available. * * @return an Enumeration of the keys that have an associated value, or an * empty <code>Enumeration</code> if no keys are available. */ public static java.util.Enumeration getNames() { PortletPreferences prefs = getPortletPreferences(); if (prefs == null) { throw new IllegalStateException( "Cannot retrieve PortletPreferences."); } return prefs.getNames(); }
private Map<String, List<String>> getPreferences(PortletRequest req) { Map<String, List<String>> rslt = new HashMap<String, List<String>>(); // default PortletPreferences prefs = req.getPreferences(); List<String> names = Collections.list(prefs.getNames()); for (String name : names) { if (!name.startsWith(CONTROLLER_PREFERENCE_PREFIX)) { // Pass it along in the model List<String> values = Arrays.asList(prefs.getValues(name, new String[] {})); rslt.put(name, values); } } logger.debug("Invoking with preferences={}", rslt); return rslt; }
private Map<String, Preference> getPreferenceMap(PortletPreferences prefs) { Map <String, Preference> m; // construct a Map of Preference objects for each preference Enumeration<String> e = prefs.getNames(); if (e.hasMoreElements()) { m = new HashMap<String, Preference>(); while (e.hasMoreElements()) { String name = e.nextElement(); m.put(name, new PreferenceImpl(prefs, name)); } } else { m = Collections.emptyMap(); } return m; }
private void pullDataFromPortletPreferences(final PortletPreferences prefs) { this.skinName = prefs.getValue( DynamicRespondrSkinConstants.PREF_SKIN_NAME, DynamicRespondrSkinConstants.DEFAULT_SKIN_NAME); this.variableNameToValueMap = new HashMap<>(); final Enumeration<String> prefNames = prefs.getNames(); while (prefNames.hasMoreElements()) { final String prefName = prefNames.nextElement(); if (prefName.startsWith(DynamicRespondrSkinConstants.CONFIGURABLE_PREFIX)) { final String nameWithoutPrefix = prefName.substring( DynamicRespondrSkinConstants.CONFIGURABLE_PREFIX.length()); final String value = prefs.getValue(prefName, ""); this.variableNameToValueMap.put(nameWithoutPrefix, value); } } }
/** * Create static data * @param req portlet request * @return channel runtime data */ protected ChannelStaticData getStaticData(PortletRequest req) { // retrieve channel subscribe parameters from preferences PortletPreferences prefrences=req.getPreferences(); Map channelParameters=new HashMap(); for(Enumeration e=prefrences.getNames();e.hasMoreElements();) { String parameterName=(String) e.nextElement(); if(!parameterName.startsWith(ADAPTER_PREFIX)) { channelParameters.put(parameterName,prefrences.getValue(parameterName,null)); } } ChannelStaticData staticData=new org.jasig.portal.portlets.channeladapter.ChannelStaticData(channelParameters); return staticData; }
/** Display a form to manage skin choices. */ @RenderMapping public String showConfigPage( RenderRequest request, PortletPreferences preferences, Model model) { // Add skin names SortedSet<String> skins = skinService.getSkinNames(request); model.addAttribute("skinNames", skins); // Get the list of preferences and add them to the model Enumeration<String> preferenceNames = preferences.getNames(); while (preferenceNames.hasMoreElements()) { String name = preferenceNames.nextElement(); if (name.startsWith(DynamicRespondrSkinConstants.CONFIGURABLE_PREFIX)) { model.addAttribute(name, preferences.getValue(name, "")); } } return "jsp/DynamicRespondrSkin/skinConfig"; } }
@SuppressWarnings("unchecked") private Map<String, String> getPreferencesValueMap(ExternalContext extCtx) { Map<String, String> m; PortletRequest portletRequest = (PortletRequest) extCtx.getRequest(); Enumeration<String> e = portletRequest.getPreferences().getNames(); if (e.hasMoreElements()) { m = new HashMap<String, String>(); while (e.hasMoreElements()) { String name = e.nextElement(); String value = portletRequest.getPreferences().getValue(name, null); if (value != null) { m.put(name, value); } } } else { m = Collections.emptyMap(); } return m; }
@ActionMapping(params = "action=update") public void updateSkinConfiguration( ActionRequest request, ActionResponse response, PortletPreferences prefs) throws IOException, ReadOnlyException, ValidatorException, PortletModeException { // Get the list of preferences and pull them from the request and store into preferences Enumeration<String> preferenceNames = prefs.getNames(); while (preferenceNames.hasMoreElements()) { String name = preferenceNames.nextElement(); if ("PREFdynamicSkinName".equals(name)) { SortedSet<String> skins = skinService.getSkinNames(request); String formValue = request.getParameter(name); if (skins.contains(formValue)) { log.debug("Skin name {} found", formValue); prefs.setValue(name, formValue != null ? formValue : ""); } else { log.warn("Skin name {} is not recognized", formValue); } } else if (name.startsWith(DynamicRespondrSkinConstants.CONFIGURABLE_PREFIX)) { String formValue = request.getParameter(name); prefs.setValue(name, formValue != null ? formValue : ""); } } prefs.store(); log.debug("Saved updated configuration"); response.setPortletMode(PortletMode.VIEW); }
"anyAssetType", StringPool.BLANK); Enumeration<String> enu = portletPreferences.getNames();
portletDataContext.getCompanyId(), portletId); Enumeration<String> enu = portletPreferences.getNames();
portletDataHandler.getDataPortletPreferences(); Enumeration<String> enu = jxPortletPreferences.getNames();