mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
MNT-19114 - Made review changes
This commit is contained in:
@@ -27,20 +27,19 @@
|
|||||||
|
|
||||||
package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
|
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;
|
||||||
@@ -59,7 +58,6 @@ 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;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Behaviour associated with the RM Site type
|
* Behaviour associated with the RM Site type
|
||||||
@@ -342,18 +340,6 @@ public class RmSiteType extends BaseBehaviourBean
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Overridden this because in this case we need to have multiple cm:folder types.
|
|
||||||
* The two mentioned folders are created when rm site is created and those are Saved Searches and surf-config folder.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected void validateNewChildAssociation(NodeRef parent, NodeRef child, List<QName> acceptedUniqueChildType,
|
|
||||||
List<QName> acceptedMultipleChildType) throws IntegrityException
|
|
||||||
{
|
|
||||||
super.validateNewChildAssociation(parent, child, acceptedUniqueChildType, acceptedMultipleChildType);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Behaviour(kind = BehaviourKind.CLASS,
|
@Behaviour(kind = BehaviourKind.CLASS,
|
||||||
policy = "alf:onDeleteNode",
|
policy = "alf:onDeleteNode",
|
||||||
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT)
|
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT)
|
||||||
|
@@ -35,9 +35,9 @@ import org.alfresco.service.cmr.site.SiteInfo;
|
|||||||
import org.alfresco.service.cmr.site.SiteVisibility;
|
import org.alfresco.service.cmr.site.SiteVisibility;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for RM 19114, wiki page can not be created under RM site
|
* Test class for MNT 19114, wiki page can not be created under RM site
|
||||||
*/
|
*/
|
||||||
public class RM19114Test extends BaseRMTestCase
|
public class MNT19114Test extends BaseRMTestCase
|
||||||
{
|
{
|
||||||
public static final String PARENT_NODE = "RMSite";
|
public static final String PARENT_NODE = "RMSite";
|
||||||
public static final String DOCUMENT_LIBRARY_FOLDER_TYPE = "documentLibrary";
|
public static final String DOCUMENT_LIBRARY_FOLDER_TYPE = "documentLibrary";
|
||||||
@@ -57,74 +57,54 @@ public class RM19114Test extends BaseRMTestCase
|
|||||||
*/
|
*/
|
||||||
public void testCreateWikiPageInRmSite() throws Exception
|
public void testCreateWikiPageInRmSite() throws Exception
|
||||||
{
|
{
|
||||||
doBehaviourDrivenTest(new BehaviourDrivenTest(null, false)
|
doBehaviourDrivenTest(new BehaviourDrivenTest()
|
||||||
{
|
{
|
||||||
NodeRef wikiPage;
|
NodeRef wikiPage;
|
||||||
|
|
||||||
public void given()
|
public void given()
|
||||||
{
|
{
|
||||||
doTestInTransaction(new VoidTest()
|
// Creating a Records Management site
|
||||||
{
|
siteService.createSite("rmSite", PARENT_NODE, generate(), generate(), SiteVisibility.PUBLIC, TYPE_RM_SITE);
|
||||||
public void runImpl() throws Exception
|
|
||||||
{
|
|
||||||
// Creating a Records Management site
|
|
||||||
SiteInfo rmSite= siteService.createSite("rmSite", PARENT_NODE, generate(), generate(), SiteVisibility.PUBLIC, TYPE_RM_SITE);
|
|
||||||
|
|
||||||
// Adding two immediate folder type children
|
// Adding two immediate folder type children
|
||||||
getSiteContainer(
|
getSiteContainer(
|
||||||
PARENT_NODE,
|
PARENT_NODE,
|
||||||
DOCUMENT_LIBRARY_FOLDER_TYPE,
|
DOCUMENT_LIBRARY_FOLDER_TYPE,
|
||||||
true,
|
true,
|
||||||
siteService,
|
siteService,
|
||||||
transactionService,
|
transactionService,
|
||||||
taggingService);
|
taggingService);
|
||||||
getSiteContainer(
|
getSiteContainer(
|
||||||
PARENT_NODE,
|
PARENT_NODE,
|
||||||
SURF_CONFIG_FOLDER_TYPE,
|
SURF_CONFIG_FOLDER_TYPE,
|
||||||
true,
|
true,
|
||||||
siteService,
|
siteService,
|
||||||
transactionService,
|
transactionService,
|
||||||
taggingService);
|
taggingService);
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void when() throws Exception
|
public void when() throws Exception
|
||||||
{
|
{
|
||||||
doTestInTransaction(new VoidTest()
|
|
||||||
{
|
|
||||||
public void runImpl() throws Exception
|
|
||||||
{
|
|
||||||
wikiPage = getSiteContainer(
|
|
||||||
PARENT_NODE,
|
|
||||||
WIKI_PAGE_FOLDER_TYPE,
|
|
||||||
true,
|
|
||||||
siteService,
|
|
||||||
transactionService,
|
|
||||||
taggingService);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
wikiPage = getSiteContainer(
|
||||||
|
PARENT_NODE,
|
||||||
|
WIKI_PAGE_FOLDER_TYPE,
|
||||||
|
true,
|
||||||
|
siteService,
|
||||||
|
transactionService,
|
||||||
|
taggingService);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void then() throws Exception
|
public void then() throws Exception
|
||||||
{
|
{
|
||||||
doTestInTransaction(new VoidTest()
|
// Check if the new folder type wiki page has been created
|
||||||
{
|
assertEquals(true, nodeService.exists(wikiPage));
|
||||||
public void runImpl() throws Exception
|
|
||||||
{
|
|
||||||
assertEquals( true, nodeService.exists(wikiPage));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void after(){
|
public void after()
|
||||||
doTestInTransaction(new VoidTest()
|
{
|
||||||
{
|
siteService.deleteSite(PARENT_NODE);
|
||||||
public void runImpl() throws Exception
|
|
||||||
{
|
|
||||||
siteService.deleteSite(PARENT_NODE);}});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
Reference in New Issue
Block a user