2002-01-06 19:05:37 -07:00
|
|
|
<%--
|
|
|
|
The contents of this file are subject to the Mozilla Public License Version 1.1
|
|
|
|
(the "License"); you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
|
|
|
|
WARRANTY OF ANY KIND, either express or implied. See the License for the specific
|
|
|
|
language governing rights and limitations under the License.
|
|
|
|
|
|
|
|
The Original Code is the Venice Web Communities System.
|
|
|
|
|
2006-01-25 21:40:34 -07:00
|
|
|
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@users.sf.net>,
|
2002-01-06 19:05:37 -07:00
|
|
|
for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
2004-06-13 15:34:51 -06:00
|
|
|
Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
2002-01-06 19:05:37 -07:00
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
--%>
|
|
|
|
<%@ page import = "java.util.Iterator" %>
|
|
|
|
<%@ page import = "java.util.List" %>
|
2004-07-10 16:54:15 -06:00
|
|
|
<%@ page import = "com.silverwrist.util.*" %>
|
2002-01-06 19:05:37 -07:00
|
|
|
<%@ page import = "com.silverwrist.venice.core.*" %>
|
|
|
|
<%@ page import = "com.silverwrist.venice.ui.view.MembersView" %>
|
|
|
|
<%@ taglib uri="/tlds/util" prefix="util" %>
|
|
|
|
<%@ taglib uri="/tlds/community" prefix="comm" %>
|
|
|
|
<%
|
|
|
|
MembersView view = MembersView.get(request);
|
|
|
|
%>
|
|
|
|
<util:comment>Members view for community <comm:name/></util:comment>
|
|
|
|
<util:header title="Members of Community:">
|
2002-01-16 16:23:57 -07:00
|
|
|
<util:subtitle><util:escape><comm:name/></util:escape></util:subtitle>
|
2002-01-06 19:05:37 -07:00
|
|
|
</util:header>
|
2004-06-13 15:34:51 -06:00
|
|
|
<% if (view.canExportMembers()) { %>
|
|
|
|
<util:font color="content.fg" size="content">[
|
|
|
|
<util:xlink>
|
|
|
|
<util:href type="servlet">comm/member_export.js.vs?cc=<comm:ID/></util:href>
|
|
|
|
<util:text>Export Member List</util:text>
|
|
|
|
</util:xlink>
|
|
|
|
]</util:font><p>
|
|
|
|
<% } // end if %>
|
2004-07-10 16:54:15 -06:00
|
|
|
<util:font color="content.fg" size="subhead"><b>Find members of community "<comm:name/>":</b></util:font><p />
|
|
|
|
<util:form action="comm/members.js.vs" type="servlet"><div class="content">
|
|
|
|
<input type="hidden" name="cc" value="<comm:ID/>" />
|
|
|
|
<input type="hidden" name="sl" value="0" />
|
|
|
|
<input type="hidden" name="ofs" value="0" />
|
2002-01-06 19:05:37 -07:00
|
|
|
<util:font color="content.fg" size="content">
|
|
|
|
Display all community members whose
|
2004-07-10 16:54:15 -06:00
|
|
|
<select name="field" size="1">
|
|
|
|
<option value="<%= SearchMode.FIELD_USER_NAME %>"
|
|
|
|
<% if (view.testField(SearchMode.FIELD_USER_NAME)) { %>selected="selected"<% } %> >user name</option>
|
|
|
|
<option value="<%= SearchMode.FIELD_USER_DESCRIPTION %>"
|
|
|
|
<% if (view.testField(SearchMode.FIELD_USER_DESCRIPTION)) { %>selected="selected"<% } %> >description</option>
|
|
|
|
<option value="<%= SearchMode.FIELD_USER_GIVEN_NAME %>"
|
|
|
|
<% if (view.testField(SearchMode.FIELD_USER_GIVEN_NAME)) { %>selected="selected"<% } %> >first name</option>
|
|
|
|
<option value="<%= SearchMode.FIELD_USER_FAMILY_NAME %>"
|
|
|
|
<% if (view.testField(SearchMode.FIELD_USER_FAMILY_NAME)) { %>selected="selected"<% } %> >last name</option>
|
|
|
|
</select><br />
|
2002-01-06 19:05:37 -07:00
|
|
|
|
2004-07-10 16:54:15 -06:00
|
|
|
<select name="mode" size="1">
|
|
|
|
<option value="<%= SearchMode.SEARCH_PREFIX %>"
|
|
|
|
<% if (view.testMode(SearchMode.SEARCH_PREFIX)) { %>selected="selected"<% } %> >starts with the string</option>
|
|
|
|
<option value="<%= SearchMode.SEARCH_SUBSTRING %>"
|
|
|
|
<% if (view.testMode(SearchMode.SEARCH_SUBSTRING)) { %>selected="selected"<% } %> >contains the string</option>
|
|
|
|
<option value="<%= SearchMode.SEARCH_REGEXP %>"
|
|
|
|
<% if (view.testMode(SearchMode.SEARCH_REGEXP)) { %>selected="selected"<% } %> >matches the regular
|
|
|
|
expression</option>
|
|
|
|
</select>
|
2002-01-06 19:05:37 -07:00
|
|
|
|
2004-07-10 16:54:15 -06:00
|
|
|
<span class="cinput"><input type="text" class="cinput" name="term" size="32" maxlength="255"
|
|
|
|
value="<%= view.getTerm() %>" /></span><br />
|
2002-01-06 19:05:37 -07:00
|
|
|
<util:button id="search" type="input"/>
|
|
|
|
</util:font>
|
2004-07-10 16:54:15 -06:00
|
|
|
</div></util:form>
|
2002-01-06 19:05:37 -07:00
|
|
|
|
|
|
|
<% List results = view.getResults(); %>
|
|
|
|
<% if (results!=null) { %>
|
2004-07-10 16:54:15 -06:00
|
|
|
<hr />
|
2002-01-06 19:05:37 -07:00
|
|
|
<%
|
|
|
|
int dcount = results.size();
|
|
|
|
// Determine the number of results to display and whether to display a "next" button
|
|
|
|
boolean go_next = false;
|
|
|
|
if (dcount>view.getMaxResults())
|
|
|
|
{ // there's a "next"
|
|
|
|
dcount = view.getMaxResults();
|
|
|
|
go_next = true;
|
|
|
|
|
|
|
|
} // end if
|
|
|
|
%>
|
2004-07-10 16:54:15 -06:00
|
|
|
<table width="100%" border="0" align="center"><tr valign="middle">
|
|
|
|
<td width="50%" align="left" class="content"><util:font color="content.fg" size="content">
|
2002-01-06 19:05:37 -07:00
|
|
|
<%-- The community members/search results header --%>
|
2004-07-10 16:54:15 -06:00
|
|
|
<font size="+1"><b>
|
2002-01-06 19:05:37 -07:00
|
|
|
<% if (view.getSimple()) { %>Community Members:<% } else { %>Search Results:<% } %>
|
2004-07-10 16:54:15 -06:00
|
|
|
</b></font>
|
2002-01-06 19:05:37 -07:00
|
|
|
(Displaying <%= view.getOffset() + 1 %>-<%= view.getOffset() + dcount %> of
|
|
|
|
<%= view.getFindCount() %>)
|
2004-07-10 16:54:15 -06:00
|
|
|
</util:font></td>
|
2002-01-06 19:05:37 -07:00
|
|
|
|
2004-07-10 16:54:15 -06:00
|
|
|
<td width="50%" align="right" class="content">
|
2002-01-06 19:05:37 -07:00
|
|
|
<% if (go_next || (view.getOffset()>0)) { %>
|
|
|
|
<%-- The navigational form that allows us to page through the results --%>
|
|
|
|
<util:comment>Navigational Form</util:comment>
|
2004-07-10 16:54:15 -06:00
|
|
|
<util:form action="comm/members.js.vs" type="servlet"><div class="content">
|
|
|
|
<input type="hidden" name="cc" value="<comm:ID/>" />
|
|
|
|
<input type="hidden" name="sl" value="<%= view.getSimple() ? 1 : 0 %>" />
|
|
|
|
<input type="hidden" name="ofs" value="<%= view.getOffset() %>" />
|
|
|
|
<input type="hidden" name="field" value="<%= view.getField() %>" />
|
|
|
|
<input type="hidden" name="mode" value="<%= view.getMode() %>" />
|
|
|
|
<input type="hidden" name="term" value="<%= view.getTerm() %>" />
|
|
|
|
<input type="hidden" name="fcount" value="<%= view.getFindCount() %>" />
|
2002-01-06 19:05:37 -07:00
|
|
|
<% if (view.getOffset()>0) { %>
|
|
|
|
<util:button id="previous" type="input"/>
|
|
|
|
<% } else { %>
|
|
|
|
<util:button id="_null_"/>
|
|
|
|
<% } // end if %>
|
|
|
|
|
|
|
|
<% if (go_next) { %>
|
|
|
|
<util:button id="next" type="input"/>
|
|
|
|
<% } else { %>
|
|
|
|
<util:button id="_null_"/>
|
|
|
|
<% } // end if %>
|
2004-07-10 16:54:15 -06:00
|
|
|
</div></util:form>
|
2002-01-06 19:05:37 -07:00
|
|
|
<% } else { %> <% } %>
|
2004-07-10 16:54:15 -06:00
|
|
|
</td>
|
|
|
|
</tr></table><br />
|
2002-01-06 19:05:37 -07:00
|
|
|
|
|
|
|
<%-- Display the results of the search --%>
|
2004-07-10 16:54:15 -06:00
|
|
|
<table border="0" align="left" cellpadding="0" cellspacing="4">
|
2002-01-06 19:05:37 -07:00
|
|
|
<% for (int i=0; i<dcount; i++) { %>
|
2004-07-10 16:54:15 -06:00
|
|
|
<tr valign="top">
|
|
|
|
<td align="center" width="14"><util:stdbullet/></td>
|
|
|
|
<td align="left" class="content"><util:font color="content.fg" size="content">
|
|
|
|
<%
|
|
|
|
UserFound uf = (UserFound)(results.get(i));
|
|
|
|
String fullname = uf.getGivenName() + " " + uf.getFamilyName();
|
|
|
|
fullname = fullname.trim();
|
|
|
|
if (StringUtil.isStringEmpty(fullname))
|
|
|
|
fullname = uf.getName();
|
|
|
|
String whence = "";
|
|
|
|
if (!(StringUtil.isStringEmpty(uf.getLocality())))
|
|
|
|
{ // figure out the right locality
|
|
|
|
if (!(StringUtil.isStringEmpty(uf.getRegion())))
|
|
|
|
whence = uf.getLocality() + ", " + uf.getRegion();
|
|
|
|
else
|
|
|
|
whence = uf.getLocality();
|
|
|
|
|
|
|
|
} // end if
|
|
|
|
else if (!(StringUtil.isStringEmpty(uf.getRegion())))
|
|
|
|
whence = uf.getRegion();
|
|
|
|
%>
|
2002-01-06 19:05:37 -07:00
|
|
|
<util:xlink>
|
|
|
|
<util:href type="servlet">user/<%= uf.getName() %></util:href>
|
|
|
|
<util:text><%= uf.getName() %></util:text>
|
2004-07-10 16:54:15 -06:00
|
|
|
</util:xlink><br />
|
|
|
|
<util:escape><%= fullname %></util:escape>, from <util:escape><%= whence %></util:escape>
|
|
|
|
<% if (!(uf.getCountry().equals("XX"))) { %><%= uf.getCountry() %><% } %>
|
2002-01-06 19:05:37 -07:00
|
|
|
<% if (view.isCommunityAdmin(uf)) { %>
|
|
|
|
<util:image src="tag_host.gif" fixup="true" alt="Host!" width="40" height="20"/>
|
|
|
|
<% } // end if %>
|
|
|
|
<% if (uf.getDescription()!=null) { %>
|
2004-07-10 16:54:15 -06:00
|
|
|
<br /><i><util:escape><%= uf.getDescription() %></util:escape></i>
|
2002-01-06 19:05:37 -07:00
|
|
|
<% } // end if %>
|
2004-07-10 16:54:15 -06:00
|
|
|
</util:font></td>
|
|
|
|
</tr>
|
2002-01-06 19:05:37 -07:00
|
|
|
<% } // end for %>
|
2004-07-10 16:54:15 -06:00
|
|
|
</table><br clear="left" />
|
2002-01-06 19:05:37 -07:00
|
|
|
<% } // end if %>
|
2004-07-10 16:54:15 -06:00
|
|
|
<%-- EOF --%>
|