public DataInjectorService(OrganizationService organizationService, ConfigurationManager configurationManager) { this.organizationService = organizationService; this.configurationManager = configurationManager; this.picketLinkIDMService = (PicketLinkIDMService) PortalContainer.getInstance().getComponentInstanceOfType( PicketLinkIDMService.class); }
protected ServletContext getContext() { return container.get().getPortalContext(); } }
static public CalendarService getCalendarService() throws Exception { return (CalendarService) PortalContainer.getInstance().getComponentInstance(CalendarService.class); }
/** * {@inheritDoc} */ @Override public void processUpgrade(final String oldVersion, final String newVersion) { storeValueForPlugin(MIGRATION_STATUS, "0"); PortalContainer.addInitTask(portalContainer.getPortalContext(), new PortalContainerPostInitTask() { @Override public void execute(ServletContext context, PortalContainer portalContainer) { // Execute the task in an asynchrounous way new Thread(new Runnable() { @Override public void run() { doMigration(); } }, getName()).start(); } }); }
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String redirectURI = "/portal/"; String value = request.getParameter("value"); // make sure PortalContainer is created PortalContainer.getInstance(); SoftwareRegistrationService softwareRegistrationService = CommonsUtils.getService(SoftwareRegistrationService.class); if(StringUtils.equals("skip", value)) { softwareRegistrationService.setRequestSkip(true); softwareRegistrationService.updateSkippedNumber(); } if(StringUtils.equals("notReachable", value)){ request.getSession().setAttribute("notReachable", "true"); redirectURI+="?"+SoftwareRegisterFilter.NOT_REACHABLE; } response.sendRedirect(redirectURI); }
SessionProvider sessionProvider = null; try { PortalContainer container = PortalContainer.getInstance(); sessionProvider = SessionProvider.createSystemProvider(); NodeHierarchyCreator nodeHierarchyCreator = (NodeHierarchyCreator) container.getComponentInstanceOfType(NodeHierarchyCreator.class); RepositoryService repoService = (RepositoryService) container.getComponentInstanceOfType(RepositoryService.class); String plfProfile = PortalContainer.getProfiles().toString().trim(); String runningProfile = plfProfile.substring(1, plfProfile.length() - 1); ManageableRepository repo = repoService.getCurrentRepository();
private void addComponentPlugins(List<ComponentPlugin> plugins) { if (plugins == null || plugins.isEmpty()) { return; } for (ComponentPlugin plugin : plugins) { try { DataPlugin dataPlugin = PortalContainer.getInstance().createComponent(DataPlugin.class, plugin.getInitParams()); dataPlugin.setName(plugin.getName()); dataPlugin.setDescription(plugin.getDescription()); this.addDataPlugin(dataPlugin); } catch (Exception e) { LOG.error("Failed to instanciate component plugin " + plugin.getName() + ", type=" + plugin.getClass(), e); } } }
protected <T> T getService(Class<T> clazz) { return container.get().getComponentInstanceOfType(clazz); }
private Response redirectToHomePage() { PortalRequestContext portalRequestContext = Util.getPortalRequestContext(); HttpServletRequest currentServletRequest = portalRequestContext.getRequest(); StringBuilder sb = new StringBuilder(); sb.append(currentServletRequest.getScheme()).append("://") .append(currentServletRequest.getServerName()) .append(":").append(currentServletRequest.getServerPort()) .append("/").append(PortalContainer.getCurrentPortalContainerName()) .append("/").append(Util.getPortalRequestContext().getPortalOwner()); WebuiRequestContext ctx = WebuiRequestContext.getCurrentInstance(); JavascriptManager jsManager = ctx.getJavascriptManager(); jsManager.addJavascript("try { window.location.href='" + sb.toString() + "' } catch(e) {" + "window.location.href('" + sb.toString() + "') }"); return Response.redirect(sb.toString()); }
info.setLabel(pageNode.getLabel()); wsSubPath = PortalContainer.getCurrentRestContextName() + "/private" + WS_ROOT_PATH + "/" + userId + "/" + getPageName(pageNode.getPageReference()); wsURI = uriInfo.getBaseUriBuilder().replaceMatrix(wsSubPath).build(); dashboardSubPath = PortalContainer.getCurrentPortalContainerName() + "/u/" + userId + "/" + pageNode.getName(); dashboardURI = uriInfo.getBaseUriBuilder().replaceMatrix(dashboardSubPath).build();
this.container = PortalContainer.getInstance(); } catch (Exception e) { AssertionFailedError afe = new AssertionFailedError();
public JsonPlatformInfo getJsonPlatformInfo() { SessionProvider sessionProvider = null; try { PortalContainer container = PortalContainer.getInstance(); sessionProvider = SessionProvider.createSystemProvider(); RepositoryService repoService = (RepositoryService) container.getComponentInstanceOfType(RepositoryService.class); String plfProfile = PortalContainer.getProfiles().toString().trim(); String runningProfile = plfProfile.substring(1, plfProfile.length() - 1); ManageableRepository repo = repoService.getCurrentRepository();
@Override public void onEvent(Event<PortalContainer, HttpSessionEvent> event) throws Exception { PortalContainer container = event.getSource(); HttpSession session = event.getData().getSession(); UploadService uploadService = (UploadService)container.getComponentInstanceOfType(UploadService.class); uploadService.cleanUp(session); } }
private void addSpaceWithFieldsToList(Space space, String fields, List<Object> sortedSearchedSpaces) { String groupId = space.getGroupId(); String permanentSpaceName = groupId.split("/")[2]; StringBuffer baseSpaceURL = new StringBuffer(); baseSpaceURL.append(PortalContainer.getCurrentPortalContainerName()+ "/g/:spaces:") ; if (permanentSpaceName.equals(space.getPrettyName())) { baseSpaceURL.append(permanentSpaceName) ; baseSpaceURL.append("/"); baseSpaceURL.append(permanentSpaceName) ; } else { baseSpaceURL.append(space.getPrettyName()) ; baseSpaceURL.append("/"); baseSpaceURL.append(space.getPrettyName()) ; } space.setUrl(baseSpaceURL.toString()); sortedSearchedSpaces.add(extractObject(space, fields)); }
public SpaceService getSpaceService() { if (this.spaceService == null) { this.spaceService = (SpaceService) PortalContainer.getInstance().getComponentInstanceOfType(SpaceService.class); } return this.spaceService; }
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpServletRequest = (HttpServletRequest) request; HttpServletResponse httpServletResponse = (HttpServletResponse) response; ExoContainer container = PortalContainer.getInstance(); AccountSetupService accountSetupService = container.getComponentInstanceOfType(AccountSetupService.class); boolean setupDone = accountSetupService.mustSkipAccountSetup(); String requestUri = httpServletRequest.getRequestURI(); boolean isRestUri = requestUri.contains(container.getContext().getRestContextName()); if (!setupDone && !isRestUri) { ServletContext platformExtensionContext = httpServletRequest.getSession() .getServletContext() .getContext(PLF_PLATFORM_EXTENSION_SERVLET_CTX); platformExtensionContext.getRequestDispatcher(ACCOUNT_SETUP_SERVLET).forward(httpServletRequest, httpServletResponse); return; } chain.doFilter(request, response); } }
public LocalGadgetImporter(String name, GadgetRegistryService registryService, String gadgetPath, ConfigurationManager configurationManager, PortalContainer container) { super(name, gadgetPath); this.configurationManager = configurationManager; this.container = container; this.gadgetPath = gadgetPath; this.gadgetService = registryService; if (gadgetPath.startsWith("war:")) { gadgetPath = gadgetPath.replace("war:", ""); this.gadgetRootAbsolutePath = container.getPortalContext().getRealPath(gadgetPath); this.gadgetRootAbsolutePath = this.gadgetRootAbsolutePath.replace("\\", "/"); int gadgetRootPathIndex = this.gadgetRootAbsolutePath.lastIndexOf(gadgetPath); this.gadgetRootAbsolutePath = this.gadgetRootAbsolutePath.substring(0, gadgetRootPathIndex); } }
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String redirectURI; String accountsetupbutton = request.getParameter(ACCOUNT_SETUP_BUTTON); if (accountsetupbutton.equals(SETUP_SKIP_BUTTON) || accountSetupService.mustSkipAccountSetup()) { if (LOG.isWarnEnabled()) { LOG.warn("Direct access to Account Setup Form."); } accountSetupService.setSkipSetup(true); redirectURI = "/" + PortalContainer.getCurrentPortalContainerName(); } else { String userNameAccount = request.getParameter(USER_NAME_ACCOUNT); String firstNameAccount = request.getParameter(FIRST_NAME_ACCOUNT); String lastNameAccount = request.getParameter(LAST_NAME_ACCOUNT); String emailAccount = request.getParameter(EMAIL_ACCOUNT); String userPasswordAccount = request.getParameter(USER_PASSWORD_ACCOUNT); String adminPassword = request.getParameter(ADMIN_PASSWORD); accountSetupService.createAccount(userNameAccount, firstNameAccount, lastNameAccount, emailAccount, userPasswordAccount, adminPassword); // Redirect to requested page redirectURI = "/" + PortalContainer.getCurrentPortalContainerName() + "/login?" + "username=" + URLEncoder.encode(userNameAccount, "UTF-8") + "&password=" + userPasswordAccount + "&initialURI=" + INTRANET_HOME; } response.setCharacterEncoding("UTF-8"); response.sendRedirect(redirectURI); }
public TermsAndConditionsService getTermsAndConditionsService() { if (this.termsAndConditionsService == null) { termsAndConditionsService = (TermsAndConditionsService) PortalContainer.getInstance().getComponentInstanceOfType(TermsAndConditionsService.class); } return this.termsAndConditionsService; }
if (containerContext == null) container = PortalContainer.getInstance();