mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-9098 - Handle trailing wildcards in the new (canned query powered) getPerson call
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28456 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1195,7 +1195,20 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
filterProps = new ArrayList<FilterProp>(stringPropFilters.size());
|
||||
for (Pair<QName, String> filterProp : stringPropFilters)
|
||||
{
|
||||
filterProps.add(new FilterPropString(filterProp.getFirst(), filterProp.getSecond(), (filterIgnoreCase ? FilterTypeString.STARTSWITH_IGNORECASE : FilterTypeString.STARTSWITH)));
|
||||
String filterStr = filterProp.getSecond();
|
||||
if("*".equals(filterStr))
|
||||
{
|
||||
// The wildcard means no filtering is needed on this property
|
||||
continue;
|
||||
}
|
||||
else if(filterStr.endsWith("*"))
|
||||
{
|
||||
// The trailing * is implicit
|
||||
filterStr = filterStr.substring(0, filterStr.length()-1);
|
||||
}
|
||||
|
||||
// Turn this into a canned query filter
|
||||
filterProps.add(new FilterPropString(filterProp.getFirst(), filterStr, (filterIgnoreCase ? FilterTypeString.STARTSWITH_IGNORECASE : FilterTypeString.STARTSWITH)));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user