Refine search
@Override public String getInitParameter(String name) { return wrapped.getInitParameter(name); }
/** * Default resource serving. * <p> * The default implementation of this method does nothing. * <p> * However, if the reserved portlet initialization parameter * {@link #AUTOMATIC_RESOURCE_DISPATCH} * (= "javax.portlet.automaticResourceDispatching") * is set to <code>true</code>, the default * implementation will perform a * <code>PortletRequestDispatcher.forward</code> to the location designated by * the ResourceID of the ResourceRequest. * If no ResourceID is set on the resource URL the default implementation * does nothing. * * @since 2.0 */ public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException { String autofwd = getInitParameter(AUTOMATIC_RESOURCE_DISPATCH); if (autofwd != null && autofwd.equalsIgnoreCase("true")) { if (request.getResourceID() != null) { PortletRequestDispatcher rd = getPortletConfig().getPortletContext().getRequestDispatcher( request.getResourceID()); if (rd != null) rd.forward(request, response); } } }
@Override public String getPortletName() { return wrapped.getPortletName(); }
final PortletContext context = config.getPortletContext(); for (final Enumeration<String> e = context.getInitParameterNames(); e .hasMoreElements();) { final String name = e.nextElement(); initParameters.setProperty(name, context.getInitParameter(name)); for (final Enumeration<String> e = config.getInitParameterNames(); e .hasMoreElements();) { final String name = e.nextElement(); initParameters.setProperty(name, config.getInitParameter(name));
@Override @SuppressWarnings("unchecked") public Map<String, String> getDefaultViewIdMap() { if (defaultViewIdMap == null) { String portletName = portletConfig.getPortletName(); String attrNameDefaultViewIdMap = Bridge.BRIDGE_PACKAGE_PREFIX + portletName + "." + Bridge.DEFAULT_VIEWID_MAP; defaultViewIdMap = (Map<String, String>) portletConfig.getPortletContext().getAttribute( attrNameDefaultViewIdMap); } return defaultViewIdMap; }
@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"); } }
@Override public ServletConfig getServletConfig( PortletConfig portletConfig, PortletRequest portletRequest) { PortletContext portletContext = portletConfig.getPortletContext(); Object servletConfig = portletContext.getAttribute( _PORTLET_CONTAINER_SERVLET_CONFIG); if (servletConfig == null) { servletConfig = portletRequest.getAttribute( PortletServlet.PORTLET_SERVLET_CONFIG); } return (ServletConfig)servletConfig; }
protected String getNamespaceWSRP(BridgeContext bridgeContext) { if (namespaceWSRP == null) { PortletConfig portletConfig = bridgeContext.getPortletConfig(); String portletName = portletConfig.getPortletName(); PortletContext portletContext = bridgeContext.getPortletContext(); String portletContextName = portletContext.getPortletContextName(); namespaceWSRP = portletName + portletContextName; } return namespaceWSRP; } }
@Override public PortletContext getPortletContext() { return wrapped.getPortletContext(); }
@Override public String getInitParameter(String name) { String initParameter = portletConfig.getInitParameter(name); if (initParameter == null) { initParameter = portletContext.getInitParameter(name); } return initParameter; }
private static String getLoaderTagId(String portletId, PortletConfig config) { return ("vaadinLoader_" + config.getPortletName() + "_" + config.getPortletContext().getPortletContextName() + "_" + portletId.replace("-","")) .replaceAll("[^\\w-]","_"); } }
@Override public String getDefaultRenderKitId() { if (defaultRenderKitId == null) { String attributeName = Bridge.BRIDGE_PACKAGE_PREFIX + portletConfig.getPortletName() + "." + Bridge.DEFAULT_RENDERKIT_ID; defaultRenderKitId = (String) portletContext.getAttribute(attributeName); } return defaultRenderKitId; }
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(); }
@Override public Enumeration<String> getInitParameterNames() { return wrapped.getInitParameterNames(); }
@Override public ResourceBundle getResourceBundle(Locale locale) { return wrapped.getResourceBundle(locale); }
@Override public Map<String, String[]> getContainerRuntimeOptions() { return wrapped.getContainerRuntimeOptions(); }
private int getPortletMajorVersion() { PortletConfig portletConfig = responseContext.getPortletConfig(); PortletContext portletContext = portletConfig.getPortletContext(); return portletContext.getEffectiveMajorVersion(); }
/** * 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; }
@Override @SuppressWarnings("unchecked") public Map<String, String> getDefaultViewIdMap() { if (defaultViewIdMap == null) { String portletName = portletConfig.getPortletName(); String attrNameDefaultViewIdMap = Bridge.BRIDGE_PACKAGE_PREFIX + portletName + "." + Bridge.DEFAULT_VIEWID_MAP; defaultViewIdMap = (Map<String, String>) portletConfig.getPortletContext().getAttribute( attrNameDefaultViewIdMap); } return defaultViewIdMap; }
/** * @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; }