Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

91880: Merged 5.0.N (5.0.1) to HEAD-BUG-FIX (5.1/Cloud)
      91761: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.1)
         91686: Merged V4.2.4 (4.2.4) to V4.2-BUG-FIX (4.2.5)
            91643: Merged DEV to V4.2.4-PATCHES
               91252: MNT-12037: CLONE - User search does not return results with "<firstname> <lastname>" search in admin console users page.
                - Split entered pattern into parts and return users that match each part. 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94839 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 11:40:47 +00:00
parent 6538fd25d3
commit ff24f64c17
2 changed files with 21 additions and 10 deletions

View File

@@ -18,6 +18,7 @@
*/
package org.alfresco.repo.security.person;
import java.util.ArrayList;
import java.util.List;
@@ -42,7 +43,7 @@ public class FilterSortPersonEntity
private Long prop3qnameId = null;
private Boolean sort3asc = null;
private String pattern;
private List<String> pattern;
private List<Long> includeAspectIds;
private List<Long> excludeAspectIds;
@@ -65,7 +66,7 @@ public class FilterSortPersonEntity
this.parentNodeId = parentNodeId;
}
public String getPattern()
public List<String> getPattern()
{
return pattern;
}
@@ -93,13 +94,20 @@ public class FilterSortPersonEntity
public void setPattern(String pattern)
{
this.pattern = new ArrayList<String>();
if (pattern != null)
{
// escape the '%' character with '\' (standard SQL escape character)
//pattern = escape(pattern, '%');
// replace the wildcard character '*' with the one used in database queries i.e. '%'
this.pattern = pattern.replace('*', '%');
pattern = pattern.replace('*', '%');
String[] parts = pattern.split(" ");
for(String part:parts)
{
this.pattern.add("%" + part + "%");
}
}
}