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 f53b4a81a6..0fb83bd483 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 @@ -127,6 +127,11 @@ --> + + + diff --git a/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/rm-doclist.lib.js b/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/rm-doclist.lib.js index 710eed6a2e..3fcdb888af 100644 --- a/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/rm-doclist.lib.js +++ b/rm-server/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/rm-doclist.lib.js @@ -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. diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/interceptor/processor/PagingResultsPostMethodInvocationProcessor.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/interceptor/processor/PagingResultsPostMethodInvocationProcessor.java new file mode 100644 index 0000000000..e4f68bbb9d --- /dev/null +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/classification/interceptor/processor/PagingResultsPostMethodInvocationProcessor.java @@ -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 . + */ +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 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 process(T object) + { + final PagingResults pagingResults = getClassName().cast(object); + List page = pagingResults.getPage(); + final List processedPage = getPostMethodInvocationProcessor().process(page); + + return (T) new PagingResults() + { + @Override + public String getQueryExecutionId() + { + return pagingResults.getQueryExecutionId(); + } + @Override + public List getPage() + { + return processedPage; + } + @Override + public boolean hasMoreItems() + { + // FIXME: hasMoreItems might not be correct + return pagingResults.hasMoreItems(); + } + @Override + public Pair getTotalResultCount() + { + int size = processedPage.size(); + return new Pair(size, size); + } + }; + } +}