%@ page import="org.crosswire.xml.XMLRepo" %>
<%@ page import="org.crosswire.xml.XMLObject" %>
<%@ page import="org.crosswire.community.data.User" %>
<%
XMLRepo repo = XMLRepo.instance(pageContext);
String term = request.getParameter("q"); if (term == null) term = "";
// make sure user still doesn't exist. redundant? maybe so.
XMLObject users[] = repo.getObjects(new User(),100);
if (users.length > 0) {
%>
| <%=users.length%> Results for <%=term%>. |
User ID | Name | Country | Postal Code | Home Page | Photos |
<%
}
for (int i = 0; i < users.length; i++) {
User u = (User)users[i];
String userID = u.getID();
String fullName = u.getFullName(); if (fullName == null) fullName = "";
String country = u.getCountry(); if (country == null) country = "";
String postalCode = u.getPostalCode(); if (postalCode == null) postalCode = "";
String homeURL = u.getHomeURL(); homeURL = (homeURL == null)?"":"Home Page";
String photosURL = u.getPhotosURL(); photosURL = (photosURL == null)?"":"Photos";
%>
<%=userID%> | <%=fullName%> | <%=country%> | <%=postalCode%> | <%=homeURL%> | <%=photosURL%> |
<%
}
if (users.length > 0) out.print("
");
%>