mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
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:
@@ -27,20 +27,23 @@
|
||||
</if>
|
||||
where
|
||||
assoc.parent_node_id = #{parentNodeId}
|
||||
<foreach item="item" index="index" collection="pattern" open=" " separator=" " close=" ">
|
||||
<if test="prop1qnameId != null or prop2qnameId != null or prop3qnameId != null ">
|
||||
and lower(concat(
|
||||
</if>
|
||||
<if test="prop1qnameId != null">
|
||||
and
|
||||
(
|
||||
lower(prop1.string_value) like lower(#{pattern}) <include refid="alfresco.util.escape"/>
|
||||
prop1.string_value, ' ',
|
||||
</if>
|
||||
<if test="prop2qnameId != null">
|
||||
or lower(prop2.string_value) like lower(#{pattern}) <include refid="alfresco.util.escape"/>
|
||||
prop2.string_value, ' ',
|
||||
</if>
|
||||
<if test="prop3qnameId != null">
|
||||
or lower(prop3.string_value) like lower(#{pattern}) <include refid="alfresco.util.escape"/>
|
||||
prop3.string_value, ' ',
|
||||
</if>
|
||||
<if test="prop1qnameId != null">
|
||||
)
|
||||
<if test="prop1qnameId != null or prop2qnameId != null or prop3qnameId != null ">
|
||||
' ')) like lower(#{item}) <include refid="alfresco.util.escape"/>
|
||||
</if>
|
||||
</foreach>
|
||||
<if test="includeAspectIds != null">
|
||||
and exists (
|
||||
select *
|
||||
|
@@ -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 + "%");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user