RM-2130 (Check classification after method execution, filtering results where appropriate)

+review RM-94

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/DEV/ENFORCE@107272 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2015-06-28 13:39:10 +00:00
parent 8fa46a4e14
commit d320b4dad6
17 changed files with 414 additions and 99 deletions

View File

@@ -25,12 +25,15 @@ import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Component;
/**
* Array Post Method Invocation Processor
*
* @author Tuna Aksoy
* @since 3.0
*/
@Component
public class ArrayPostMethodInvocationProcessor extends BasePostMethodInvocationProcessor
{
/**

View File

@@ -20,6 +20,7 @@ package org.alfresco.module.org_alfresco_module_rm.classification.interceptor.pr
import org.alfresco.service.cmr.repository.AssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.springframework.stereotype.Component;
/**
* AssociationRef Post Method Invocation Processor
@@ -27,6 +28,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
* @author Tuna Aksoy
* @since 3.0
*/
@Component
public class AssociationRefPostMethodInvocationProcessor extends AbstractPostMethodInvocationProcessor
{
/**

View File

@@ -22,6 +22,8 @@ import static org.alfresco.model.ContentModel.TYPE_CONTENT;
import java.util.Collection;
import javax.annotation.PostConstruct;
import org.alfresco.module.org_alfresco_module_rm.classification.ContentClassificationService;
import org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearanceService;
import org.alfresco.repo.cache.SimpleCache;
@@ -29,6 +31,8 @@ import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.util.Pair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
/**
* Base class for post method invocation processors
@@ -36,25 +40,32 @@ import org.alfresco.util.Pair;
* @author Tuna Aksoy
* @since 3.0
*/
@ContextConfiguration(locations = {"classpath:alfresco/module/org_alfresco_module_rm/classified-content-context.xml"})
public abstract class BasePostMethodInvocationProcessor
{
/** Node service */
@Autowired
private NodeService nodeService;
/** Dictionary service */
@Autowired
private DictionaryService dictionaryService;
/** Content classification service */
@Autowired
private ContentClassificationService contentClassificationService;
/** Security Clearance Service */
@Autowired
private SecurityClearanceService securityClearanceService;
/** Post method invocation processor */
@Autowired
private PostMethodInvocationProcessor postMethodInvocationProcessor;
/** Cache to hold the filtered node information */
private SimpleCache<Pair<String, NodeRef>, Pair<Boolean, NodeRef>> cache;
@Autowired
private SimpleCache<Pair<String, NodeRef>, Pair<Boolean, NodeRef>> basePostMethodInvocationProcessorCache;
/**
* @return the nodeService
@@ -101,7 +112,7 @@ public abstract class BasePostMethodInvocationProcessor
*/
protected SimpleCache<Pair<String, NodeRef>, Pair<Boolean, NodeRef>> getCache()
{
return this.cache;
return this.basePostMethodInvocationProcessorCache;
}
/**
@@ -149,7 +160,7 @@ public abstract class BasePostMethodInvocationProcessor
*/
public void setCache(SimpleCache<Pair<String, NodeRef>, Pair<Boolean, NodeRef>> cache)
{
this.cache = cache;
this.basePostMethodInvocationProcessorCache = cache;
}
/**
@@ -170,6 +181,7 @@ public abstract class BasePostMethodInvocationProcessor
/**
* Registers the post method invocation processors
*/
@PostConstruct
public void register()
{
getPostMethodInvocationProcessor().register(this);

View File

@@ -20,6 +20,7 @@ package org.alfresco.module.org_alfresco_module_rm.classification.interceptor.pr
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.springframework.stereotype.Component;
/**
* ChildAssociationRef Post Method Invocation Processor
@@ -27,6 +28,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
* @author Tuna Aksoy
* @since 3.0
*/
@Component
public class ChildAssociationRefPostMethodInvocationProcessor extends AbstractPostMethodInvocationProcessor
{
/**

View File

@@ -22,12 +22,15 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.springframework.stereotype.Component;
/**
* Collection Post Method Invocation Processor
*
* @author Tuna Aksoy
* @since 3.0
*/
@Component
public class CollectionPostMethodInvocationProcessor extends BasePostMethodInvocationProcessor
{
/**

View File

@@ -19,6 +19,7 @@
package org.alfresco.module.org_alfresco_module_rm.classification.interceptor.processor;
import org.alfresco.service.cmr.repository.NodeRef;
import org.springframework.stereotype.Component;
/**
* NodeRef Post Method Invocation Processor
@@ -26,6 +27,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
* @author Tuna Aksoy
* @since 3.0
*/
@Component
public class NodeRefPostMethodInvocationProcessor extends AbstractPostMethodInvocationProcessor
{
/**

View File

@@ -22,6 +22,7 @@ import java.util.List;
import org.alfresco.query.PagingResults;
import org.alfresco.util.Pair;
import org.springframework.stereotype.Component;
/**
* PagingResults Post Method Invocation Processor
@@ -29,6 +30,7 @@ import org.alfresco.util.Pair;
* @author Tuna Aksoy
* @since 3.0
*/
@Component
public class PagingResultsPostMethodInvocationProcessor extends BasePostMethodInvocationProcessor
{
/**

View File

@@ -20,6 +20,7 @@ package org.alfresco.module.org_alfresco_module_rm.classification.interceptor.pr
import org.alfresco.repo.security.permissions.PermissionCheckValue;
import org.alfresco.service.cmr.repository.NodeRef;
import org.springframework.stereotype.Component;
/**
* Permission Check Value Post Method Invocation Processor
@@ -27,6 +28,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
* @author Tuna Aksoy
* @since 3.0
*/
@Component
public class PermissionCheckValuePostMethodInvocationProcessor extends AbstractPostMethodInvocationProcessor
{
/**

View File

@@ -25,6 +25,7 @@ import java.util.Set;
import org.alfresco.repo.search.impl.querymodel.QueryEngineResults;
import org.alfresco.service.cmr.search.ResultSet;
import org.springframework.stereotype.Component;
/**
* A post method invocation processor for {@link QueryEngineResults}.
@@ -32,6 +33,7 @@ import org.alfresco.service.cmr.search.ResultSet;
* @author Tom Page
* @since 3.0
*/
@Component
public class QueryEngineResultsPostMethodInvocationProcessor extends BasePostMethodInvocationProcessor
{
/**

View File

@@ -30,6 +30,7 @@ import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.search.ResultSetMetaData;
import org.alfresco.service.cmr.search.ResultSetRow;
import org.alfresco.service.cmr.search.SearchParameters;
import org.springframework.stereotype.Component;
/**
* ResultSet Post Method Invocation Processor
@@ -37,6 +38,7 @@ import org.alfresco.service.cmr.search.SearchParameters;
* @author Tuna Aksoy
* @since 3.0
*/
@Component
public class ResultSetPostMethodInvocationProcessor extends BasePostMethodInvocationProcessor
{
/**

View File

@@ -20,6 +20,7 @@ package org.alfresco.module.org_alfresco_module_rm.classification.interceptor.pr
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.StoreRef;
import org.springframework.stereotype.Component;
/**
* StoreRef Post Method Invocation Processor
@@ -27,6 +28,7 @@ import org.alfresco.service.cmr.repository.StoreRef;
* @author Tuna Aksoy
* @since 3.0
*/
@Component
public class StoreRefPostMethodInvocationProcessor extends AbstractPostMethodInvocationProcessor
{
/**