HttpSession session = request.getSession(true);
// Get a collection instance
col = getCollection(request,response);
XPathQueryService service = (XPathQueryService)col.getService("XPathQueryService",XMLDBAPIVERSION);
// Get the seach parameters from the form
String searchtype = request.getParameter("SEARCHTYPE");
String searchstring = request.getParameter("SEARCHSTRING");
// Setup xpath string depending on search type
if ( searchtype.equals("fname") || searchtype.equals("lname") ) {
xpath = "/person[" + searchtype + "='" + searchstring + "']";
} else if ( searchtype.equals("workphone")) {
xpath = "/person[phone/@type='work' and phone/text() = '" + searchstring + "' ]" ;
} else if ( searchtype.equals("homephone")) {
xpath = "/person[phone/@type='home' and phone/text() = '" + searchstring + "' ]" ;
} else if ( searchtype.equals("cellphone")) {
xpath = "/person[phone/@type='cell' and phone/text() = '" + searchstring + "' ]" ;
} else if ( searchtype.equals("homeemail")) {
xpath = "/person[email/@type='home' and email/text() = '" + searchstring + "' ]" ;
} else if ( searchtype.equals("workemail")) {
xpath = "/person[email/@type='work' and email/text() = '" + searchstring + "' ]" ;
} else if ( searchtype.equals("homeaddress")) {
xpath = "/person[address/@type='home' and address/text() = '" + searchstring + "' ]" ;
} else if ( searchtype.equals("workaddress")) {
xpath = "/person[address/@type='work' and address/text() = '" + searchstring + "' ]" ;
}
ResourceSet resultSet = service.query(xpath);
ResourceIterator results = resultSet.getIterator();
Group group = (Group)session.getAttribute("group");
// Clear out group object...