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:
Alan Davis 2014-02-11 18:46:30 +00:00
parent 1dcd0cd002
commit fcd4ab8d01
2 changed files with 46 additions and 49 deletions

View File

@ -32,7 +32,6 @@ import java.util.ResourceBundle.Control;
import java.util.Set;
import java.util.Stack;
import org.alfresco.repo.copy.AbstractBaseCopyService.AssociationCopyInfo;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.query.CannedQueryFactory;
@ -428,9 +427,7 @@ public class FileFolderServiceImpl extends AbstractBaseCopyService implements Fi
return getPagingResults(pagingRequest, results);
}
/* (non-Javadoc)
* @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)
*/
@Override
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);

View File

@ -224,24 +224,24 @@ public class GetChildrenCannedQuery extends AbstractCannedQueryPermissions<NodeR
if(assocTypeQNames != null)
{
Set<Long> assocTypeQNameIds = qnameDAO.convertQNamesToIds(assocTypeQNames, false);
Set<Long> assocTypeQNameIds = qnameDAO.convertQNamesToIds(assocTypeQNames, false);
if (assocTypeQNameIds.size() > 0)
{
params.setAssocTypeQNameIds(assocTypeQNameIds);
params.setAssocTypeQNameIds(assocTypeQNameIds);
}
}
if (pattern != null)
{
// TODO, check that we should be tied to the content model in this way. Perhaps a configurable property
// name against which compare the pattern?
Pair<Long, QName> nameQName = qnameDAO.getQName(ContentModel.PROP_NAME);
if(nameQName == null)
{
throw new AlfrescoRuntimeException("Unable to determine qname id of name property");
}
params.setNamePropertyQNameId(nameQName.getFirst());
params.setPattern(pattern);
// TODO, check that we should be tied to the content model in this way. Perhaps a configurable property
// name against which compare the pattern?
Pair<Long, QName> nameQName = qnameDAO.getQName(ContentModel.PROP_NAME);
if(nameQName == null)
{
throw new AlfrescoRuntimeException("Unable to determine qname id of name property");
}
params.setNamePropertyQNameId(nameQName.getFirst());
params.setPattern(pattern);
}
final List<NodeRef> result;
@ -608,73 +608,73 @@ public class GetChildrenCannedQuery extends AbstractCannedQueryPermissions<NodeR
protected class DefaultFilterSortChildQueryCallback implements FilterSortChildQueryCallback
{
private List<FilterSortNode> children;
private List<FilterProp> filterProps;
private boolean applyFilter;
private List<FilterSortNode> children;
private List<FilterProp> filterProps;
private boolean applyFilter;
private Set<QName> inclusiveAspects;
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);
}
public DefaultFilterSortChildQueryCallback(final List<FilterSortNode> children, final List<FilterProp> filterProps, Set<QName> inclusiveAspects, Set<QName> exclusiveAspects)
{
this.children = children;
this.filterProps = filterProps;
this.children = children;
this.filterProps = filterProps;
this.applyFilter = (filterProps.size() > 0);
this.inclusiveAspects = inclusiveAspects;
this.exclusiveAspects = exclusiveAspects;
}
}
@Override
public boolean handle(FilterSortNode node)
{
if(include(node))
{
@Override
public boolean handle(FilterSortNode node)
{
if(include(node))
{
children.add(node);
}
}
// More results
return true;
}
protected boolean include(FilterSortNode node)
{
}
protected boolean include(FilterSortNode node)
{
// filter, if needed
return(!applyFilter || includeFilter(node.getPropVals(), filterProps)) && includeAspects(node.getNodeRef(), inclusiveAspects, exclusiveAspects);
}
}
}
protected class DefaultUnsortedChildQueryCallback implements UnsortedChildQueryCallback
{
private List<NodeRef> rawResult;
private int requestedCount;
private List<NodeRef> rawResult;
private int requestedCount;
private Set<QName> inclusiveAspects;
private Set<QName> exclusiveAspects;
public DefaultUnsortedChildQueryCallback(final List<NodeRef> rawResult, final int requestedCount, Set<QName> inclusiveAspects, Set<QName> exclusiveAspects)
{
this.rawResult = rawResult;
this.requestedCount = requestedCount;
{
this.rawResult = rawResult;
this.requestedCount = requestedCount;
this.inclusiveAspects = inclusiveAspects;
this.exclusiveAspects = exclusiveAspects;
}
}
@Override
public boolean handle(NodeRef nodeRef)
{
if(include(nodeRef))
{
rawResult.add(tenantService.getBaseName(nodeRef));
}
@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)
protected boolean include(NodeRef nodeRef)
{
return includeAspects(nodeRef, inclusiveAspects, exclusiveAspects);
}