public Pipeline getPipeline( String pipelineName ) { return componentManager.lookupComponent(pipelineName); }
public JetspeedEngine(PortalConfiguration configuration, String applicationRoot, ServletConfig config, ComponentManager componentManager ) { this.componentManager = componentManager; this.context = new JetspeedPortalContext(this, configuration, applicationRoot); this.config = config; context.setApplicationRoot(applicationRoot); context.setConfiguration(configuration); defaultPipelineName = configuration.getString(PIPELINE_DEFAULT, "jetspeed-pipeline"); configuration.setString(JetspeedEngineConstants.APPLICATION_ROOT_KEY, applicationRoot); // Make these availble as beans to Spring componentManager.addComponent("Engine", this); componentManager.addComponent("PortalContext", context); componentManager.addComponent("PortalConfiguration", configuration); }
public void shutdown() throws JetspeedException { try { PortletContainer container = null; if (componentManager.containsComponent(PortletContainer.class)) { container = componentManager.lookupComponent(PortletContainer.class); } if (container != null) { container.destroy(); } componentManager.stop(); } catch (PortletContainerException e) { throw new JetspeedException(e); } System.gc(); }
componentManager.start(); pipelineMapper = componentManager.lookupComponent("pipeline-map"); componentManager.<PortletFactory>lookupComponent("portletFactory").setPortalContext(context); try statistics = componentManager.lookupComponent("PortalStatistics");
private InputStream getFile(String appName, String fileName) { ServletContext portalAppContext = ((ServletConfig) Jetspeed.getComponentManager().getComponent("ServletConfig")).getServletContext(); ServletContext portletAppContext = portalAppContext.getContext(appName); InputStream stream = null; if (portletAppContext != null) { stream = portletAppContext.getResourceAsStream(fileName); } else { stream = portalAppContext.getResourceAsStream(fileName); } return stream; }
protected RequestContextComponent getRequestContextComponent() { if (requestContextComponent == null) { requestContextComponent = Jetspeed.getComponentManager().lookupComponent("org.apache.jetspeed.request.RequestContextComponent"); } return requestContextComponent; }
protected PortletPreferencesProvider getPreferencesProvider() { try { return Jetspeed.getComponentManager().lookupComponent("org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider"); } catch (Exception e) { return null; } }
public Object getComponent(String name) { return Jetspeed.getComponentManager().lookupComponent(name); }
public void init() throws ServletException { super.init(); asm = Jetspeed.getComponentManager().lookupComponent(ApplicationServerManager.class); registry = Jetspeed.getComponentManager().lookupComponent(PortletRegistry.class); portletFactory = Jetspeed.getComponentManager().lookupComponent("portletFactory"); dm = Jetspeed.getComponentManager().lookupComponent("deploymentManager"); }
public static PortalConfiguration getConfiguration() { ComponentManager manager = getComponentManager(); if (manager != null) return manager.lookupComponent("PortalConfiguration"); return null; }
public JetspeedPrincipalManagerProvider getPrincipalManagerProvider() { if(jpmp==null) { jpmp= Jetspeed.getComponentManager().lookupComponent("org.apache.jetspeed.security.spi.JetspeedPrincipalManagerProvider"); } return jpmp; }
public Pipeline getPipelineById(String pipelineId) { ComponentManager componentManager = Jetspeed.getComponentManager(); if (componentManager == null) { return null; } return componentManager.lookupComponent(pipelineId); }
/** * Get infused or registered page manager instance managing this base element. * * @return page manager instance */ public PageManager getPageManager() { if (pageManager == null) { pageManager = Jetspeed.getComponentManager().lookupComponent("org.apache.jetspeed.page.PageManager"); } return pageManager; }
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession session = request.getSession(true); String destination = (String) session .getAttribute(LoginConstants.DESTINATION); if (destination == null || destination.equals(request.getContextPath())) destination = request.getContextPath() + "/"; else session.removeAttribute(LoginConstants.DESTINATION); String username = (String)session.getAttribute(LoginConstants.USERNAME); session.removeAttribute(LoginConstants.USERNAME); session.removeAttribute(LoginConstants.PASSWORD); session.removeAttribute(LoginConstants.RETRYCOUNT); session.removeAttribute(PortalReservedParameters.PREFERED_LOCALE_ATTRIBUTE); ComponentManager cm = Jetspeed.getComponentManager(); UserContentCacheManager userContentCacheManager = cm.lookupComponent("userContentCacheManager"); userContentCacheManager.evictUserContentCache(username, session.getId()); AuditActivity audit = cm.lookupComponent("org.apache.jetspeed.audit.AuditActivity"); if (audit != null) { audit.logUserActivity(username, request.getRemoteAddr(), AuditActivity.AUTHENTICATION_SUCCESS, "Active Authentication"); } response.sendRedirect(response.encodeURL(destination)); }
/** * @see org.apache.jetspeed.engine.Engine#getCurrentRequestContext() */ public RequestContext getCurrentRequestContext() { RequestContextComponent contextComponent = getComponentManager().lookupComponent(RequestContextComponent.class); return contextComponent.getRequestContext(); }
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession session = request.getSession(); String destination = (String) session .getAttribute(LoginConstants.DESTINATION); if (destination == null) destination = request.getContextPath() + "/"; else session.removeAttribute(LoginConstants.DESTINATION); Integer retryCount = (Integer) session .getAttribute(LoginConstants.RETRYCOUNT); if (retryCount == null) retryCount = new Integer(1); else retryCount = new Integer(retryCount.intValue() + 1); session.setAttribute(LoginConstants.RETRYCOUNT, retryCount); String username = (String)session.getAttribute(LoginConstants.USERNAME); AuditActivity audit = Jetspeed.getComponentManager().lookupComponent("org.apache.jetspeed.audit.AuditActivity"); if (audit != null) { audit.logUserActivity(username, request.getRemoteAddr(), AuditActivity.AUTHENTICATION_FAILURE, "Active Authentication"); } response.sendRedirect(response.encodeURL(destination)); }
private PortletInstance getPortletInstance(String portletUniqueName) throws PortletException { PortletRegistry registry = Jetspeed.getComponentManager().lookupComponent("portletRegistry"); PortletFactory portletFactory = Jetspeed.getComponentManager().lookupComponent("portletFactory"); ServletContext portalAppContext = ((ServletConfig) Jetspeed.getComponentManager().lookupComponent("ServletConfig")).getServletContext(); PortletDefinition portletDef = registry.getPortletDefinitionByUniqueName(portletUniqueName, true); PortletApplication portletApp = portletDef.getApplication(); ServletContext portletAppContext = portalAppContext.getContext(portletApp.getContextPath()); return portletFactory.getPortletInstance(portletAppContext, portletDef, false); }
public void sessionDestroyed(HttpSessionEvent se) { Subject subject = (Subject)se.getSession().getAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT); if (subject == null) return; if (firstInit) { // Servlet already destroyed, // Can't reliably access ComponentManager (Spring) anymore // as for instance WAS 6.0.2 has a bug invoking this method with a wrong classLoader (not the one for the WebApp) return; } Principal subjectUserPrincipal = SubjectHelper.getPrincipal(subject, UserSubjectPrincipal.class); PortalStatistics statistics = engine.getComponentManager().lookupComponent("PortalStatistics"); long sessionLength = System.currentTimeMillis() - se.getSession().getCreationTime(); String ipAddress = (String)se.getSession().getAttribute(SecurityValve.IP_ADDRESS); statistics.logUserLogout(ipAddress, subjectUserPrincipal.getName(), sessionLength); UserContentCacheManager userContentCacheManager = engine.getComponentManager().lookupComponent("userContentCacheManager"); userContentCacheManager.evictUserContentCache(subjectUserPrincipal.getName(), se.getSession().getId()); // clear preferences cache PortletPreferencesProvider preferencesProvider = engine.getComponentManager().lookupComponent("portletPreferencesProvider"); if (preferencesProvider != null) { preferencesProvider.sessionDestroyedEvent(se.getSession()); } }
public void init() { try { configuration = Jetspeed.getComponentManager().lookupComponent("PortalConfiguration"); } catch (Exception e) { configuration = null; // not set in some unit tests } if (configuration != null) { enableSessionCache = configuration.getBoolean(PortalConfigurationConstants.ENABLED_PREFERENCES_SESSION_CACHE); } else { enableSessionCache = false; } }
try prf = Jetspeed.getComponentManager().lookupComponent(PortalRequestFactory.class);