public Pipeline getPipeline( String pipelineName ) { return componentManager.lookupComponent(pipelineName); }
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);
public void sessionCreated(HttpSessionEvent se) { PortletServices services = JetspeedPortletServices.getSingleton(); if (services != null) { PortalSessionsManager psm = (PortalSessionsManager)services.getService(PortalSessionsManager.SERVICE_NAME); if (psm != null) { psm.portalSessionCreated(se.getSession()); } } PortletPreferencesProvider preferencesProvider = engine.getComponentManager().lookupComponent("portletPreferencesProvider"); if (preferencesProvider != null) { preferencesProvider.sessionCreatedEvent(se.getSession()); } }
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(); }
decorationLocator = cm.lookupComponent("DecorationLocator");
public AbstractPortalURL(NavigationalState navState, PortalContext portalContext) { if ( navStateParameter == null ) { navStateParameter = portalContext.getConfigurationProperty("portalurl.navigationalstate.parameter.name", DEFAULT_NAV_STATE_PARAMETER); } this.navState = navState; if ( relativeOnly == null ) { relativeOnly = new Boolean(portalContext.getConfiguration().getBoolean("portalurl.relative.only", false)); } if (pagePipeline == null) { synchronized (lock) { String pagePipelineName = portalContext.getConfiguration().getString(JetspeedEngineConstants.PIPELINE_DEFAULT, "/portal"); PipelineMapper pipelineMapper = Jetspeed.getEngine().getComponentManager().lookupComponent("pipeline-mapper"); pagePipeline = pipelineMapper.getMappedPathByPipelineId(pagePipelineName); portletPipeline = pipelineMapper.getMappedPathByPipelineId(PortalReservedParameters.PORTLET_PIPELINE); } } }