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@107009 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -127,6 +127,11 @@
|
||||
</bean>
|
||||
-->
|
||||
|
||||
<bean id="pagingResultsPostMethodInvocationProcessor"
|
||||
parent="abstractPostMethodInvocationProcessor"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.classification.interceptor.processor.PagingResultsPostMethodInvocationProcessor">
|
||||
</bean>
|
||||
|
||||
<bean id="arrayPostMethodInvocationProcessor"
|
||||
parent="abstractPostMethodInvocationProcessor"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.classification.interceptor.processor.ArrayPostMethodInvocationProcessor">
|
||||
|
@@ -241,12 +241,7 @@ function rm_doclist_main()
|
||||
{
|
||||
// we have to check if we have read permission on the node parent as an error will be thrown if we try to
|
||||
// get the evaluated properties for a linked record whose parent we do not have read permissions for
|
||||
var parentReadable;
|
||||
try
|
||||
{
|
||||
parentReadable = (node.parent != null && node.parent.isContainer && node.parent.hasPermission("ReadRecords"));
|
||||
}
|
||||
catch(e){}
|
||||
var parentReadable = (node.parent != null && node.parent.isContainer && node.parent.hasPermission("ReadRecords"));
|
||||
if (!parentReadable) continue;
|
||||
|
||||
// Get evaluated properties.
|
||||
|
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.module.org_alfresco_module_rm.classification.interceptor.processor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.query.PagingResults;
|
||||
import org.alfresco.util.Pair;
|
||||
|
||||
/**
|
||||
* PagingResults Post Method Invocation Processor
|
||||
*
|
||||
* @author Tuna Aksoy
|
||||
* @since 3.0
|
||||
*/
|
||||
public class PagingResultsPostMethodInvocationProcessor extends BasePostMethodInvocationProcessor
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.classification.interceptor.processor.BasePostMethodInvocationProcessor#getClassName()
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
protected Class<PagingResults> getClassName()
|
||||
{
|
||||
return PagingResults.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.classification.interceptor.processor.BasePostMethodInvocationProcessor#process(java.lang.Object)
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public <T> T process(T object)
|
||||
{
|
||||
final PagingResults pagingResults = getClassName().cast(object);
|
||||
List page = pagingResults.getPage();
|
||||
final List processedPage = getPostMethodInvocationProcessor().process(page);
|
||||
|
||||
return (T) new PagingResults<T>()
|
||||
{
|
||||
@Override
|
||||
public String getQueryExecutionId()
|
||||
{
|
||||
return pagingResults.getQueryExecutionId();
|
||||
}
|
||||
@Override
|
||||
public List<T> getPage()
|
||||
{
|
||||
return processedPage;
|
||||
}
|
||||
@Override
|
||||
public boolean hasMoreItems()
|
||||
{
|
||||
// FIXME: hasMoreItems might not be correct
|
||||
return pagingResults.hasMoreItems();
|
||||
}
|
||||
@Override
|
||||
public Pair<Integer, Integer> getTotalResultCount()
|
||||
{
|
||||
int size = processedPage.size();
|
||||
return new Pair<Integer, Integer>(size, size);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user