diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/classified-content-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/classified-content-context.xml index d2bb45a2c0..a222a6e7ac 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/classified-content-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/classified-content-context.xml @@ -56,6 +56,11 @@ class="org.alfresco.module.org_alfresco_module_rm.classification.interceptor.processor.NodeRefPostMethodInvocationProcessor"> + + + diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/interceptor/processor/CollectionPostMethodInvocationProcessor.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/interceptor/processor/CollectionPostMethodInvocationProcessor.java index b65bd326f2..4cb567777d 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/interceptor/processor/CollectionPostMethodInvocationProcessor.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/interceptor/processor/CollectionPostMethodInvocationProcessor.java @@ -137,7 +137,7 @@ public abstract class CollectionPostMethodInvocationProcessor extends BasePostMe @SuppressWarnings({ "rawtypes", "unchecked" }) private Collection processNodeRef(Collection collection, Iterator iterator) { - CollectionUtils.filter(collection, new Filter() + return CollectionUtils.filter(collection, new Filter() { @Override public Boolean apply(NodeRef nodeRef) @@ -145,8 +145,6 @@ public abstract class CollectionPostMethodInvocationProcessor extends BasePostMe return getNodeRefPostMethodInvocationProcessor().process(nodeRef) != null; } }); - - return collection; } /** @@ -158,7 +156,7 @@ public abstract class CollectionPostMethodInvocationProcessor extends BasePostMe @SuppressWarnings({ "rawtypes", "unchecked" }) private Collection processAssociationRef(Collection collection, Iterator iterator) { - CollectionUtils.filter(collection, new Filter() + return CollectionUtils.filter(collection, new Filter() { @Override public Boolean apply(AssociationRef associationRef) @@ -166,8 +164,6 @@ public abstract class CollectionPostMethodInvocationProcessor extends BasePostMe return getAssociationRefPostMethodInvocationProcessor().process(associationRef) != null; } }); - - return collection; } /** @@ -179,7 +175,7 @@ public abstract class CollectionPostMethodInvocationProcessor extends BasePostMe @SuppressWarnings({ "rawtypes", "unchecked" }) private Collection processChildAssociationRef(Collection collection, Iterator iterator) { - CollectionUtils.filter(collection, new Filter() + return CollectionUtils.filter(collection, new Filter() { @Override public Boolean apply(ChildAssociationRef childAssociationRef) @@ -187,7 +183,5 @@ public abstract class CollectionPostMethodInvocationProcessor extends BasePostMe return getChildAssociationRefPostMethodInvocationProcessor().process(childAssociationRef) != null; } }); - - return collection; } } diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/interceptor/processor/StoreRefPostMethodInvocationProcessor.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/interceptor/processor/StoreRefPostMethodInvocationProcessor.java new file mode 100644 index 0000000000..f0a387829d --- /dev/null +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/interceptor/processor/StoreRefPostMethodInvocationProcessor.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2005-2015 Alfresco Software Limited. + * + * This file is part of Alfresco + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ +package org.alfresco.module.org_alfresco_module_rm.classification.interceptor.processor; + +import static org.alfresco.util.ParameterCheck.mandatory; + +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.StoreRef; + +/** + * StoreRef Post Method Invocation Processor + * + * @author Tuna Aksoy + * @since 3.0 + */ +public class StoreRefPostMethodInvocationProcessor extends BasePostMethodInvocationProcessor +{ + /** + * @see org.alfresco.module.org_alfresco_module_rm.classification.interceptor.processor.BasePostMethodInvocationProcessor#getClassName() + */ + @Override + public Class getClassName() + { + return StoreRef.class; + } + + /** + * @see org.alfresco.module.org_alfresco_module_rm.classification.interceptor.processor.BasePostMethodInvocationProcessor#process(java.lang.Object) + */ + @Override + public T process(T object) + { + mandatory("object", object); + + NodeRef nodeRef = getNodeService().getRootNode((StoreRef) object); + + return filter(nodeRef) == null ? null : object; + } +}