mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V4.1-BUG-FIX to HEAD
38869: Merged BRANCHES/DEV/AMILLER/CLOUD1 to BRANCHES/DEV/V4.1-BUG-FIX 38762: Site can not be created when (site count) quota exceeded Refactor core code to return "400 - Bad request," with indicative message, when a duplicate url is submitted. 38897: ALF-13969: Tomcat shutdown with WARNING: Problem with directory [/opt/alfresco-4.0.1/tomcat/shared/lib], exists: [false], isDirectory: [false], canRead: [false] - Removed ${catalina.base}/shared/lib/*.jar from shared.loader definition in catalina.properties - Will update Wiki next 38908: Fix for failing test since createSite change 38939: Moved schema version up to 5100 (and 5101 for 'patch.show.audit') 38941: Moved schema version up to 5110 (and 5111 for 'patch.show.audit') ... leave root for V4.1.0.x 38953: ALF-14766: Ensure that DocLib tree drop targets are correctly set after creating new folders 38954: Fix for ALF-14475: "CMIS : Wrong cmisra:numItems in folder sites and below with /cmisatom binding url" 38974: Minor: removed unused code 38987: ALF-13228 - updated manage permissions to handle custom group settings 39006: Fix for ALF-14475 part 2: "CMIS : Wrong cmisra:numItems in folder sites and below with /cmisatom binding url" 39022: Merge solution for ALF-13972 39038: ALF-14388: Merge V3.4-BUG-FIX (3.4.11) to V4.1-BUG-FIX (4.1.1) 39037: ALF-15069 CLONE - Edit Online option is not supported for '.docm', 'dotm', '.xlsm' files - Added "Online Edit" support for: docx docm dotx dotm - doc and docx were already supported pptm ppsx ppsm potx potm ppam sldx sldm - ppt and pptx were already supported xltx xlsm xltm xlam xlsb - xls and xlsx were already supported 39065: ALF-14861 SOLR to scale for non-admin users in 100k sites and a subgroup of each of 1000 independent groupings with 1000 subgroups - first round of fixes on the SOLR side - ACL lookup improved and reduced the number of Long objects created - Specific cache and configuration for PATH queries (with admin reporting) - Specfic cache and configuration for AUTHORITY queries (with admin reporting) - PATH and AUTHORITY queries cache the LEAF result (and not the AUX result which requires lots of extra work) - cache works better with lucene query implementation - AUTHORITY query supports AUTHORITIES separated by "|" 39135: Fix for ALF-15071 SOLR: Typographical offence in log output 39152: ALF-13211: Accepted path for preventing NPE when viewing JBPM sub-process which has no start-task 39175: Merge DEV to V4.1-BUG-FIX (4.1.1) 39161: ALF-14956 : Folder within a Folder navigation issue. Fix for browsing to folders from not first page of a parent folder. 39191: ALF-14863: no scope is available when ScriptNode is used from within Activiti expression, causes issue when scope is needed (eg. creating javascript-arrays) + fixed typo in activiti-source jars 39192: Fix for ALF-12209 Incorrect behavior on View Realtionship for the user who has no permissions - skip relationships to objects that can not be seen. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@40263 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -125,6 +125,18 @@ public class GetChildrenCannedQuery extends AbstractCannedQueryPermissions<NodeR
|
||||
}
|
||||
}
|
||||
|
||||
protected FilterSortChildQueryCallback getFilterSortChildQuery(final List<FilterSortNode> children, final List<FilterProp> filterProps)
|
||||
{
|
||||
FilterSortChildQueryCallback callback = new DefaultFilterSortChildQueryCallback(children, filterProps);
|
||||
return callback;
|
||||
}
|
||||
|
||||
protected UnsortedChildQueryCallback getUnsortedChildQueryCallback(final List<NodeRef> rawResult, final int requestedCount)
|
||||
{
|
||||
UnsortedChildQueryCallback callback = new DefaultUnsortedChildQueryCallback(rawResult, requestedCount);
|
||||
return callback;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<NodeRef> queryAndFilter(CannedQueryParameters parameters)
|
||||
{
|
||||
@@ -228,25 +240,8 @@ public class GetChildrenCannedQuery extends AbstractCannedQueryPermissions<NodeR
|
||||
{
|
||||
// filtered and/or sorted - note: permissions will be applied post query
|
||||
final List<FilterSortNode> children = new ArrayList<FilterSortNode>(100);
|
||||
|
||||
final boolean applyFilter = (filterProps.size() > 0);
|
||||
|
||||
FilterSortChildQueryCallback callback = new FilterSortChildQueryCallback()
|
||||
{
|
||||
public boolean handle(FilterSortNode node)
|
||||
{
|
||||
// filter, if needed
|
||||
if ((! applyFilter) || includeFilter(node.getPropVals(), filterProps))
|
||||
{
|
||||
children.add(node);
|
||||
}
|
||||
|
||||
// More results
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
FilterSortResultHandler resultHandler = new FilterSortResultHandler(callback);
|
||||
final FilterSortChildQueryCallback c = getFilterSortChildQuery(children, filterProps);
|
||||
FilterSortResultHandler resultHandler = new FilterSortResultHandler(c);
|
||||
cannedQueryDAO.executeQuery(QUERY_NAMESPACE, QUERY_SELECT_GET_CHILDREN_WITH_PROPS, params, 0, Integer.MAX_VALUE, resultHandler);
|
||||
resultHandler.done();
|
||||
|
||||
@@ -269,17 +264,7 @@ public class GetChildrenCannedQuery extends AbstractCannedQueryPermissions<NodeR
|
||||
final int requestedCount = parameters.getResultsRequired();
|
||||
|
||||
final List<NodeRef> rawResult = new ArrayList<NodeRef>(Math.min(1000, requestedCount));
|
||||
UnsortedChildQueryCallback callback = new UnsortedChildQueryCallback()
|
||||
{
|
||||
public boolean handle(NodeRef nodeRef)
|
||||
{
|
||||
rawResult.add(tenantService.getBaseName(nodeRef));
|
||||
|
||||
// More results ?
|
||||
return (rawResult.size() < requestedCount);
|
||||
}
|
||||
};
|
||||
|
||||
UnsortedChildQueryCallback callback = getUnsortedChildQueryCallback(rawResult, requestedCount);
|
||||
UnsortedResultHandler resultHandler = new UnsortedResultHandler(callback);
|
||||
cannedQueryDAO.executeQuery(QUERY_NAMESPACE, QUERY_SELECT_GET_CHILDREN_WITHOUT_PROPS, params, 0, Integer.MAX_VALUE, resultHandler);
|
||||
resultHandler.done();
|
||||
@@ -544,18 +529,79 @@ public class GetChildrenCannedQuery extends AbstractCannedQueryPermissions<NodeR
|
||||
logger.trace("Pre-load: "+nodeRefs.size()+" in "+(System.currentTimeMillis()-start)+" msecs");
|
||||
}
|
||||
}
|
||||
|
||||
private interface FilterSortChildQueryCallback
|
||||
|
||||
protected interface FilterSortChildQueryCallback
|
||||
{
|
||||
boolean handle(FilterSortNode node);
|
||||
}
|
||||
|
||||
private interface UnsortedChildQueryCallback
|
||||
protected class DefaultFilterSortChildQueryCallback implements FilterSortChildQueryCallback
|
||||
{
|
||||
private List<FilterSortNode> children;
|
||||
private List<FilterProp> filterProps;
|
||||
private boolean applyFilter;
|
||||
|
||||
public DefaultFilterSortChildQueryCallback(final List<FilterSortNode> children, final List<FilterProp> filterProps)
|
||||
{
|
||||
this.children = children;
|
||||
this.filterProps = filterProps;
|
||||
this.applyFilter = (filterProps.size() > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(FilterSortNode node)
|
||||
{
|
||||
if(include(node))
|
||||
{
|
||||
children.add(node);
|
||||
}
|
||||
|
||||
// More results
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean include(FilterSortNode node)
|
||||
{
|
||||
// filter, if needed
|
||||
return(!applyFilter || includeFilter(node.getPropVals(), filterProps));
|
||||
}
|
||||
}
|
||||
|
||||
protected class DefaultUnsortedChildQueryCallback implements UnsortedChildQueryCallback
|
||||
{
|
||||
private List<NodeRef> rawResult;
|
||||
private int requestedCount;
|
||||
|
||||
public DefaultUnsortedChildQueryCallback(final List<NodeRef> rawResult, final int requestedCount)
|
||||
{
|
||||
this.rawResult = rawResult;
|
||||
this.requestedCount = requestedCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(NodeRef nodeRef)
|
||||
{
|
||||
if(include(nodeRef))
|
||||
{
|
||||
rawResult.add(tenantService.getBaseName(nodeRef));
|
||||
}
|
||||
|
||||
// More results ?
|
||||
return (rawResult.size() < requestedCount);
|
||||
}
|
||||
|
||||
protected boolean include(NodeRef nodeRef)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
protected interface UnsortedChildQueryCallback
|
||||
{
|
||||
boolean handle(NodeRef nodeRef);
|
||||
}
|
||||
|
||||
private class FilterSortResultHandler implements CannedQueryDAO.ResultHandler<FilterSortNodeEntity>
|
||||
protected class FilterSortResultHandler implements CannedQueryDAO.ResultHandler<FilterSortNodeEntity>
|
||||
{
|
||||
private final FilterSortChildQueryCallback resultsCallback;
|
||||
private boolean more = true;
|
||||
@@ -656,7 +702,7 @@ public class GetChildrenCannedQuery extends AbstractCannedQueryPermissions<NodeR
|
||||
}
|
||||
}
|
||||
|
||||
private class FilterSortNode
|
||||
protected class FilterSortNode
|
||||
{
|
||||
private NodeRef nodeRef;
|
||||
private Map<QName, Serializable> propVals; // subset of nodes properties - used for filtering and/or sorting
|
||||
|
Reference in New Issue
Block a user