/** * Replace some variables into HTML content * * @param content * @return specific message for the selected portlet, after some * replacements */ private String mergeDisabledContent(ModuleRegistry moduleRegistry, String content, String portletDisplayName, String portletName, String portletID) { String result = content; result = result.replaceAll("ACTIVE_PROFILES", PortalContainer.getProfiles().toString()); result = result.replaceAll("APP_NAME", portletDisplayName); result = result.replaceAll("APP_ID", portletName); //result = result.replaceAll("PROFILE", moduleRegistry.getModulesForPortlet(portletID).toString()); result = result.replaceAll("PROFILE", "all"); return result; }
public boolean isPortletActive(String portletId) { // Read from cache Boolean isPortletActive = isPortletActiveCache.get(portletId); if (isPortletActive != null) { return isPortletActive; } // Read active profiles Set<String> portletActiveProfiles = getModulesForPortlet(portletId); if (portletActiveProfiles.size() == 1 && portletActiveProfiles.contains(ALL_MODULES_PROFILE)) { isPortletActive = true; } else { Set<String> currentActiveProfiles = PortalContainer.getProfiles(); portletActiveProfiles.retainAll(currentActiveProfiles); isPortletActive = !portletActiveProfiles.isEmpty(); } isPortletActiveCache.put(portletId, isPortletActive); return isPortletActive; }
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();
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();