@Override public Enumeration<String> getInitParameterNames() { return wrapped.getInitParameterNames(); }
/** * Returns the names of the portlet initialization parameters as an * Enumeration of String objects, or an empty Enumeration if the portlet has * no initialization parameters. * * @return an <code>Enumeration</code> of <code>String</code> objects * containing the names of the portlet initialization parameters, or * an empty Enumeration if the portlet has no initialization * parameters. */ public java.util.Enumeration<String> getInitParameterNames() { if (config == null) throw new java.lang.IllegalStateException( "Config is null, please ensure that your init(config) method calls super.init(config)"); return config.getInitParameterNames(); }
for (final Enumeration<String> e = config.getInitParameterNames(); e .hasMoreElements();) { final String name = e.nextElement();
@Override public Enumeration<String> getInitParameterNames() { return wrappedPortletConfig.getInitParameterNames(); }
public Enumeration<String> getInitParameterNames() { return wrappedPortletConfig.getInitParameterNames(); }
/** * Returns the names of the portlet initialization parameters as an * Enumeration of String objects, or an empty Enumeration if the * portlet has no initialization parameters. * * @return an <code>Enumeration</code> of <code>String</code> * objects containing the names of the portlet * initialization parameters, or an empty Enumeration if the * portlet has no initialization parameters. */ public java.util.Enumeration getInitParameterNames() { return config.getInitParameterNames(); } }
/** * Returns the names of the portlet initialization parameters as an * Enumeration of String objects, or an empty Enumeration if the portlet has * no initialization parameters. * * @return an <code>Enumeration</code> of <code>String</code> objects * containing the names of the portlet initialization parameters, or * an empty Enumeration if the portlet has no initialization * parameters. */ public java.util.Enumeration<String> getInitParameterNames() { if (config == null) throw new java.lang.IllegalStateException( "Config is null, please ensure that your init(config) method calls super.init(config)"); return config.getInitParameterNames(); }
public Enumeration<String> getInitParameterNames() { return getWrapped().getInitParameterNames(); }
@Override public void init(PortletConfig config) throws PortletException { System.out.println("~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ init"); super.init(config); Enumeration<String> parameterNames = config.getInitParameterNames(); while(parameterNames.hasMoreElements()) { String name = parameterNames.nextElement(); System.out.println("Parameter: " + name + " = " + config.getInitParameter(name)); } System.out.println("~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ /init"); } }
public Enumeration<String> getInitParameterNames() { return getWrapped().getInitParameterNames(); }
@Override public String[] getPropertyNames() { return CollectionUtils.toArray(this.source.getInitParameterNames(), EMPTY_NAMES_ARRAY); }
@Override public String[] getPropertyNames() { return StringUtils.toStringArray(this.source.getInitParameterNames()); }
/** * Producer method for the portlet config. */ @Produces @PortletRequestScoped @Named("portletConfig") public static PortletConfig producePortletConfig() { PortletArtifactProducer pap = producers.get(); assert pap != null; if (isTrace) { StringBuilder txt = new StringBuilder(80); txt.append(" ThreadId=").append(Thread.currentThread().getId()); txt.append(", Portlet name: ").append(pap.config.getPortletName()); txt.append(", Init param names: ").append(Collections.list(pap.config.getInitParameterNames()).toString()); LOG.trace(txt.toString()); } return pap.config; }
/** * @return */ private Map<String, String> calculateDefaultViewIdMap() { Map<String, String> viewIdMap = new HashMap<String, String>(); PortletConfig portletConfig = getPortletConfig(); Enumeration<String> configNames = portletConfig.getInitParameterNames(); while (configNames.hasMoreElements()) { String name = configNames.nextElement(); if (name.startsWith(DEFAULT_VIEWID)) { // Put viewId with mode name as key. viewIdMap.put(name.substring(DEFAULT_VIEW_ID_LENGTH), portletConfig.getInitParameter(name).trim()); } } return viewIdMap; }
/** * Returns the names of the portlet initialization parameters as an * <code>Enumeration</code> of String objects, or an empty * <code>Enumeration</code> if the portlet has no initialization * parameters. * * @return an <code>Enumeration</code> of <code>String</code> objects * containing the names of the portlet initialization parameters, or * an empty <code>Enumeration</code> if the portlet has no * initialization parameters. */ public static java.util.Enumeration getInitParameterNames() { PortletConfig portletConfig = getPortletConfig(); if (portletConfig == null) { throw new IllegalStateException("Cannot retrieve PortletConfig."); } return portletConfig.getInitParameterNames(); } }
public Map<String, String> getDefaultViewIdMap() { if (defaultViewIdMap == null) { // TCK TestPage015: portletInitializationParametersTest defaultViewIdMap = new HashMap<String, String>(); Enumeration<String> initParameterNames = getPortletConfig().getInitParameterNames(); if (initParameterNames != null) { int defaultViewIdLength = DEFAULT_VIEWID.length(); int portletModeIndex = defaultViewIdLength + 1; while (initParameterNames.hasMoreElements()) { String initParameterName = initParameterNames.nextElement(); if ((initParameterName != null) && initParameterName.startsWith(DEFAULT_VIEWID) && (initParameterName.length() > defaultViewIdLength)) { String initParameterValue = getPortletConfig().getInitParameter(initParameterName); String portletMode = initParameterName.substring(portletModeIndex); defaultViewIdMap.put(portletMode, initParameterValue); } } } } return defaultViewIdMap; }
Enumeration<String> e = config.getInitParameterNames(); int len = DEFAULT_VIEWID.length(); while (e.hasMoreElements())
public void init(PortletConfig config) throws PortletException { super.init(config); // load stylesheets available stylesheets = new HashMap(); Enumeration e = this.getPortletConfig().getInitParameterNames(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); String base = "text/html"; if (name.startsWith("stylesheet")) { int idx = -1; if ((idx = name.indexOf(".")) > -1) { base = name.substring(idx + 1, name.length()); } stylesheets.put(base, getPortletConfig().getInitParameter(name)); } } }
public Enumeration getInitParameterNames() { try { return getGenericPortlet().getInitParameterNames(); } catch (PortletException e) { logger.warn(e); return config.getInitParameterNames(); } }
/** * Create new PortletConfigPropertyValues. * @param config PortletConfig we'll use to take PropertyValues from * @param requiredProperties set of property names we need, where * we can't accept default values * @throws PortletException if any required properties are missing */ private PortletConfigPropertyValues(PortletConfig config, Set<String> requiredProperties) throws PortletException { Set<String> missingProps = (requiredProperties != null && !requiredProperties.isEmpty()) ? new HashSet<String>(requiredProperties) : null; Enumeration<String> en = config.getInitParameterNames(); while (en.hasMoreElements()) { String property = en.nextElement(); Object value = config.getInitParameter(property); addPropertyValue(new PropertyValue(property, value)); if (missingProps != null) { missingProps.remove(property); } } // fail if we are still missing properties if (missingProps != null && missingProps.size() > 0) { throw new PortletException( "Initialization from PortletConfig for portlet '" + config.getPortletName() + "' failed; the following required properties were missing: " + StringUtils.collectionToDelimitedString(missingProps, ", ")); } } }