%@ page import = "com.websystems.xml.WSDocument" %>
<%@ page import = "com.websystems.drita.beans.Search" %>
<%
String sType = request.getParameter("type");
String sType2 = null;
String[] results = null;
//String filename = "/var/lib/tomcat/webapps/web-syst/xml/drita.wsml";
//String filePrefix = "C:\\Files\\servers\\tomcat-3.3.1\\webapps\\ROOT\\drita\\";
String filePrefix = "/home/virtual/site33/fst/var/www/html/drita/";
String filename = filePrefix + "xml/drita.wsml";
WSDocument doc = new WSDocument(filename);
String[] units = search.getUnits(doc);
String text = null;
String status = null;
String checked1 = " checked";
String checked2 = "";
if(sType != null) {
text = request.getParameter("text");
if(sType.equals("text")) {
status = "search results for: " + text + "";
sType2 = request.getParameter("type2");
if(sType2.equals("words")) {
checked1 = "";
checked2 = " checked";
}
}
if(sType.equals("alpha"))
status = "alphabetical results: " + text + "";
if(sType.equals("school"))
status = "school directory results: " + text + "";
results = search.search(sType, sType2, text, doc);
if(results.length == 1) {
if(!results[0].equals(" No matches found!"))
status += " (1 match found)";
}
if(results.length > 1)
status += " (" + results.length + " matches found)";
}
%>
Drita Portal
|
|
school directory:
<% for(int t = 0; t < units.length; t++) { %>
<%=units[t]%>
<% if(t != units.length - 1) { %>
|
<% } %>
<% } %>
|
|
|
<% if(sType != null) { %>
<%=status%>
|
<% if(results != null) {
for(int i = 0; i < results.length; i++) { %>
| <%=results[i]%> |
<% } %>
|
|
<%
}
}
%>