changeset 169:93dd5e1c57d3

Servlet Version 1.16b2 with new DigilibParameter code. - more generic class for request parameters - like already done for DiglibConfig - changes in JSPs for new request stuff - changes in ImageSize class so size=0 is "wildcard" - missing dw and dh parameters now treated as wildcards - changed package name in imageinfo class
author robcast
date Wed, 29 Oct 2003 22:45:51 +0100
parents cf1825c48e9d
children d40922628e4a
files client/digitallibrary/server/dlRequest.jsp
diffstat 1 files changed, 117 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/server/dlRequest.jsp	Wed Oct 29 22:45:51 2003 +0100
@@ -0,0 +1,117 @@
+<%@ page language="java" %>
+
+<%!
+// authentication stuff - robert
+// -----------------------------
+// create DocumentBean instance for all JSP requests
+digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean();
+
+// initialize DocumentBean instance in JSP init
+public void jspInit() {
+    try {
+        // set servlet init-parameter
+        docBean.setConfig(getServletConfig());
+    } catch (javax.servlet.ServletException e) {
+        System.out.println(e);
+    }
+}
+%>
+
+<%
+// get digilib config
+digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig();
+// parsing the query
+digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
+// add number of pages
+dlRequest.setValue("pt", docBean.getNumPages(dlRequest));
+// dir cache
+digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache");
+%>
+
+<html>
+<head>
+<title>Digilib configuration page</title>
+</head>
+
+<body>
+<h1>Local request information</h1>
+
+<table>
+  <tr>
+    <td>Pt</td><td><b><%= dlRequest.getAsString("pt") %></b></td>
+    <td><i>total number of pages (generated by servlet)</i></td>
+  </tr>
+  <tr>
+    <td>RequestPath</td><td><b><%= dlRequest.getAsString("request.path") %></b></td>
+    <td><i>url of the page/document</i></td>
+  </tr>
+  <tr>
+    <td>Fn</td><td><b><b><%= dlRequest.getAsString("fn") %></b></td><td><i>url of the page/document</i></td>
+  </tr>
+  <tr>
+    <td>FilePath</td><td><b><%= dlRequest.getFilePath() %></b></td><td><i>effective path of the page/document</i></td>
+  </tr>
+  <tr>
+    <td>Pn</td><td><b><%= dlRequest.getAsString("pn") %></b></td><td><i>page number</i></td>
+  </tr>
+  <tr>
+    <td>Dw</td><td><b><%= dlRequest.getAsString("dw") %></b></td><td><i>width of client in pixels</i></td>
+  </tr>
+  <tr>
+    <td>Dh</td><td><b><%= dlRequest.getAsString("dh") %></b></td><td><i>height of client in pixels</i></td>
+  </tr>
+  <tr>
+    <td>Wx</td><td><b><%= dlRequest.getAsString("wx") %></b></td><td><i>left edge of image (float from 0 to 1)</i></td>
+  </tr>
+  <tr>
+    <td>Wy</td><td><b><%= dlRequest.getAsString("wy") %></b></td><td><i>top edge in image (float from 0 to 1)</i></td>
+  </tr>
+  <tr>
+    <td>Ww</td><td><b><%= dlRequest.getAsString("ww") %></b></td><td><i>width of image (float from 0 to 1)</i></td>
+  </tr>
+  <tr>
+    <td>Wh</td><td><b><%= dlRequest.getAsString("wh") %></b></td><td><i>height of image (float from 0 to 1)</i></td>
+  </tr>
+  <tr>
+    <td>Ws</td><td><b><%= dlRequest.getAsString("ws") %></b></td><td><i>scale factor</i></td>
+  </tr>
+  <tr>
+    <td>Mo</td><td><b><%= dlRequest.getAsString("mo") %></b></td><td><i>special options like 'fit' for gifs</i></td>
+  </tr>
+  <tr>
+    <td>Mk</td><td><b><%= dlRequest.getAsString("mk") %></b></td><td><i>marks</i></td>
+  </tr>
+  <tr>
+    <td>BaseURL</td><td colspan="2"><b><%= dlRequest.getAsString("base.url") %></b></td>
+  </tr>
+  <tr>
+    <td></td><td></td><td><i>base URL (from http:// to below /servlet)</i></td>
+  </tr>
+</table>
+
+<h2>All parameters<h2>
+
+<table>
+<%
+    Object[] keys = dlRequest.keySet().toArray();
+    java.util.Arrays.sort(keys);
+    int l = keys.length;
+    for (int i = 0; i < l; i++) {
+	String key = (String) keys[i];
+	String val = dlRequest.getAsString(key);
+	if (val.length() == 0) {
+	    val = "</b>(none)<b>";
+	}
+%>
+  <tr>
+    <td valign="top"><%= key %></td><td><b><%= val %></b></td>
+    <td><% if (! dlRequest.hasValue(key)) { %> (default) <% } %></td>
+  </tr>
+<%
+       }
+%>
+</table>
+
+
+</body>
+</html>