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@107275 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -430,7 +430,7 @@
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>2.5</version>
|
||||
<scope>provided</scope>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
|
@@ -32,7 +32,6 @@ 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
|
||||
@@ -40,7 +39,6 @@ import org.springframework.test.context.ContextConfiguration;
|
||||
* @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 */
|
||||
|
@@ -46,14 +46,25 @@ public class ChildAssociationRefPostMethodInvocationProcessor extends AbstractPo
|
||||
@Override
|
||||
protected <T> T processSingleElement(T object)
|
||||
{
|
||||
T result;
|
||||
|
||||
ChildAssociationRef childAssociationRef = getClassName().cast(object);
|
||||
|
||||
NodeRef childRef = childAssociationRef.getChildRef();
|
||||
NodeRef filteredChildRef = filter(childRef);
|
||||
|
||||
NodeRef parentRef = childAssociationRef.getParentRef();
|
||||
NodeRef filteredParentRef = filter(parentRef);
|
||||
NodeRef filteredParentRef;
|
||||
if (parentRef == null)
|
||||
{
|
||||
result = filteredChildRef == null ? null : object;
|
||||
}
|
||||
else
|
||||
{
|
||||
filteredParentRef = filter(parentRef);
|
||||
result = (filteredChildRef == null || filteredParentRef == null) ? null : object;
|
||||
}
|
||||
|
||||
return (filteredChildRef == null || filteredParentRef == null) ? null : object;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user