diff --git a/amps/ags/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/bootstrap/RMDataDictionaryBootstrap.xml b/amps/ags/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/bootstrap/RMDataDictionaryBootstrap.xml index 38fd599a62..aa98e6cd62 100644 --- a/amps/ags/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/bootstrap/RMDataDictionaryBootstrap.xml +++ b/amps/ags/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/bootstrap/RMDataDictionaryBootstrap.xml @@ -31,6 +31,11 @@ Configuration information for the Records Management application. + + + + + diff --git a/repository/src/main/resources/alfresco/bootstrap/customMessagesSpace.xml b/repository/src/main/resources/alfresco/bootstrap/customMessagesSpace.xml index c5099f4c11..7194d46ca8 100644 --- a/repository/src/main/resources/alfresco/bootstrap/customMessagesSpace.xml +++ b/repository/src/main/resources/alfresco/bootstrap/customMessagesSpace.xml @@ -4,6 +4,8 @@ view:childName="app:messages"> + + ${spaces.messages.description} diff --git a/repository/src/main/resources/alfresco/bootstrap/customModelsSpace.acp b/repository/src/main/resources/alfresco/bootstrap/customModelsSpace.acp index f57119b8b3..969d192357 100644 Binary files a/repository/src/main/resources/alfresco/bootstrap/customModelsSpace.acp and b/repository/src/main/resources/alfresco/bootstrap/customModelsSpace.acp differ diff --git a/repository/src/main/resources/alfresco/bootstrap/customWebClientExtensionSpace.xml b/repository/src/main/resources/alfresco/bootstrap/customWebClientExtensionSpace.xml index 18df478072..aeb23a48eb 100644 --- a/repository/src/main/resources/alfresco/bootstrap/customWebClientExtensionSpace.xml +++ b/repository/src/main/resources/alfresco/bootstrap/customWebClientExtensionSpace.xml @@ -4,6 +4,8 @@ view:childName="app:webclient_extension"> + + ${spaces.web.client.extension.description} diff --git a/repository/src/main/resources/alfresco/bootstrap/customWorkflowDefsSpace.acp b/repository/src/main/resources/alfresco/bootstrap/customWorkflowDefsSpace.acp index af60348470..9d85df1bdd 100644 Binary files a/repository/src/main/resources/alfresco/bootstrap/customWorkflowDefsSpace.acp and b/repository/src/main/resources/alfresco/bootstrap/customWorkflowDefsSpace.acp differ diff --git a/repository/src/main/resources/alfresco/bootstrap/imapSpaces.acp b/repository/src/main/resources/alfresco/bootstrap/imapSpaces.acp index 5be874baa4..f0f98ac134 100644 Binary files a/repository/src/main/resources/alfresco/bootstrap/imapSpaces.acp and b/repository/src/main/resources/alfresco/bootstrap/imapSpaces.acp differ diff --git a/repository/src/main/resources/alfresco/bootstrap/renderingActionSpace.xml b/repository/src/main/resources/alfresco/bootstrap/renderingActionSpace.xml index d2b6fe9563..fe25e02702 100644 --- a/repository/src/main/resources/alfresco/bootstrap/renderingActionSpace.xml +++ b/repository/src/main/resources/alfresco/bootstrap/renderingActionSpace.xml @@ -12,6 +12,10 @@ ${spaces.rendition.rendering_actions.name} ${spaces.rendition.rendering_actions.description} + + + + diff --git a/repository/src/main/resources/alfresco/bootstrap/replicationActionSpace.xml b/repository/src/main/resources/alfresco/bootstrap/replicationActionSpace.xml index 25c2a0dfef..c37eb279a5 100644 --- a/repository/src/main/resources/alfresco/bootstrap/replicationActionSpace.xml +++ b/repository/src/main/resources/alfresco/bootstrap/replicationActionSpace.xml @@ -12,6 +12,10 @@ ${spaces.replication.replication_actions.name} ${spaces.replication.replication_actions.description} + + + + diff --git a/repository/src/main/resources/alfresco/bootstrap/scheduledActionsFolder.xml b/repository/src/main/resources/alfresco/bootstrap/scheduledActionsFolder.xml index 38c9ecfdca..00133289b9 100644 --- a/repository/src/main/resources/alfresco/bootstrap/scheduledActionsFolder.xml +++ b/repository/src/main/resources/alfresco/bootstrap/scheduledActionsFolder.xml @@ -11,5 +11,9 @@ ${spaces.actions.scheduled_actions.name} ${spaces.actions.scheduled_actions.description} + + + + diff --git a/repository/src/main/resources/alfresco/bootstrap/solrFacetsRootFolder.xml b/repository/src/main/resources/alfresco/bootstrap/solrFacetsRootFolder.xml index 4b80d008e2..206befe90b 100644 --- a/repository/src/main/resources/alfresco/bootstrap/solrFacetsRootFolder.xml +++ b/repository/src/main/resources/alfresco/bootstrap/solrFacetsRootFolder.xml @@ -14,5 +14,9 @@ ${spaces.solr_facets.root.description} + + + + diff --git a/repository/src/main/resources/alfresco/bootstrap/spaces.xml b/repository/src/main/resources/alfresco/bootstrap/spaces.xml index c1faaec15f..744ab0ad4b 100644 --- a/repository/src/main/resources/alfresco/bootstrap/spaces.xml +++ b/repository/src/main/resources/alfresco/bootstrap/spaces.xml @@ -1,7 +1,7 @@ + xmlns:emailserver="http://www.alfresco.org/model/emailserver/1.0" xmlns:sys="http://www.alfresco.org/model/system/1.0"> @@ -30,6 +30,10 @@ space-icon-default ${spaces.dictionary.name} ${spaces.dictionary.description} + + + + @@ -37,6 +41,10 @@ space-icon-default ${spaces.templates.name} ${spaces.templates.description} + + + + @@ -45,6 +53,10 @@ space-icon-default ${spaces.templates.content.name} ${spaces.templates.content.description} + + + + @@ -53,6 +65,10 @@ space-icon-default ${spaces.templates.email.name} ${spaces.templates.email.description} + + + + @@ -79,6 +95,10 @@ space-icon-default ${spaces.templates.rss.name} ${spaces.templates.rss.description} + + + + @@ -93,6 +113,10 @@ space-icon-default ${spaces.savedsearches.name} ${spaces.savedsearches.description} + + + + @@ -100,6 +124,10 @@ space-icon-default ${spaces.scripts.name} ${spaces.scripts.description} + + + + @@ -107,6 +135,10 @@ space-icon-default ${spaces.nodeTemplatesSpace.name} ${spaces.nodeTemplatesSpace.description} + + + + @@ -120,6 +152,10 @@ space-icon-default ${spaces.smartfoldertemplates.name} ${spaces.smartfoldertemplates.description} + + + + @@ -133,6 +169,10 @@ space-icon-default ${spaces.smartdownloads.name} ${spaces.smartdownloads.description} + + + + diff --git a/repository/src/main/resources/alfresco/bootstrap/transferSpaces.xml b/repository/src/main/resources/alfresco/bootstrap/transferSpaces.xml index 07cd98dc6c..7a9c6dc200 100644 --- a/repository/src/main/resources/alfresco/bootstrap/transferSpaces.xml +++ b/repository/src/main/resources/alfresco/bootstrap/transferSpaces.xml @@ -4,10 +4,13 @@ xmlns:view="http://www.alfresco.org/view/repository/1.0" xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:app="http://www.alfresco.org/model/application/1.0" - xmlns:trx="http://www.alfresco.org/model/transfer/1.0"> + xmlns:trx="http://www.alfresco.org/model/transfer/1.0" + xmlns:sys="http://www.alfresco.org/model/system/1.0"> + + ${spaces.transfers.description} diff --git a/repository/src/main/resources/alfresco/bootstrap/webScripts.xml b/repository/src/main/resources/alfresco/bootstrap/webScripts.xml index 064480500f..201598caac 100644 --- a/repository/src/main/resources/alfresco/bootstrap/webScripts.xml +++ b/repository/src/main/resources/alfresco/bootstrap/webScripts.xml @@ -3,6 +3,8 @@ + + ${webscripts.url_addressable_web_services} diff --git a/repository/src/main/resources/alfresco/bootstrap/webScriptsExtensions.xml b/repository/src/main/resources/alfresco/bootstrap/webScriptsExtensions.xml index 7e9884ff62..1586d3f24e 100644 --- a/repository/src/main/resources/alfresco/bootstrap/webScriptsExtensions.xml +++ b/repository/src/main/resources/alfresco/bootstrap/webScriptsExtensions.xml @@ -3,6 +3,8 @@ + + ${webscriptsextentions.customized_web_scripts} diff --git a/repository/src/main/resources/alfresco/model-specific-services-context.xml b/repository/src/main/resources/alfresco/model-specific-services-context.xml index 7bd52210b4..069357f4fa 100644 --- a/repository/src/main/resources/alfresco/model-specific-services-context.xml +++ b/repository/src/main/resources/alfresco/model-specific-services-context.xml @@ -68,14 +68,6 @@ /${spaces.company_home.childname} - /${spaces.company_home.childname}/${spaces.dictionary.childname} - /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.childname} - /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.content.childname} - /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname} - /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.rss.childname} - /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.scripts.childname} - /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.webscripts.childname} - /${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.extension_webscripts.childname} diff --git a/repository/src/test/java/org/alfresco/AppContext01TestSuite.java b/repository/src/test/java/org/alfresco/AppContext01TestSuite.java index 277bb60627..147626480a 100644 --- a/repository/src/test/java/org/alfresco/AppContext01TestSuite.java +++ b/repository/src/test/java/org/alfresco/AppContext01TestSuite.java @@ -76,7 +76,8 @@ import org.junit.runners.Suite; org.alfresco.repo.activities.SiteActivityTestCaseSensitivity.class, org.alfresco.repo.activities.feed.cleanup.FeedCleanerTestCaseSensitivity.class, org.alfresco.repo.activities.SiteActivityTestCaseInsensitivity.class, - org.alfresco.repo.admin.registry.RegistryServiceImplTest.class + org.alfresco.repo.admin.registry.RegistryServiceImplTest.class, + org.alfresco.repo.bootstrap.DataDictionaryFolderTest.class }) public class AppContext01TestSuite { diff --git a/repository/src/test/java/org/alfresco/repo/bootstrap/DataDictionaryFolderTest.java b/repository/src/test/java/org/alfresco/repo/bootstrap/DataDictionaryFolderTest.java new file mode 100644 index 0000000000..009fca7639 --- /dev/null +++ b/repository/src/test/java/org/alfresco/repo/bootstrap/DataDictionaryFolderTest.java @@ -0,0 +1,124 @@ +/* + * #%L + * Alfresco Repository + * %% + * Copyright (C) 2005 - 2024 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.repo.bootstrap; + + +import org.alfresco.model.ContentModel; +import org.alfresco.repo.security.authentication.AuthenticationUtil; +import org.alfresco.service.ServiceRegistry; +import org.alfresco.service.cmr.repository.ChildAssociationRef; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.namespace.QName; +import org.alfresco.util.BaseSpringTest; +import org.alfresco.util.test.junitrules.ApplicationContextInit; +import org.alfresco.util.test.junitrules.WellKnownNodes; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; + +import java.util.List; + +public class DataDictionaryFolderTest extends BaseSpringTest +{ + @ClassRule + private static final ApplicationContextInit APP_CONTEXT_INIT = new ApplicationContextInit(); + + private static final String DATA_DICTIONARY = "Data Dictionary"; + + @Rule + private WellKnownNodes wellKnownNodes = new WellKnownNodes(APP_CONTEXT_INIT); + + private NodeService nodeService; + + @Before + public void before() + { + ServiceRegistry serviceRegistry = (ServiceRegistry) this.applicationContext.getBean("ServiceRegistry"); + this.nodeService = serviceRegistry.getNodeService(); + } + + @Test + public void testDataDictionaryFolderIsUndeletable() + { + AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName()); + // get the company_home + NodeRef companyHomeRef = wellKnownNodes.getCompanyHome(); + // get the Data Dictionary + NodeRef dataDictionaryRef = nodeService.getChildByName(companyHomeRef, ContentModel.ASSOC_CONTAINS, DATA_DICTIONARY); + assertTrue(nodeService.hasAspect(dataDictionaryRef, ContentModel.ASPECT_UNDELETABLE)); + + List chilAssocsList = nodeService.getChildAssocs(dataDictionaryRef); + + chilAssocsList.stream() + .map(ChildAssociationRef::getChildRef) + .forEach(childNodeRef -> { + assertTrue(nodeService.hasAspect(childNodeRef, ContentModel.ASPECT_UNDELETABLE)); + try + { + nodeService.deleteNode(childNodeRef); + } + catch (Exception ex) + { + assertTrue(ex.getMessage().contains("deletion is not allowed")); + } + }); + } + + @Test + public void testDataDictionaryFolderIsUnmovable() + { + AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName()); + // get the company_home + NodeRef companyHomeRef = wellKnownNodes.getCompanyHome(); + // get the Data Dictionary + NodeRef dataDictionaryRef = nodeService.getChildByName(companyHomeRef, ContentModel.ASSOC_CONTAINS, DATA_DICTIONARY); + assertTrue(nodeService.hasAspect(dataDictionaryRef, ContentModel.ASPECT_UNMOVABLE)); + + List chilAssocsList = nodeService.getChildAssocs(dataDictionaryRef); + + chilAssocsList.stream() + .map(ChildAssociationRef::getChildRef) + .forEach(childNodeRef -> { + assertTrue(nodeService.hasAspect(childNodeRef, ContentModel.ASPECT_UNMOVABLE)); + NodeRef folderRef = nodeService.createNode( + companyHomeRef, + ContentModel.ASSOC_CONTAINS, + QName.createQName("testDeleteAndRestore-folder2-" + System.currentTimeMillis()), + ContentModel.TYPE_FOLDER + ).getChildRef(); + try + { + nodeService.moveNode(childNodeRef, folderRef, ContentModel.ASSOC_CONTAINS, ContentModel.ASSOC_CONTAINS); + } + catch (Exception ex) + { + assertTrue(ex.getMessage().contains("move is not allowed")); + } + }); + } +} \ No newline at end of file