[pal-cvs 2363] [97] added search filter.

svnno****@sourc***** svnno****@sourc*****
2007年 5月 7日 (月) 22:53:48 JST


Revision: 97
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=97
Author:   shinsuke
Date:     2007-05-07 22:53:47 +0900 (Mon, 07 May 2007)

Log Message:
-----------
added search filter.

Modified Paths:
--------------
    pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserManagementService.java
    pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserListPage.java
    pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/label.properties
    pal-admin/trunk/src/main/webapp/view/user/userList.html


-------------- next part --------------
Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserManagementService.java
===================================================================
--- pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserManagementService.java	2007-05-07 09:06:37 UTC (rev 96)
+++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserManagementService.java	2007-05-07 13:53:47 UTC (rev 97)
@@ -286,6 +286,18 @@
         page.setRolesItems(getRoleNamesForUsername(page.getName()));
     }
 
+    public void updateQuery(UserListPage page)
+    {
+        if (page.getFilter() != null && !page.getFilter().equals(""))
+        {
+            getUserPager().setFilter(page.getFilter());
+        }
+        else
+        {
+            getUserPager().setFilter("");
+        }
+    }
+
     public List<Map<String, String>> getRoleNames()
     {
         return PALAdminUtil.createItems(securityProviderLogic.getRoleNames()

Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserListPage.java
===================================================================
--- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserListPage.java	2007-05-07 09:06:37 UTC (rev 96)
+++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserListPage.java	2007-05-07 13:53:47 UTC (rev 97)
@@ -45,6 +45,8 @@
 
     private String name;
 
+    private String filter;
+
     private int userIndex;
 
     private List<Map<String, Object>> userItems;
@@ -61,6 +63,22 @@
         this.name = name;
     }
 
+    /**
+     * @return the filter
+     */
+    public String getFilter()
+    {
+        return filter;
+    }
+
+    /**
+     * @param filter the filter to set
+     */
+    public void setFilter(String filter)
+    {
+        this.filter = filter;
+    }
+
     public int getUserIndex()
     {
         return userIndex;
@@ -124,4 +142,17 @@
         setCrudType(CrudType.CREATE);
         return UserCreatePage.class;
     }
+
+    public Class doSearch()
+    {
+        getUserManagementService().updateQuery(this);
+        return null;
+    }
+
+    public Class doResetSearch()
+    {
+        setFilter("");
+        getUserManagementService().updateQuery(this);
+        return null;
+    }
 }

Modified: pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/label.properties
===================================================================
--- pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/label.properties	2007-05-07 09:06:37 UTC (rev 96)
+++ pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/label.properties	2007-05-07 13:53:47 UTC (rev 97)
@@ -9,3 +9,4 @@
 found= found.
 nextPage=Next>>
 action=Action:
+filter=Filter:

Modified: pal-admin/trunk/src/main/webapp/view/user/userList.html
===================================================================
--- pal-admin/trunk/src/main/webapp/view/user/userList.html	2007-05-07 09:06:37 UTC (rev 96)
+++ pal-admin/trunk/src/main/webapp/view/user/userList.html	2007-05-07 13:53:47 UTC (rev 97)
@@ -35,6 +35,13 @@
     </div>
 
     <div>
+      <label id="filterLabel" class="portlet-form-label">Filter:</label>
+      <input type="text" id="filter" size="15"/>
+      <input type="button" id="doSearch" value="Search" onclick="location.href='userList.html'" class="portlet-form-button"/>
+      <input type="button" id="doResetSearch" value="Reset" onclick="location.href='userList.html'" class="portlet-form-button"/><br/>
+    </div>
+
+    <div>
         <span id="count-header">10</span><!-- TODO: i18n--> <label id="foundLabel"> found.</label>
         (<span id="currentPageNumber-header">3</span>/<span id="maxPageNumber-header">5</span>)
     </div>


pal-cvs メーリングリストの案内