changeset 77:b877e54b0794

New servlet version 1.5b. Mostly cleanup. Global parameters for digilib now in DigilibConfiguration, per request parameters are now all in DigilibRequest. The DocuImage implementation can be selected by the configuration docuimage-class. Pixel-by-pixel view implemented with "mo=clip".
author robcast
date Fri, 24 Jan 2003 22:13:49 +0100
parents 7b0ba81a5a6b
children e0dcac9c66fa
files client/digitallibrary/CHANGES client/digitallibrary/WEB-INF/digilib-config.xml client/digitallibrary/WEB-INF/lib/clibwrapper_jiio.jar client/digitallibrary/WEB-INF/lib/jai_imageio.jar client/digitallibrary/digicat.jsp client/digitallibrary/digilib.jsp client/digitallibrary/dlImage.jsp
diffstat 7 files changed, 28 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/CHANGES	Fri Jan 24 21:55:54 2003 +0100
+++ b/client/digitallibrary/CHANGES	Fri Jan 24 22:13:49 2003 +0100
@@ -10,6 +10,12 @@
 
 CHANGES
 
+24.1.2003 - [different files] : roc
+- New Servlet version 1.5b with internal cleanup and new Request and
+  Configuration classes.
+- New JSPs dlInfo-js.jsp and server/dlConfig.jsp to show the request parameter
+  as JavaScript and the configuration settings as HTML.
+
 8.1.2003 - DigilibServlet.jar : roc
 - New servlet and classes for JAI ImageIO (currently not used).
 
--- a/client/digitallibrary/WEB-INF/digilib-config.xml	Fri Jan 24 21:55:54 2003 +0100
+++ b/client/digitallibrary/WEB-INF/digilib-config.xml	Fri Jan 24 22:13:49 2003 +0100
@@ -13,12 +13,18 @@
        Directories with low-resolution images are first in list. -->
   <parameter name="basedir-list" value="/docuserver/scaled/small:/docuserver/images:/docuserver/scans/quellen" />
 
+  <!-- Java class to use for image operations -->
+  <parameter name="docuimage-class" value="digilib.image.JAIDocuImage" />
+
+  <!-- is sending whole image files with mo=file allowed? -->
+  <parameter name="sendfile-allowed" value="true" />
+
   <!-- Restrict access to authorized users.
        User authentication and roles are provided by the servlet container 
        (see tomcat-users.xml).
        Authorization for resources (directories) is evaluated by the servlet 
        (see auth-file). -->
-  <parameter name="use-authorization" value="false" />
+  <parameter name="use-authorization" value="true" />
 
   <!-- 	  URL location of XML file with authorization requirements. -->
   <parameter name="auth-file" value="/docuserver/www/digitallibrary/WEB-INF/digilib-auth.xml" />
Binary file client/digitallibrary/WEB-INF/lib/clibwrapper_jiio.jar has changed
Binary file client/digitallibrary/WEB-INF/lib/jai_imageio.jar has changed
--- a/client/digitallibrary/digicat.jsp	Fri Jan 24 21:55:54 2003 +0100
+++ b/client/digitallibrary/digicat.jsp	Fri Jan 24 22:13:49 2003 +0100
@@ -18,13 +18,13 @@
 %>
 
 <%
+// set up request object for base URL
+digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
 // check if authentication is needed and redirect if necessary
-docBean.doAuthentication(request, response);
+docBean.doAuthentication(dlRequest, response);
 
-// set up request object for base URL
-digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest();
-dlRequest.setBaseURL(request);
-
+// add number of pages
+dlRequest.setPt(docBean.getNumPages(dlRequest));
 %>
 
 <html>
@@ -34,17 +34,14 @@
 
 var baseUrl = "<%= dlRequest.getBaseURL() %>";
 
-// DEBUG
-//alert('DIR: <%= docBean.getDocuPath(request) %> PAGES: <%= docBean.getNumPages(request) %>');
-
 // the document's query string (minus "?")
 var query = location.search.substring(1);
 
 // first page number
