mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-07 18:25:23 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
57034: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3) 56501: Merged HEAD-BUG-FIX to V4.2-BUG-FIX (4.2.1) 55924: <<NOT IN 4.1.6>> Merged V4.1-BUG-FIX (4.1.7) to HEAD-BUG-FIX (4.2) 55706: Formatting during investigations of MNT-9510 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61667 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
1dcd0cd002
commit
fcd4ab8d01
@ -32,7 +32,6 @@ import java.util.ResourceBundle.Control;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
import org.alfresco.repo.copy.AbstractBaseCopyService.AssociationCopyInfo;
|
|
||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.query.CannedQueryFactory;
|
import org.alfresco.query.CannedQueryFactory;
|
||||||
@ -428,9 +427,7 @@ public class FileFolderServiceImpl extends AbstractBaseCopyService implements Fi
|
|||||||
return getPagingResults(pagingRequest, results);
|
return getPagingResults(pagingRequest, results);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Override
|
||||||
* @see org.alfresco.service.cmr.model.FileFolderService#list(org.alfresco.service.cmr.repository.NodeRef, boolean, boolean, String, java.util.Set, org.alfresco.service.cmr.model.PagingSortRequest)
|
|
||||||
*/
|
|
||||||
public PagingResults<FileInfo> list(NodeRef contextNodeRef, boolean files, boolean folders, String pattern, Set<QName> ignoreQNames, List<Pair<QName, Boolean>> sortProps, PagingRequest pagingRequest)
|
public PagingResults<FileInfo> list(NodeRef contextNodeRef, boolean files, boolean folders, String pattern, Set<QName> ignoreQNames, List<Pair<QName, Boolean>> sortProps, PagingRequest pagingRequest)
|
||||||
{
|
{
|
||||||
ParameterCheck.mandatory("contextNodeRef", contextNodeRef);
|
ParameterCheck.mandatory("contextNodeRef", contextNodeRef);
|
||||||
|
@ -224,24 +224,24 @@ public class GetChildrenCannedQuery extends AbstractCannedQueryPermissions<NodeR
|
|||||||
|
|
||||||
if(assocTypeQNames != null)
|
if(assocTypeQNames != null)
|
||||||
{
|
{
|
||||||
Set<Long> assocTypeQNameIds = qnameDAO.convertQNamesToIds(assocTypeQNames, false);
|
Set<Long> assocTypeQNameIds = qnameDAO.convertQNamesToIds(assocTypeQNames, false);
|
||||||
if (assocTypeQNameIds.size() > 0)
|
if (assocTypeQNameIds.size() > 0)
|
||||||
{
|
{
|
||||||
params.setAssocTypeQNameIds(assocTypeQNameIds);
|
params.setAssocTypeQNameIds(assocTypeQNameIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pattern != null)
|
if (pattern != null)
|
||||||
{
|
{
|
||||||
// TODO, check that we should be tied to the content model in this way. Perhaps a configurable property
|
// TODO, check that we should be tied to the content model in this way. Perhaps a configurable property
|
||||||
// name against which compare the pattern?
|
// name against which compare the pattern?
|
||||||
Pair<Long, QName> nameQName = qnameDAO.getQName(ContentModel.PROP_NAME);
|
Pair<Long, QName> nameQName = qnameDAO.getQName(ContentModel.PROP_NAME);
|
||||||
if(nameQName == null)
|
if(nameQName == null)
|
||||||
{
|
{
|
||||||
throw new AlfrescoRuntimeException("Unable to determine qname id of name property");
|
throw new AlfrescoRuntimeException("Unable to determine qname id of name property");
|
||||||
}
|
}
|
||||||
params.setNamePropertyQNameId(nameQName.getFirst());
|
params.setNamePropertyQNameId(nameQName.getFirst());
|
||||||
params.setPattern(pattern);
|
params.setPattern(pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<NodeRef> result;
|
final List<NodeRef> result;
|
||||||
@ -608,73 +608,73 @@ public class GetChildrenCannedQuery extends AbstractCannedQueryPermissions<NodeR
|
|||||||
|
|
||||||
protected class DefaultFilterSortChildQueryCallback implements FilterSortChildQueryCallback
|
protected class DefaultFilterSortChildQueryCallback implements FilterSortChildQueryCallback
|
||||||
{
|
{
|
||||||
private List<FilterSortNode> children;
|
private List<FilterSortNode> children;
|
||||||
private List<FilterProp> filterProps;
|
private List<FilterProp> filterProps;
|
||||||
private boolean applyFilter;
|
private boolean applyFilter;
|
||||||
private Set<QName> inclusiveAspects;
|
private Set<QName> inclusiveAspects;
|
||||||
private Set<QName> exclusiveAspects;
|
private Set<QName> exclusiveAspects;
|
||||||
|
|
||||||
public DefaultFilterSortChildQueryCallback(final List<FilterSortNode> children, final List<FilterProp> filterProps)
|
public DefaultFilterSortChildQueryCallback(final List<FilterSortNode> children, final List<FilterProp> filterProps)
|
||||||
{
|
{
|
||||||
this(children, filterProps, null, null);
|
this(children, filterProps, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultFilterSortChildQueryCallback(final List<FilterSortNode> children, final List<FilterProp> filterProps, Set<QName> inclusiveAspects, Set<QName> exclusiveAspects)
|
public DefaultFilterSortChildQueryCallback(final List<FilterSortNode> children, final List<FilterProp> filterProps, Set<QName> inclusiveAspects, Set<QName> exclusiveAspects)
|
||||||
{
|
{
|
||||||
this.children = children;
|
this.children = children;
|
||||||
this.filterProps = filterProps;
|
this.filterProps = filterProps;
|
||||||
this.applyFilter = (filterProps.size() > 0);
|
this.applyFilter = (filterProps.size() > 0);
|
||||||
this.inclusiveAspects = inclusiveAspects;
|
this.inclusiveAspects = inclusiveAspects;
|
||||||
this.exclusiveAspects = exclusiveAspects;
|
this.exclusiveAspects = exclusiveAspects;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(FilterSortNode node)
|
public boolean handle(FilterSortNode node)
|
||||||
{
|
{
|
||||||
if(include(node))
|
if(include(node))
|
||||||
{
|
{
|
||||||
children.add(node);
|
children.add(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
// More results
|
// More results
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean include(FilterSortNode node)
|
protected boolean include(FilterSortNode node)
|
||||||
{
|
{
|
||||||
// filter, if needed
|
// filter, if needed
|
||||||
return(!applyFilter || includeFilter(node.getPropVals(), filterProps)) && includeAspects(node.getNodeRef(), inclusiveAspects, exclusiveAspects);
|
return(!applyFilter || includeFilter(node.getPropVals(), filterProps)) && includeAspects(node.getNodeRef(), inclusiveAspects, exclusiveAspects);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected class DefaultUnsortedChildQueryCallback implements UnsortedChildQueryCallback
|
protected class DefaultUnsortedChildQueryCallback implements UnsortedChildQueryCallback
|
||||||
{
|
{
|
||||||
private List<NodeRef> rawResult;
|
private List<NodeRef> rawResult;
|
||||||
private int requestedCount;
|
private int requestedCount;
|
||||||
private Set<QName> inclusiveAspects;
|
private Set<QName> inclusiveAspects;
|
||||||
private Set<QName> exclusiveAspects;
|
private Set<QName> exclusiveAspects;
|
||||||
|
|
||||||
public DefaultUnsortedChildQueryCallback(final List<NodeRef> rawResult, final int requestedCount, Set<QName> inclusiveAspects, Set<QName> exclusiveAspects)
|
public DefaultUnsortedChildQueryCallback(final List<NodeRef> rawResult, final int requestedCount, Set<QName> inclusiveAspects, Set<QName> exclusiveAspects)
|
||||||
{
|
{
|
||||||
this.rawResult = rawResult;
|
this.rawResult = rawResult;
|
||||||
this.requestedCount = requestedCount;
|
this.requestedCount = requestedCount;
|
||||||
this.inclusiveAspects = inclusiveAspects;
|
this.inclusiveAspects = inclusiveAspects;
|
||||||
this.exclusiveAspects = exclusiveAspects;
|
this.exclusiveAspects = exclusiveAspects;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(NodeRef nodeRef)
|
public boolean handle(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
if(include(nodeRef))
|
if(include(nodeRef))
|
||||||
{
|
{
|
||||||
rawResult.add(tenantService.getBaseName(nodeRef));
|
rawResult.add(tenantService.getBaseName(nodeRef));
|
||||||
}
|
}
|
||||||
|
|
||||||
// More results ?
|
// More results ?
|
||||||
return (rawResult.size() < requestedCount);
|
return (rawResult.size() < requestedCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean include(NodeRef nodeRef)
|
protected boolean include(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
return includeAspects(nodeRef, inclusiveAspects, exclusiveAspects);
|
return includeAspects(nodeRef, inclusiveAspects, exclusiveAspects);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user