changeset 254:a6bd80bcd28b

servlet version 1.19b5 - filename and dpi in request - filename and dpi in dlInfo-*
author robcast
date Wed, 25 Aug 2004 01:07:13 +0200
parents 2adfb8bea870
children 95da3e44fdb9
files client/digitallibrary/dlInfo-js.jsp client/digitallibrary/dlInfo-xml.jsp
diffstat 2 files changed, 18 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/dlInfo-js.jsp	Wed Aug 25 01:06:30 2004 +0200
+++ b/client/digitallibrary/dlInfo-js.jsp	Wed Aug 25 01:07:13 2004 +0200
@@ -1,9 +1,5 @@
 <%@ page language="java" %>
-
 <%!
-/* authentication stuff - robert
- * -----------------------------
- */
 // create DocumentBean instance for all JSP requests
 digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean();
 
@@ -16,30 +12,23 @@
         System.out.println(e);
     }
 }
-%>
-
-<%
-// parse the query
+%><%
+// parsing the query
 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
-// add number of pages from DocBean
-dlRequest.setPt(docBean.getNumPages(dlRequest));
+docBean.setRequest(dlRequest);
 %>
-
 // Automatically generated JavaScript snippet with parameters
-
-var dlreqPt = <%= dlRequest.getPt() %>; // total number of pages (generated by sevlet)
-
-var dlreqRequestPath = "<%= dlRequest.getRequestPath() %>";  // url of the page/document			
-var dlreqFn = "<%= dlRequest.getFn() %>"; // url of the page/document
-var dlreqFilePath = "<%= dlRequest.getFilePath() %>"; // effective path of the page/document
-var dlreqPn = "<%= dlRequest.getPn() %>"; // page number
-var dlreqDw = "<%= dlRequest.getDw() %>"; // width of client in pixels
-var dlreqDh = "<%= dlRequest.getDh() %>"; // height of client in pixels
-var dlreqWx = "<%= dlRequest.getWx() %>"; // left edge of image (float from 0 to 1)
-var dlreqWy = "<%= dlRequest.getWy() %>"; // top edge in image (float from 0 to 1)
-var dlreqWw = "<%= dlRequest.getWw() %>"; // width of image (float from 0 to 1)
-var dlreqWh = "<%= dlRequest.getWh() %>"; // height of image (float from 0 to 1)
-var dlreqWs = "<%= dlRequest.getWs() %>"; // scale factor
-var dlreqMo = "<%= dlRequest.getMo() %>"; // special options like 'fit' for gifs
-var dlreqMk = "<%= dlRequest.getMk() %>"; // marks
-var dlreqBaseURL = "<%= dlRequest.getBaseURL() %>"; // base URL (from http:// to below /servlet)
+<%
+    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 = "";
+	}
+	%>var dl_<%= key %> = "<%= val %>";
+<%
+       }
+%>
--- a/client/digitallibrary/dlInfo-xml.jsp	Wed Aug 25 01:06:30 2004 +0200
+++ b/client/digitallibrary/dlInfo-xml.jsp	Wed Aug 25 01:07:13 2004 +0200
@@ -18,10 +18,7 @@
 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");
+docBean.setRequest(dlRequest);
 
 %><!-- Automatically generated XML snippet with document parameters -->
 <document-parameters>