@Override public String getInitParameter(String name) { return wrapped.getInitParameter(name); }
.hasMoreElements();) { final String name = e.nextElement(); initParameters.setProperty(name, config.getInitParameter(name));
/** * Returns a String containing the value of the named initialization * parameter, or null if the parameter does not exist. * * @param name * a <code>String</code> specifying the name of the * initialization parameter * * @return a <code>String</code> containing the value of the * initialization parameter * * @exception java.lang.IllegalArgumentException * if name is <code>null</code>. */ public String getInitParameter(java.lang.String name) { if (config == null) throw new java.lang.IllegalStateException( "Config is null, please ensure that your init(config) method calls super.init(config)"); return config.getInitParameter(name); }
@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 String getJspPath(HttpServletRequest request) { PortletConfig selPortletConfig = getSelPortletConfig(request); String configTemplate = selPortletConfig.getInitParameter( "config-template"); if (Validator.isNotNull(configTemplate)) { return configTemplate; } String configJSP = selPortletConfig.getInitParameter("config-jsp"); if (Validator.isNotNull(configJSP)) { return configJSP; } return "/configuration.jsp"; }
protected void addSuccessMessage( ActionRequest actionRequest, ActionResponse actionResponse) { PortletConfig portletConfig = (PortletConfig)actionRequest.getAttribute( JavaConstants.JAVAX_PORTLET_CONFIG); boolean addProcessActionSuccessMessage = GetterUtil.getBoolean( portletConfig.getInitParameter("add-process-action-success-action"), true); if (!addProcessActionSuccessMessage) { return; } String successMessage = ParamUtil.getString( actionRequest, "successMessage"); SessionMessages.add(actionRequest, "requestProcessed", successMessage); }
@Override public String getProperty(String name) { return this.source.getInitParameter(name); } }
InitParameterState(PortletConfig config) { this.useLanguage = getBooleanFromParameter(config.getInitParameter("useLanguage")); this.useFileSystem = getBooleanFromParameter(config.getInitParameter("useFilesystem")); this.folder = config.getInitParameter("folder"); if (this.folder == null) this.folder = ""; String portalParam = config.getInitParameter("portalParam"); if (portalParam == null) this.portalParam = defaultPortalParam; } }
@Override public String getInitParameter(String name) { String initParameter = portletConfig.getInitParameter(name); if (initParameter == null) { initParameter = portletContext.getInitParameter(name); } return initParameter; }
protected String getLifecycleId() { String lifecycleId = getPortletConfig().getInitParameter(FacesServlet.LIFECYCLE_ID_ATTR); return lifecycleId != null ? lifecycleId : LifecycleFactory.DEFAULT_LIFECYCLE; }
public void init() throws PortletException { _defpage = getPortletConfig().getInitParameter(ATTR_PAGE); try { Class.forName("javax.portlet.ResourceURL"); } catch (ClassNotFoundException e) { isJSR286 = false; } }
/** * Returns a String defining the default render kit id the bridge should ensure for this portlet. If non-null, this value is * used to override any default render kit id set on an app wide basis in the faces-config.xml. This default implementation * reads the values from the portlet init_param javax.portlet.faces.defaultRenderKitId. If not present, null is returned. * * @return a boolean indicating whether or not the bridge should preserve all the action parameters in the subsequent * renders that occur in the same scope. */ public String getDefaultRenderKitId() { return getPortletConfig().getInitParameter(Bridge.BRIDGE_PACKAGE_PREFIX + Bridge.DEFAULT_RENDERKIT_ID); }
/** * Initialize portlet configuration. */ public void init(PortletConfig config) throws PortletException { super.init(config); defaultProxyHost = StringUtils.trim(config.getInitParameter("PROXYHOST")); defaultProxyPort = NumberUtils.toInt(config.getInitParameter("PROXYPORT"), -1); }
@Override public void init(PortletConfig portletConfig) throws PortletException { beanLocation = portletConfig.getInitParameter("beanLocation"); if (beanLocation == null || "".equals(beanLocation.trim())) { throw new RuntimeException("Portlet init param 'beanLocation' must be specified."); } super.init(portletConfig); }
@Override public String getInitParameter(String name) { String initParameter = portletConfig.getInitParameter(name); if (initParameter == null) { initParameter = portletContext.getInitParameter(name); } return initParameter; }
/** * Returns the flag whether or not only the inner elements should be selected by the XPath expression. * @return */ protected boolean isInnerElementsOnly() { String param = getPortletConfig().getInitParameter(INNER_ELEMENTS_ONLY_PARAM_NAME); if (StringUtils.isBlank(param)) { return DEFAULT_INNER_ELEMENTS_ONLY_VALUE; } else { return BooleanUtils.toBoolean(param); } }
protected void setDefaultView() throws UnavailableException { this.defaultView = getPortletConfig().getInitParameter(DEFAULT_VIEW); if (defaultView == null) { String msg = "Fatal: must specify a JSF view id as the default view in portlet.xml"; throw new UnavailableException(msg); } }
@Override public void init(PortletConfig portletConfig) throws PortletException { super.init(portletConfig); Map<String, String> config = new TreeMap<String, String>(); for (String paramName : FastCGIHandlerFactory.PARAM_NAMES) { String value = portletConfig.getInitParameter(paramName); if (value != null) { config.put(paramName, getInitParameter(paramName)); } } handler = FastCGIHandlerFactory.create(config); }
protected void initializeContainer(PortletConfig portletConfig) { String configPath = portletConfig.getInitParameter(CONFIG_PATH_KEY); PortletExtendedSingletonS2ContainerInitializer initializer = new PortletExtendedSingletonS2ContainerInitializer(); initializer.setConfigPath(configPath); initializer.setApplication(portletConfig.getPortletContext()); initializer.initialize(); }
/** * Save the prefs */ public void processAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException { processPreferencesAction(request, actionResponse); String url = request.getPreferences().getValue("url", "http://www.npr.org/rss/rss.php?topicId=4"); String stylesheet = getPortletConfig().getInitParameter("stylesheet"); String key = cache.constructKey(url, stylesheet); // TODO: use the entire parameter list cache.remove(key); }