mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Revert "Merge branch 'feature/RM-6107__ViewAndAddExemptionUI_sm' into…"
This reverts merge request !877
This commit is contained in:
@@ -40,6 +40,7 @@ import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
|
|||||||
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
|
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchService;
|
import org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchService;
|
||||||
import org.alfresco.repo.node.NodeServicePolicies;
|
import org.alfresco.repo.node.NodeServicePolicies;
|
||||||
|
import org.alfresco.repo.node.integrity.IntegrityException;
|
||||||
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
|
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
|
||||||
import org.alfresco.repo.policy.annotation.Behaviour;
|
import org.alfresco.repo.policy.annotation.Behaviour;
|
||||||
import org.alfresco.repo.policy.annotation.BehaviourBean;
|
import org.alfresco.repo.policy.annotation.BehaviourBean;
|
||||||
@@ -58,6 +59,7 @@ import org.alfresco.service.cmr.site.SiteVisibility;
|
|||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.util.ParameterCheck;
|
import org.alfresco.util.ParameterCheck;
|
||||||
import org.alfresco.util.PropertyMap;
|
import org.alfresco.util.PropertyMap;
|
||||||
|
import org.springframework.extensions.surf.util.I18NUtil;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
@@ -314,8 +316,7 @@ public class RmSiteType extends BaseBehaviourBean
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the limitation of creating only one rma:filePlan or one dod:filePlan depending on the type of rm site.
|
* Add the limitation of creating only one rma:filePlan or one dod:filePlan depending on the type of rm site.
|
||||||
* Let multiple cm:folder type be created under rm site.
|
* Also added the limitation of crating two cm:folder type under rm site.
|
||||||
*
|
|
||||||
*
|
*
|
||||||
* Other than this nothing can be created under rm site nodeRef
|
* Other than this nothing can be created under rm site nodeRef
|
||||||
*
|
*
|
||||||
@@ -343,6 +344,25 @@ public class RmSiteType extends BaseBehaviourBean
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overridden this because in this case we need to have multiple cm:folder types but not more than two of them.
|
||||||
|
* The two mentioned folders are created when rm site is created and one of them is Saved Searches and the other surf-config folder.
|
||||||
|
After that creation of cm:folder should not be allowed under rm site node
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void validateNewChildAssociation(NodeRef parent, NodeRef child, List<QName> acceptedUniqueChildType,
|
||||||
|
List<QName> acceptedMultipleChildType) throws IntegrityException
|
||||||
|
{
|
||||||
|
super.validateNewChildAssociation(parent, child, acceptedUniqueChildType, acceptedMultipleChildType);
|
||||||
|
|
||||||
|
// check the user is not trying to create more than 2 folders that are created by default.
|
||||||
|
if(nodeService.getChildAssocs(parent, Sets.newHashSet(ContentModel.TYPE_FOLDER)).size() > 2)
|
||||||
|
{
|
||||||
|
throw new IntegrityException(I18NUtil.getMessage(MULTIPLE_CHILDREN_TYPE_ERROR, ContentModel.TYPE_FOLDER), null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Behaviour
|
@Behaviour
|
||||||
(
|
(
|
||||||
kind = BehaviourKind.CLASS,
|
kind = BehaviourKind.CLASS,
|
||||||
|
@@ -1,111 +0,0 @@
|
|||||||
/*
|
|
||||||
* #%L
|
|
||||||
* Alfresco Records Management Module
|
|
||||||
* %%
|
|
||||||
* Copyright (C) 2005 - 2018 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.module.org_alfresco_module_rm.test.integration.issue;
|
|
||||||
|
|
||||||
import static org.alfresco.repo.site.SiteServiceImpl.getSiteContainer;
|
|
||||||
import static org.alfresco.util.GUID.generate;
|
|
||||||
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
|
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
|
||||||
import org.alfresco.service.cmr.site.SiteInfo;
|
|
||||||
import org.alfresco.service.cmr.site.SiteVisibility;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test class for MNT 19114, wiki page can not be created under RM site
|
|
||||||
*/
|
|
||||||
public class MNT19114Test extends BaseRMTestCase
|
|
||||||
{
|
|
||||||
public static final String PARENT_NODE = "RMSite";
|
|
||||||
public static final String DOCUMENT_LIBRARY_FOLDER_TYPE = "documentLibrary";
|
|
||||||
public static final String SURF_CONFIG_FOLDER_TYPE = "surfConfigFolder";
|
|
||||||
public static final String WIKI_PAGE_FOLDER_TYPE = "wikiPage";
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean isRMSiteTest()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Given a RM site and two folder type children
|
|
||||||
* When creating a third folder type child as a Wiki page
|
|
||||||
* The page will be created and no exception will be thrown.
|
|
||||||
*/
|
|
||||||
public void testCreateWikiPageInRmSite() throws Exception
|
|
||||||
{
|
|
||||||
doBehaviourDrivenTest(new BehaviourDrivenTest()
|
|
||||||
{
|
|
||||||
NodeRef wikiPage;
|
|
||||||
|
|
||||||
public void given()
|
|
||||||
{
|
|
||||||
// Creating a Records Management site
|
|
||||||
siteService.createSite("rmSite", PARENT_NODE, generate(), generate(), SiteVisibility.PUBLIC, TYPE_RM_SITE);
|
|
||||||
|
|
||||||
// Adding two immediate folder type children
|
|
||||||
getSiteContainer(
|
|
||||||
PARENT_NODE,
|
|
||||||
DOCUMENT_LIBRARY_FOLDER_TYPE,
|
|
||||||
true,
|
|
||||||
siteService,
|
|
||||||
transactionService,
|
|
||||||
taggingService);
|
|
||||||
getSiteContainer(
|
|
||||||
PARENT_NODE,
|
|
||||||
SURF_CONFIG_FOLDER_TYPE,
|
|
||||||
true,
|
|
||||||
siteService,
|
|
||||||
transactionService,
|
|
||||||
taggingService);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void when() throws Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
wikiPage = getSiteContainer(
|
|
||||||
PARENT_NODE,
|
|
||||||
WIKI_PAGE_FOLDER_TYPE,
|
|
||||||
true,
|
|
||||||
siteService,
|
|
||||||
transactionService,
|
|
||||||
taggingService);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void then() throws Exception
|
|
||||||
{
|
|
||||||
// Check if the new folder type wiki page has been created
|
|
||||||
assertEquals(true, nodeService.exists(wikiPage));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void after()
|
|
||||||
{
|
|
||||||
siteService.deleteSite(PARENT_NODE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@@ -32,8 +32,6 @@ import static org.mockito.Mockito.when;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model;
|
import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock;
|
import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest;
|
||||||
@@ -51,6 +49,8 @@ import org.mockito.InjectMocks;
|
|||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit test for RmSiteType
|
* Unit test for RmSiteType
|
||||||
*
|
*
|
||||||
@@ -151,7 +151,7 @@ public class RmSiteTypeUnitTest extends BaseUnitTest implements DOD5015Model
|
|||||||
* Given that we try to add more than two cm:folder to rm site,
|
* Given that we try to add more than two cm:folder to rm site,
|
||||||
* Then IntegrityException is thrown.
|
* Then IntegrityException is thrown.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test(expected = IntegrityException.class)
|
||||||
public void testAddMoreThanTwhoFolderTypeToRmSite()
|
public void testAddMoreThanTwhoFolderTypeToRmSite()
|
||||||
{
|
{
|
||||||
NodeRef rmSiteNodeRef = generateNodeRef(TYPE_RM_SITE, true);
|
NodeRef rmSiteNodeRef = generateNodeRef(TYPE_RM_SITE, true);
|
||||||
|
Reference in New Issue
Block a user