[APPS-2019] Add Undeletable and Unmovable Aspects to Data Dictionary and its Level 1 sub-folders (#2705)

* [force] Force release for 2024-06-09.

* [APPS-2019] Added Undeletable and Unmovable Aspect to Data Dictionary Folder

* [APPS-2019] Added Undeletable and Unmovable Aspect to Data Dictionary Folder

* [APPS-2019] Added Undeletable and Unmovable Aspect to Data Dictionary Folder

* [APPS-2019] Added Undeletable and Unmovable Aspect to Data Dictionary Folder

* [APPS-2019] Added Undeletable and Unmovable Aspect to Data Dictionary Folder

* [APPS-2019] Added Undeletable and Unmovable Aspect to Data Dictionary Folder

* [APPS-2019] [ags] [tas] Added Integration Test Cases

* [APPS-2019] [ags] [tas] Added fix for restricting the move folder for Data Dictionary

* [APPS-2019] [ags] [tas] Added fix for restricting the move folder for Data Dictionary

* Added Undeletable and Unmovable Aspects to Data Dictionary Folder

* [APPS-2019] Updated Integration Test Cases

* [APPS-2019] [ags] [tas] Added fix for restricting the move folder for Data Dictionary

* [APPS-2019] [ags] [tas] Added fix for restricting the move folder for Data Dictionary

* [APPS-2019] [ags] [tas] Addressed review comments

* [APPS-2019] [ags] [tas] Addressed review comments

* [APPS-2019] [ags] [tas] Addressed review comments

* [APPS-2019] [ags] [tas] Addressed review comments

* [APPS-2019] [ags] [tas] Addressed review comments

* [APPS-2019] [ags] [tas] Addressed review comments

* [APPS-2019] [ags] [tas] Addressed review comments

* [APPS-2019] [ags] [tas] Addressed review comments

* [APPS-2019] [ags] [tas] Addressed review comments

* [APPS-2019] [ags] [tas] Addressed review comments

* [APPS-2019] [ags] [tas] Addressed review comments

---------

Co-authored-by: Alfresco CI User <build@alfresco.com>
This commit is contained in:
Suneet Gupta
2024-06-27 10:05:57 +05:30
committed by GitHub
parent 76be8d2bec
commit abeaff52e8
17 changed files with 200 additions and 11 deletions

View File

@@ -31,6 +31,11 @@
<cm:description>Configuration information for the Records Management application.</cm:description>
</view:properties>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
<view:associations>
<cm:contains>

View File

@@ -4,6 +4,8 @@
view:childName="app:messages">
<view:aspects>
<app:uifacets></app:uifacets>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
<view:properties>
<cm:description>${spaces.messages.description}</cm:description>

View File

@@ -4,6 +4,8 @@
view:childName="app:webclient_extension">
<view:aspects>
<app:uifacets></app:uifacets>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
<view:properties>
<cm:description>${spaces.web.client.extension.description}</cm:description>

View File

@@ -12,6 +12,10 @@
<cm:title>${spaces.rendition.rendering_actions.name}</cm:title>
<cm:description>${spaces.rendition.rendering_actions.description}</cm:description>
</view:properties>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
</cm:folder>
</view:view>

View File

@@ -12,6 +12,10 @@
<cm:title>${spaces.replication.replication_actions.name}</cm:title>
<cm:description>${spaces.replication.replication_actions.description}</cm:description>
</view:properties>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
</cm:folder>
</view:view>

View File

@@ -11,5 +11,9 @@
<cm:title>${spaces.actions.scheduled_actions.name}</cm:title>
<cm:description>${spaces.actions.scheduled_actions.description}</cm:description>
</view:properties>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
</cm:folder>
</view:view>

View File

@@ -14,5 +14,9 @@
<cm:description>${spaces.solr_facets.root.description}
</cm:description>
</view:properties>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
</srft:facets>
</view:view>

View File

@@ -1,7 +1,7 @@
<view:view 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:emailserver="http://www.alfresco.org/model/emailserver/1.0">
xmlns:emailserver="http://www.alfresco.org/model/emailserver/1.0" xmlns:sys="http://www.alfresco.org/model/system/1.0">
<!-- NOTE: all replaced properties referenced from repository.properties file must also be
mapped in the import-export-context.xml spacesStoreImporter/configuration section -->
@@ -30,6 +30,10 @@
<app:icon>space-icon-default</app:icon>
<cm:title>${spaces.dictionary.name}</cm:title>
<cm:description>${spaces.dictionary.description}</cm:description>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
<cm:contains>
<cm:folder view:childName="${spaces.templates.childname}">
<app:uifacets/>
@@ -37,6 +41,10 @@
<app:icon>space-icon-default</app:icon>
<cm:title>${spaces.templates.name}</cm:title>
<cm:description>${spaces.templates.description}</cm:description>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
</cm:folder>
<cm:folder
view:childName="${spaces.templates.content.childname}">
@@ -45,6 +53,10 @@
<app:icon>space-icon-default</app:icon>
<cm:title>${spaces.templates.content.name}</cm:title>
<cm:description>${spaces.templates.content.description}</cm:description>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
</cm:folder>
<cm:folder
view:childName="${spaces.templates.email.childname}">
@@ -53,6 +65,10 @@
<app:icon>space-icon-default</app:icon>
<cm:title>${spaces.templates.email.name}</cm:title>
<cm:description>${spaces.templates.email.description}</cm:description>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
<cm:contains>
<cm:folder
view:childName="${spaces.templates.email.invite.childname}">
@@ -79,6 +95,10 @@
<app:icon>space-icon-default</app:icon>
<cm:title>${spaces.templates.rss.name}</cm:title>
<cm:description>${spaces.templates.rss.description}</cm:description>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
</cm:folder>
<cm:folder
view:childName="${spaces.savedsearches.childname}">
@@ -93,6 +113,10 @@
<app:icon>space-icon-default</app:icon>
<cm:title>${spaces.savedsearches.name}</cm:title>
<cm:description>${spaces.savedsearches.description}</cm:description>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
</cm:folder>
<cm:folder view:childName="${spaces.scripts.childname}">
<app:uifacets/>
@@ -100,6 +124,10 @@
<app:icon>space-icon-default</app:icon>
<cm:title>${spaces.scripts.name}</cm:title>
<cm:description>${spaces.scripts.description}</cm:description>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
</cm:folder>
<cm:folder view:childName="${spaces.nodetemplates.childname}">
<app:uifacets/>
@@ -107,6 +135,10 @@
<app:icon>space-icon-default</app:icon>
<cm:title>${spaces.nodeTemplatesSpace.name}</cm:title>
<cm:description>${spaces.nodeTemplatesSpace.description}</cm:description>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
</cm:folder>
<cm:folder view:childName="${spaces.smartfolders.childname}">
<view:acl view:inherit="false">
@@ -120,6 +152,10 @@
<app:icon>space-icon-default</app:icon>
<cm:title>${spaces.smartfoldertemplates.name}</cm:title>
<cm:description>${spaces.smartfoldertemplates.description}</cm:description>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
</cm:folder>
<cm:folder view:childName="${spaces.smartdownloads.childname}">
<view:acl view:inherit="false">
@@ -133,6 +169,10 @@
<app:icon>space-icon-default</app:icon>
<cm:title>${spaces.smartdownloads.name}</cm:title>
<cm:description>${spaces.smartdownloads.description}</cm:description>
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
</cm:folder>
</cm:contains>
</cm:folder>

View File

@@ -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">
<cm:folder view:childName="${spaces.transfers.childname}">
<view:aspects>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
<view:properties>
<cm:description>${spaces.transfers.description}</cm:description>

View File

@@ -3,6 +3,8 @@
<cm:folder xmlns:alf="http://www.alfresco.org" xmlns:d="http://www.alfresco.org/model/dictionary/1.0" xmlns:view="http://www.alfresco.org/view/repository/1.0" xmlns:act="http://www.alfresco.org/model/action/1.0" xmlns:wf="http://www.alfresco.org/model/workflow/1.0" xmlns:app="http://www.alfresco.org/model/application/1.0" xmlns:ver="http://www.alfresco.org/model/versionstore/1.0" xmlns:usr="http://www.alfresco.org/model/user/1.0" xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:sys="http://www.alfresco.org/model/system/1.0" xmlns:rule="http://www.alfresco.org/model/rule/1.0" xmlns:fm="http://www.alfresco.org/model/forum/1.0" xmlns:bpm="http://www.alfresco.org/model/bpm/1.0" xmlns:custom="custom.model" xmlns="" view:childName="cm:webscripts">
<view:aspects>
<app:uifacets></app:uifacets>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
<view:properties>
<cm:description>${webscripts.url_addressable_web_services}</cm:description>

View File

@@ -3,6 +3,8 @@
<cm:folder xmlns:alf="http://www.alfresco.org" xmlns:d="http://www.alfresco.org/model/dictionary/1.0" xmlns:view="http://www.alfresco.org/view/repository/1.0" xmlns:act="http://www.alfresco.org/model/action/1.0" xmlns:wf="http://www.alfresco.org/model/workflow/1.0" xmlns:app="http://www.alfresco.org/model/application/1.0" xmlns:ver="http://www.alfresco.org/model/versionstore/1.0" xmlns:usr="http://www.alfresco.org/model/user/1.0" xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:sys="http://www.alfresco.org/model/system/1.0" xmlns:rule="http://www.alfresco.org/model/rule/1.0" xmlns:fm="http://www.alfresco.org/model/forum/1.0" xmlns:bpm="http://www.alfresco.org/model/bpm/1.0" xmlns:custom="custom.model" xmlns="" view:childName="cm:extensionwebscripts">
<view:aspects>
<app:uifacets></app:uifacets>
<sys:undeletable/>
<sys:unmovable/>
</view:aspects>
<view:properties>
<cm:description>${webscriptsextentions.customized_web_scripts}</cm:description>

View File

@@ -68,14 +68,6 @@
<property name="systemPaths">
<list>
<value>/${spaces.company_home.childname}</value>
<value>/${spaces.company_home.childname}/${spaces.dictionary.childname}</value>
<value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.childname}</value>
<value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.content.childname}</value>
<value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}</value>
<value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.rss.childname}</value>
<value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.scripts.childname}</value>
<value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.webscripts.childname}</value>
<value>/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.extension_webscripts.childname}</value>
</list>
</property>
</bean>

View File

@@ -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
{

View File

@@ -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 <http://www.gnu.org/licenses/>.
* #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<ChildAssociationRef> 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<ChildAssociationRef> 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"));
}
});
}
}