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:
Tuna Aksoy
2015-06-28 19:50:07 +00:00
parent 158eaecf16
commit afa0ac0229
3 changed files with 14 additions and 5 deletions

View File

@@ -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>

View File

@@ -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 */

View File

@@ -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;
}
}