public SpaceCustomizationService(DataStorage dataStorageService_,PageService pageService_, UserPortalConfigService userPortalConfigService_, NodeHierarchyCreator nodeHierarchyCreator_, DMSConfiguration dmsConfiguration_, RepositoryService repositoryService_, ConfigurationManager configurationManager_, UserACL userACL_) { this.nodeHierarchyCreator = nodeHierarchyCreator_; this.dmsConfiguration = dmsConfiguration_; this.repositoryService = repositoryService_; this.userACL = userACL_; this.configurationManager = configurationManager_; this.dataStorageService = dataStorageService_; this.pageService = pageService_; this.userPortalConfigService = userPortalConfigService_; groupsPath = nodeHierarchyCreator.getJcrPath(GROUPS_PATH); if (groupsPath.lastIndexOf("/") == groupsPath.length() - 1) { groupsPath = groupsPath.substring(0, groupsPath.lastIndexOf("/")); } }
public List<Node> getAllFavoritesByUser(String workspace, String repository, Node userNode) throws Exception { List<Node> ret = new ArrayList<Node>(); LinkManager linkManager = (LinkManager)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(LinkManager.class); NodeHierarchyCreator nodeHierarchyCreator = (NodeHierarchyCreator)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(NodeHierarchyCreator.class); String favoritePath = nodeHierarchyCreator.getJcrPath("userPrivateFavorites"); Node favoriteFolder= userNode.getNode(favoritePath); NodeIterator nodeIter = favoriteFolder.getNodes(); while (nodeIter.hasNext()) { Node childNode = nodeIter.nextNode(); String primaryType = childNode.getProperty("jcr:primaryType").getString(); if (linkManager.isLink(childNode) || primaryType.contains("nt:file")) { ret.add(childNode); } } return ret; }
public UpgradeNodeTypesTemplatesService(RepositoryService repositoryService, NodeHierarchyCreator nodeHierarchyCreator, DMSConfiguration dmsConfiguration, TemplateService templateService, ConfigurationManager configurationManager, InitParams initParams) { super(initParams); this.templateService = templateService; this.configurationManager = configurationManager; this.repositoryService = repositoryService; this.dmsConfiguration = dmsConfiguration; // List of eXo predefined Templates component-plugin names, // that contains the DocumentType Templates // that we want to be upgraded each Platform upgrade List<?> pluginNamesList = initParams.getValuesParam("plugin-names").getValues(); for (Object object : pluginNamesList) { this.pluginNamesList.add((String) object); } cmsTemplatesBasePath = nodeHierarchyCreator.getJcrPath(BasePath.CMS_TEMPLATES_PATH); if (cmsTemplatesBasePath == null) { throw new RuntimeException("UpgradeNodeTypesTemplatesService: " + BasePath.CMS_TEMPLATES_PATH + " path couldn't be found"); } }
public void editSpaceDriveViewPermissions(String viewNodeName, String permission) throws RepositoryException { if (LOG.isDebugEnabled()) { LOG.debug("Trying to add permission " + permission + " for ECMS view " + viewNodeName); } String viewsPath = nodeHierarchyCreator.getJcrPath(BasePath.CMS_VIEWS_PATH); ManageableRepository manageableRepository = repositoryService.getCurrentRepository(); DMSRepositoryConfiguration dmsRepoConfig = dmsConfiguration.getConfig(); Session session = manageableRepository.getSystemSession(dmsRepoConfig.getSystemWorkspace()); Node viewHomeNode = (Node) session.getItem(viewsPath); if (viewHomeNode.hasNode(viewNodeName)) { Node contentNode = viewHomeNode.getNode(viewNodeName); String contentNodePermissions = contentNode.getProperty("exo:accessPermissions").getString(); contentNode.setProperty("exo:accessPermissions", contentNodePermissions.concat(",").concat(permission)); viewHomeNode.save(); if (LOG.isDebugEnabled()) { LOG.debug("Permission " + permission + " added with success to ECMS view " + viewNodeName); } } else { if (LOG.isDebugEnabled()) { LOG.debug("Can not find view node: " + viewNodeName); } } }
private void migrateUsers(SessionProvider sessionProvider) { try { String ws = repoService.getCurrentRepository().getConfiguration().getDefaultWorkspaceName(); Session session = sessionProvider.getSession(ws, repoService.getCurrentRepository()); Node groups = (Node)session.getItem(nodeHierarchyCreator.getJcrPath("usersPath")); ((ExtendedNode) groups).removePermission("*:/platform/users"); session.save(); } catch (Exception e) { if (LOG.isErrorEnabled()) { LOG.error("An unexpected error occurs when migrate /Users", e); } } }
LOG.info("processing upgrading product info node..."); try { String applicationDataRootNodePath = nodeHierarchyCreator.getJcrPath(EXO_APPLICATIONS_DATA_NODE_ALIAS);