-var firstPage = <%= docBean.getFirstPage(request) %>;
+var firstPage = <%= docBean.getFirstPage(dlRequest) %>;
 
 // number of pages of the document
-var numPages = <%= docBean.getNumPages(request) %>;
+var numPages = <%= docBean.getNumPages(dlRequest) %>;
 
     // browser version test to include the corresponding navigation-file
     if ((navigator.appName.toLowerCase() == "netscape") && (parseFloat(navigator.appVersion) < 5.0)) {
--- a/client/digitallibrary/digilib.jsp	Fri Jan 24 21:55:54 2003 +0100
+++ b/client/digitallibrary/digilib.jsp	Fri Jan 24 22:13:49 2003 +0100
@@ -18,17 +18,15 @@
 %>
 
 <%
-// check if authentication is needed and redirect if necessary
-docBean.doAuthentication(request, response);
-
 // parsing the query
 // -----------------
 
-digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest();
-// fill the request with the old format query string
-dlRequest.setWithOldString(request.getQueryString());
+digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
+// check if authentication is needed and redirect if necessary
+docBean.doAuthentication(dlRequest, response);
+
 // add number of pages
-dlRequest.setPt(docBean.getNumPages(request));
+dlRequest.setPt(docBean.getNumPages(dlRequest));
 // retrieve request in new paramter format 
 String query = "dlImage.jsp?" + dlRequest.getAsString();
 %>
--- a/client/digitallibrary/dlImage.jsp	Fri Jan 24 21:55:54 2003 +0100
+++ b/client/digitallibrary/dlImage.jsp	Fri Jan 24 22:13:49 2003 +0100
@@ -28,7 +28,7 @@
 } else {
 
 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest();
-// default values for parameters
+/* default values for parameters
 dlRequest.setFn("/");					// url of the page/document
 dlRequest.setPn(1);					// page number
 dlRequest.setWs(1);					// scale factor
@@ -38,13 +38,10 @@
 dlRequest.setWy(0);					// top edge in image (float from 0 to 1)
 dlRequest.setWw(1);					// width of image (float from 0 to 1)
 dlRequest.setWh(1);					// height of image (float from 0 to 1)
+*/
 // overrriding default parameters with provided parameters from query-string
 dlRequest.setWithRequest(request);
 
-//String imageLocation = "http://" + request.getServerName() + "/docuserver/digitallibrary/servlet/Scaler/" + fn + "?pn=" + pn + "&ws=" + ws + "&mo=" + mo + "&wx=" + wx + "&wy=" + wy + "&ww=" + ww + "&wh=" + wh + "&dw=" + dw + "&dh=" + dh;
-
-String baseUrl = dlRequest.getBaseURL();
-
 String imageLocation = dlRequest.getBaseURL() + "/servlet/Scaler/?" + dlRequest.getAsString();
 %>
 
@@ -74,7 +71,7 @@
 
 </script>
 </head>
-<body bgcolor="#666666" onload='init_pagesTotal("<%= dlRequest.getFn() %>", "<%= dlRequest.getPn() %>", "<%= dlRequest.getWs() %>", "<%= dlRequest.getMo() %>", "<%= dlRequest.getMk() %>", "<%= dlRequest.getWx() %>", "<%= dlRequest.getWy() %>", "<%= dlRequest.getWw() %>", "<%= dlRequest.getWh() %>", "<%= dlRequest.getPt() %>")'>
+<body bgcolor="#666666" onload='init_pagesTotal("<%= dlRequest.getFilePath() %>", "<%= dlRequest.getPn() %>", "<%= dlRequest.getWs() %>", "<%= dlRequest.getMo() %>", "<%= dlRequest.getMk() %>", "<%= dlRequest.getWx() %>", "<%= dlRequest.getWy() %>", "<%= dlRequest.getWw() %>", "<%= dlRequest.getWh() %>", "<%= dlRequest.getPt() %>")'>
 
 <div id="lay1" style="position: absolute; left: 10px; top: 10px; visibility: visible"><img name="pic" src="<%= imageLocation %>" border="0"></div>