}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
DcwRecordFile foo = (DcwRecordFile) request.getAttribute(DispatchServlet.RECORD_FILE_OBJ);
if (foo == null) {
response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
String basepath = getRootDir(request);
String url = response.encodeURL(request.getContextPath()
+ "/VPFHelp.jsp?topic=table_schema");
PrintWriter out = response.getWriter();
out.println("<H2>Table Schema</H2>");
out.println("<H3>General Table Information</H3>");
HtmlListElement list = new HtmlListElement();
list.addElement("Table Name: " + foo.getTableName());
list.addElement("Table Description: " + foo.getDescription());
list.addElement("DocFile Name: "
+ fileURL(request,
response,
basepath,
foo.getDocumentationFilename()));
int reclen = foo.getRecordLength();
String reclenstr = (reclen == -1) ? ("variable")
: (Integer.toString(reclen) + " bytes");
list.addElement("Record Length: " + reclenstr);
try {
list.addElement("Record Count: " + foo.getRecordCount());
} catch (com.bbn.openmap.io.FormatException fe) {
list.addElement("Record Count Error: " + fe.toString());
}
list.generate(out);
// out.println("<br><H3>Column Schema</H3>");
ListElement rows = new ListElement();
WrapElement table = new WrapElement("table", "BORDER=1", rows);
TableRowElement thr = new TableRowElement();
rows.addElement(new WrapElement("CAPTION", new StringElement("Column Schema")));
rows.addElement(thr);
thr.addElement(THE("#", url));
thr.addElement(THE("Name", url));
thr.addElement(THE("Type", url));
thr.addElement(THE("Count", url));
thr.addElement(THE("Key Type", url));
thr.addElement(THE("Description", url));
thr.addElement(THE("VDT", url));
thr.addElement(THE("Thematic Index", url));
thr.addElement(THE("DocFile", url));
DcwColumnInfo dci[] = foo.getColumnInfo();
for (int i = 0; i < dci.length; i++) {
TableRowElement tr = new TableRowElement();
rows.addElement(tr);
tr.addElement(Integer.toString(i));
tr.addElement(dci[i].getColumnName());