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@107164 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||||
xsi:schemaLocation="
|
xsi:schemaLocation="
|
||||||
http://www.springframework.org/schema/beans
|
http://www.springframework.org/schema/beans
|
||||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||||
http://www.springframework.org/schema/aop
|
http://www.springframework.org/schema/aop
|
||||||
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd ">
|
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd ">
|
||||||
|
|
||||||
<!-- Classified content model bootstrap -->
|
<!-- Classified content model bootstrap -->
|
||||||
|
|
||||||
@@ -60,13 +60,17 @@
|
|||||||
<bean id="classificationMethodInterceptorPostProcessor"
|
<bean id="classificationMethodInterceptorPostProcessor"
|
||||||
class="org.alfresco.module.org_alfresco_module_rm.classification.interceptor.ClassificationMethodInterceptorPostProcessor" />
|
class="org.alfresco.module.org_alfresco_module_rm.classification.interceptor.ClassificationMethodInterceptorPostProcessor" />
|
||||||
|
|
||||||
|
<bean id="basePostMethodInvocationProcessorCache" class="org.alfresco.repo.cache.DefaultSimpleCache" />
|
||||||
|
|
||||||
<bean id="basePostMethodInvocationProcessor"
|
<bean id="basePostMethodInvocationProcessor"
|
||||||
abstract="true"
|
abstract="true"
|
||||||
init-method="register">
|
init-method="register">
|
||||||
<property name="nodeService" ref="NodeService" />
|
<property name="nodeService" ref="NodeService" />
|
||||||
<property name="dictionaryService" ref="DictionaryService" />
|
<property name="dictionaryService" ref="DictionaryService" />
|
||||||
<property name="contentClassificationService" ref="ContentClassificationService" />
|
<property name="contentClassificationService" ref="ContentClassificationService" />
|
||||||
|
<property name="securityClearanceService" ref="SecurityClearanceService" />
|
||||||
<property name="postMethodInvocationProcessor" ref="postMethodInvocationProcessor" />
|
<property name="postMethodInvocationProcessor" ref="postMethodInvocationProcessor" />
|
||||||
|
<property name="cache" ref="basePostMethodInvocationProcessorCache" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="abstractPostMethodInvocationProcessor"
|
<bean id="abstractPostMethodInvocationProcessor"
|
||||||
|
@@ -23,9 +23,12 @@ import static org.alfresco.model.ContentModel.TYPE_CONTENT;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.classification.ContentClassificationService;
|
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;
|
||||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
|
import org.alfresco.util.Pair;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for post method invocation processors
|
* Base class for post method invocation processors
|
||||||
@@ -44,9 +47,15 @@ public abstract class BasePostMethodInvocationProcessor
|
|||||||
/** Content classification service */
|
/** Content classification service */
|
||||||
private ContentClassificationService contentClassificationService;
|
private ContentClassificationService contentClassificationService;
|
||||||
|
|
||||||
|
/** Security Clearance Service */
|
||||||
|
private SecurityClearanceService securityClearanceService;
|
||||||
|
|
||||||
/** Post method invocation processor */
|
/** Post method invocation processor */
|
||||||
private PostMethodInvocationProcessor postMethodInvocationProcessor;
|
private PostMethodInvocationProcessor postMethodInvocationProcessor;
|
||||||
|
|
||||||
|
/** Cache to hold the filtered node information */
|
||||||
|
private SimpleCache<Pair<String, NodeRef>, Pair<Boolean, NodeRef>> cache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the nodeService
|
* @return the nodeService
|
||||||
*/
|
*/
|
||||||
@@ -71,6 +80,14 @@ public abstract class BasePostMethodInvocationProcessor
|
|||||||
return this.contentClassificationService;
|
return this.contentClassificationService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the securityClearanceService
|
||||||
|
*/
|
||||||
|
protected SecurityClearanceService getSecurityClearanceService()
|
||||||
|
{
|
||||||
|
return this.securityClearanceService;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the postMethodInvocationProcessor
|
* @return the postMethodInvocationProcessor
|
||||||
*/
|
*/
|
||||||
@@ -79,6 +96,14 @@ public abstract class BasePostMethodInvocationProcessor
|
|||||||
return this.postMethodInvocationProcessor;
|
return this.postMethodInvocationProcessor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the cache
|
||||||
|
*/
|
||||||
|
protected SimpleCache<Pair<String, NodeRef>, Pair<Boolean, NodeRef>> getCache()
|
||||||
|
{
|
||||||
|
return this.cache;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param nodeService the nodeService to set
|
* @param nodeService the nodeService to set
|
||||||
*/
|
*/
|
||||||
@@ -103,6 +128,14 @@ public abstract class BasePostMethodInvocationProcessor
|
|||||||
this.contentClassificationService = contentClassificationService;
|
this.contentClassificationService = contentClassificationService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param securityClearanceService the securityClearanceService to set
|
||||||
|
*/
|
||||||
|
public void setSecurityClearanceService(SecurityClearanceService securityClearanceService)
|
||||||
|
{
|
||||||
|
this.securityClearanceService = securityClearanceService;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param postMethodInvocationProcessor the postMethodInvocationProcessor to set
|
* @param postMethodInvocationProcessor the postMethodInvocationProcessor to set
|
||||||
*/
|
*/
|
||||||
@@ -111,6 +144,14 @@ public abstract class BasePostMethodInvocationProcessor
|
|||||||
this.postMethodInvocationProcessor = postMethodInvocationProcessor;
|
this.postMethodInvocationProcessor = postMethodInvocationProcessor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param cache the cache to set
|
||||||
|
*/
|
||||||
|
public void setCache(SimpleCache<Pair<String, NodeRef>, Pair<Boolean, NodeRef>> cache)
|
||||||
|
{
|
||||||
|
this.cache = cache;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the class name
|
* Gets the class name
|
||||||
*
|
*
|
||||||
@@ -164,6 +205,29 @@ public abstract class BasePostMethodInvocationProcessor
|
|||||||
filter = null;
|
filter = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (filter != null)
|
||||||
|
// {
|
||||||
|
// String uniqueCacheKey = getFullyAuthenticatedUser() /*+ userClearance?*/;
|
||||||
|
//
|
||||||
|
// Pair<String, NodeRef> cacheKey = new Pair<String, NodeRef>(uniqueCacheKey, filter);
|
||||||
|
// Pair<Boolean, NodeRef> cacheValue = getCache().get(cacheKey);
|
||||||
|
//
|
||||||
|
// if (cacheValue == null || !cacheValue.getFirst().booleanValue())
|
||||||
|
// {
|
||||||
|
// if (getNodeService().exists(nodeRef) &&
|
||||||
|
// getDictionaryService().isSubClass(getNodeService().getType(nodeRef), TYPE_CONTENT) &&
|
||||||
|
// !getContentClassificationService().hasClearance(nodeRef))
|
||||||
|
// {
|
||||||
|
// filter = null;
|
||||||
|
// }
|
||||||
|
// getCache().put(new Pair<String, NodeRef>(uniqueCacheKey, nodeRef), new Pair<Boolean, NodeRef>(true, filter));
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// filter = getCache().get(cacheKey).getSecond();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user