Author: phuong_vu
Date: 2011-03-17 05:33:58 -0400 (Thu, 17 Mar 2011)
New Revision: 6066
Modified:
portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java
portal/branches/branch-GTNPORTAL-1832/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java
portal/branches/branch-GTNPORTAL-1832/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIUserSelector.java
Log:
GTNPORTAL-1799 Should remove space characters in front and behind the strings that use to
search
Modified:
portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2011-03-17
08:57:06 UTC (rev 6065)
+++
portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2011-03-17
09:33:58 UTC (rev 6066)
@@ -244,7 +244,15 @@
{
this.save();
//
- String ownerIdChunk = ownerId != null ? new MOPFormatter().encodeNodeName(null,
ownerId) : "%";
+ String ownerIdChunk = "%";
+ if (ownerId != null)
+ {
+ ownerId = ownerId.trim();
+ if (!ownerId.isEmpty())
+ {
+ ownerIdChunk = new MOPFormatter().encodeNodeName(null, ownerId);
+ }
+ }
//
String ownerTypeChunk;
@@ -314,7 +322,7 @@
"jcr:path LIKE '" + workspaceChunk + "/" +
ownerTypeChunk + "/" + ownerIdChunk
+ "/mop:rootpage/mop:children/mop:pages/mop:children/%' AND
" +
"(" +
- "LOWER(gtn:name) LIKE '%" + title.toLowerCase() +
"%' ESCAPE '\\')";
+ "LOWER(gtn:name) LIKE '%" + title.trim().toLowerCase()
+ "%' ESCAPE '\\')";
}
else
{
Modified:
portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java 2011-03-17
08:57:06 UTC (rev 6065)
+++
portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java 2011-03-17
09:33:58 UTC (rev 6066)
@@ -73,7 +73,7 @@
ObjectType<? extends Site> siteType = null;
if (ownerType != null)
{
- siteType = Mapper.parseSiteType(ownerType);
+ siteType = Mapper.parseSiteType(ownerType.trim());
}
ite = findW(session, siteType, q.getOwnerId(), q.getTitle());
Modified:
portal/branches/branch-GTNPORTAL-1832/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1832/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java 2011-03-17
08:57:06 UTC (rev 6065)
+++
portal/branches/branch-GTNPORTAL-1832/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java 2011-03-17
09:33:58 UTC (rev 6066)
@@ -130,7 +130,7 @@
UIFormStringInput input = (UIFormStringInput)quickSearchInput.getChild(0);
UIFormSelectBox select = (UIFormSelectBox)quickSearchInput.getChild(1);
String name = input.getValue();
- if (name != null && !name.equals(""))
+ if (name != null && !(name = name.trim()).equals(""))
{
if (name.indexOf("*") < 0)
{
Modified:
portal/branches/branch-GTNPORTAL-1832/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIUserSelector.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1832/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIUserSelector.java 2011-03-17
08:57:06 UTC (rev 6065)
+++
portal/branches/branch-GTNPORTAL-1832/webui/eXo/src/main/java/org/exoplatform/webui/organization/account/UIUserSelector.java 2011-03-17
09:33:58 UTC (rev 6066)
@@ -260,7 +260,7 @@
{
OrganizationService service = getApplicationComponent(OrganizationService.class);
Query q = new Query();
- if (keyword != null && keyword.trim().length() != 0)
+ if (keyword != null && (keyword = keyword.trim()).length() != 0)
{
if (keyword.indexOf("*") < 0)
{
@@ -292,7 +292,7 @@
// remove if user doesn't exist in selected group
MembershipHandler memberShipHandler = service.getMembershipHandler();
- if (groupId != null && groupId.trim().length() != 0)
+ if (groupId != null && (groupId = groupId.trim()).length() != 0)
{
for (Object user : results)
{
Show replies by date