Commit 413acb3a authored by Ryan Graham's avatar Ryan Graham Committed by ryang

added advance/basic search options and user result count to the admins console search page


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1491 b35dd754-fafc-0310-a699-88a17e54d16e
parent ceccc3e2
...@@ -46,38 +46,40 @@ Search Plugin Changelog ...@@ -46,38 +46,40 @@ Search Plugin Changelog
<p><b>1.1.1</b> -- In progress</b></p> <p><b>1.1.1</b> -- In progress</b></p>
<ul> <ul>
<li>Added a fix to prevent all the checkboxes from becoming selected after searching via the Admin Console. <li>Admin Console - added a fix to prevent all the checkboxes from becoming selected after a searching.
<li>Admin Console - added the ability to toggle between having more or less search options.
<li>Admin Console - added a summary that reports the number of users found after a search.
</ul> </ul>
<p><b>1.1</b> -- May 17, 2005</b></p> <p><b>1.1</b> -- May 17, 2005</b></p>
<ul> <ul>
<li>Added a page to the Admin Console to allow the enabling/disabling of the search service and to change the service name. <li>Admin Console - added a page to allow the enabling/disabling of the search service and to change the service name.
<li>Added a page to the Admin Console to allow searching similiar to what is done on the client side. <li>Admin Console - added a page to allow searching similiar to what is done on the client side.
<li>Added a hidden FORM_TYPE field per the JEP-0055 spec. <li>Client Search - added a hidden FORM_TYPE field per the JEP-0055 spec.
<li>Some intenternal code refactoring. <li>Some intenternal code refactoring.
</ul> </ul>
<p><b>1.0.6</b> -- April 12, 2005</b></p> <p><b>1.0.6</b> -- April 12, 2005</b></p>
<ul> <ul>
<li>Changed the ui to use a single text field with multiple checkboxes to specify which fields are to be searched (thanks jfroehlich).</li> <li>Client Search - changed the ui to use a single text field with multiple checkboxes to specify which fields are to be searched (thanks jfroehlich).</li>
</ul> </ul>
<p><b>1.0.5</b> -- March 30, 2005</b></p> <p><b>1.0.5</b> -- March 30, 2005</b></p>
<ul> <ul>
<li>Added basic support for non-data form searches to support the Miranda (thanks Baron Ng).</li> <li>Client Search - added basic support for non-data form searches to support the Miranda (thanks Baron Ng).</li>
</ul> </ul>
<p><b>1.0.4</b> -- March 22, 2005</b></p> <p><b>1.0.4</b> -- March 22, 2005</b></p>
<ul> <ul>
<li>Added type and name attributes to the identity element when handling a disco#info query.</li> <li>Client Search - added type and name attributes to the identity element when handling a disco#info query.</li>
<li>Added a check and appropriate response to a disco#items query.</li> <li>Client Search - added a check and appropriate response to a disco#items query.</li>
<li>Added a jid field when returning the search results.</li> <li>Client Search - added a jid field when returning the search results.</li>
</ul> </ul>
<p><b>1.0.3</b> -- March 14, 2005</b></p> <p><b>1.0.3</b> -- March 14, 2005</b></p>
<ul> <ul>
<li>Fixed incompatiblity issue with psi.</li> <li>Client Search - fixed incompatiblity issue with psi.</li>
<li>Fixed bug where a list of all the users in the system would be returned when using psi.</li> <li>Client Search - fixed bug where a list of all the users in the system would be returned when using psi.</li>
</ul> </ul>
<p><b>1.0.2</b> -- March 8, 2005</p> <p><b>1.0.2</b> -- March 8, 2005</p>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<% webManager.init(request, response, session, application, out); <% webManager.init(request, response, session, application, out);
String criteria = ParamUtils.getParameter(request, "criteria"); String criteria = ParamUtils.getParameter(request, "criteria");
boolean moreOptions = ParamUtils.getBooleanParameter(request, "moreOptions", false);
UserManager userManager = webManager.getUserManager(); UserManager userManager = webManager.getUserManager();
Set<String> searchFields = userManager.getSearchFields(); Set<String> searchFields = userManager.getSearchFields();
...@@ -24,11 +25,11 @@ ...@@ -24,11 +25,11 @@
for (String searchField : searchFields) { for (String searchField : searchFields) {
boolean searchValue = ParamUtils.getBooleanParameter(request, searchField, false); boolean searchValue = ParamUtils.getBooleanParameter(request, searchField, false);
if (searchValue) { if (!moreOptions || searchValue) {
selectedFields.add(searchField); selectedFields.add(searchField);
Collection<User> foundUsers = userManager.findUsers(new HashSet<String>(Arrays.asList(searchField)), criteria); Collection<User> foundUsers = userManager.findUsers(new HashSet<String>(Arrays.asList(searchField)), criteria);
// Filter out all duplicate users. // Filter out all duplicate users.
for (User user : foundUsers) { for (User user : foundUsers) {
if (!users.contains(user)) { if (!users.contains(user)) {
users.add(user); users.add(user);
...@@ -52,48 +53,53 @@ ...@@ -52,48 +53,53 @@
<form name="f" action="advance-user-search.jsp"> <form name="f" action="advance-user-search.jsp">
<input type="hidden" name="search" value="true"/> <input type="hidden" name="search" value="true"/>
<input type="hidden" name="moreOptions" value="<%=moreOptions %>"/>
<fieldset> <fieldset>
<legend>Search for User</legend> <legend>Search for User</legend>
<div> <div>
<p> <table cellpadding="3" cellspacing="1" border="0" width="600">
The following fields are available for search. Wildcard (*) characters are allowed as part the of query. <tr class="c1">
</p> <td width="1%" colspan="2" nowrap>
<table cellpadding="3" cellspacing="1" border="0" width="600"> Search:
&nbsp;<input type="text" name="criteria" value="<%=(criteria != null ? criteria : "") %>" size="30" maxlength="75"/>
<tr class="c1"> &nbsp;<input type="submit" name="search" value="Search"/>
<td width="1%" nowrap>Search:</td>
<td class="c2">
<input type="text" name="criteria" value="<%= (criteria != null ? criteria : "") %>" size="30" maxlength="75"/>
</td>
</tr>
<%
for (String searchField : searchFields) {
%>
<tr class="c1">
<td width="1%" nowrap><%=searchField %>:</td>
<td class="c2">
<% if (criteria == null) { %>
<input type="checkbox" checked name="<%=searchField %>"/>
<% } else { %>
<input type="checkbox" <%=selectedFields.contains(searchField) ? "checked" : "" %> name="<%=searchField %>"/>
<% } %>
</td> </td>
</tr> </tr>
<% <% if (moreOptions) { %>
} <tr class="c1">
%> <td width="1%" colspan="2" nowrap>Wildcard (*) characters are allowed as part the of query. The following fields are available for searching:</td>
<tr><td colspan="2" nowrap><input type="submit" name="search" value="Search"/></td> </tr>
</tr>
<% for (String searchField : searchFields) { %>
<tr class="c1">
<td width="1%" nowrap><%=searchField %>:</td>
<td class="c2">
<% if (criteria == null) { %>
<input type="checkbox" checked name="<%=searchField %>"/>
<% } else { %>
<input type="checkbox" <%=selectedFields.contains(searchField) ? "checked" : "" %> name="<%=searchField %>"/>
<% } %>
</td>
</tr>
<% } %>
<tr>
<td nowrap>&raquo;&nbsp;<a href="advance-user-search.jsp?moreOptions=false">Less Options</a></td>
</tr>
<% } else { %>
<tr>
<td nowrap>&raquo;&nbsp;<a href="advance-user-search.jsp?moreOptions=true">More Options</a></td>
</tr>
<% } %>
</table> </table>
</fieldset> </fieldset>
</form> </form>
<% if (criteria != null) { %> <% if (criteria != null) { %>
<p>
Users Found: <%=users.size() %>
</p>
<div class="jive-table"> <div class="jive-table">
<table cellpadding="0" cellspacing="0" border="0" width="100%"> <table cellpadding="0" cellspacing="0" border="0" width="100%">
...@@ -111,7 +117,6 @@ ...@@ -111,7 +117,6 @@
<tbody> <tbody>
<% if (users.isEmpty()) { %> <% if (users.isEmpty()) { %>
<tr> <tr>
<td align="center" colspan="7">No users found.</td> <td align="center" colspan="7">No users found.</td>
</tr> </tr>
...@@ -124,7 +129,6 @@ ...@@ -124,7 +129,6 @@
for (User user : users) { for (User user : users) {
i++; i++;
%> %>
<tr class="jive-<%= (((i%2)==0) ? "even" : "odd") %>"> <tr class="jive-<%= (((i%2)==0) ? "even" : "odd") %>">
<td width="1%"> <td width="1%">
<%= i %> <%= i %>
...@@ -175,7 +179,6 @@ ...@@ -175,7 +179,6 @@
><img src="images/delete-16x16.gif" width="16" height="16" border="0"></a> ><img src="images/delete-16x16.gif" width="16" height="16" border="0"></a>
</td> </td>
</tr> </tr>
<% <%
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment