mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
@@ -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
|
||||
{
|
||||
/**
|
||||
|
@@ -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
|
||||
{
|
||||
/**
|
||||
|
@@ -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);
|
||||
|
@@ -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
|
||||
{
|
||||
/**
|
||||
|
@@ -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
|
||||
{
|
||||
/**
|
||||
|
@@ -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
|
||||
{
|
||||
/**
|
||||
|
@@ -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
|
||||
{
|
||||
/**
|
||||
|
@@ -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
|
||||
{
|
||||
/**
|
||||
|
@@ -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
|
||||
{
|
||||
/**
|
||||
|
@@ -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
|
||||
{
|
||||
/**
|
||||
|
@@ -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
|
||||
{
|
||||
/**
|
||||
|
Reference in New Issue
Block a user