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>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-test</artifactId>
|
<artifactId>spring-test</artifactId>
|
||||||
<version>2.5</version>
|
<version>2.5</version>
|
||||||
<scope>provided</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.alfresco</groupId>
|
<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.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.util.Pair;
|
import org.alfresco.util.Pair;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for post method invocation processors
|
* Base class for post method invocation processors
|
||||||
@@ -40,7 +39,6 @@ import org.springframework.test.context.ContextConfiguration;
|
|||||||
* @author Tuna Aksoy
|
* @author Tuna Aksoy
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
@ContextConfiguration(locations = {"classpath:alfresco/module/org_alfresco_module_rm/classified-content-context.xml"})
|
|
||||||
public abstract class BasePostMethodInvocationProcessor
|
public abstract class BasePostMethodInvocationProcessor
|
||||||
{
|
{
|
||||||
/** Node service */
|
/** Node service */
|
||||||
|
@@ -46,14 +46,25 @@ public class ChildAssociationRefPostMethodInvocationProcessor extends AbstractPo
|
|||||||
@Override
|
@Override
|
||||||
protected <T> T processSingleElement(T object)
|
protected <T> T processSingleElement(T object)
|
||||||
{
|
{
|
||||||
|
T result;
|
||||||
|
|
||||||
ChildAssociationRef childAssociationRef = getClassName().cast(object);
|
ChildAssociationRef childAssociationRef = getClassName().cast(object);
|
||||||
|
|
||||||
NodeRef childRef = childAssociationRef.getChildRef();
|
NodeRef childRef = childAssociationRef.getChildRef();
|
||||||
NodeRef filteredChildRef = filter(childRef);
|
NodeRef filteredChildRef = filter(childRef);
|
||||||
|
|
||||||
NodeRef parentRef = childAssociationRef.getParentRef();
|
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