annotate client/digitallibrary/digicat.jsp @ 72:300d5ba8b33b

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 21:40:59 +0100
parents 58d23f512c80
children b877e54b0794
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
60
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
1 <%@ page language="java" %>
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
2
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
3 <%!
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
4 // authentication stuff - robert
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
5 // -----------------------------
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
6 // create DocumentBean instance for all JSP requests
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
7 digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean();
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
8
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
9 // initialize DocumentBean instance in JSP init
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
10 public void jspInit() {
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
11 try {
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
12 // set servlet init-parameter
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
13 docBean.setConfig(getServletConfig());
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
14 } catch (javax.servlet.ServletException e) {
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
15 System.out.println(e);
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
16 }
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
17 }
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
18 %>
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
19
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
20 <%
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
21 // check if authentication is needed and redirect if necessary
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
22 docBean.doAuthentication(request, response);
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
23
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
24 // set up request object for base URL
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
25 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest();
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
26 dlRequest.setBaseURL(request);
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
27
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
28 %>
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
29
20
d407cb901df4 Initial revision
robcast
parents:
diff changeset
30 <html>
d407cb901df4 Initial revision
robcast
parents:
diff changeset
31 <head>
d407cb901df4 Initial revision
robcast
parents:
diff changeset
32
d407cb901df4 Initial revision
robcast
parents:
diff changeset
33 <script language="JavaScript">
d407cb901df4 Initial revision
robcast
parents:
diff changeset
34
60
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
35 var baseUrl = "<%= dlRequest.getBaseURL() %>";
52
36505ac4a334 13.8.2002 - [different files] : roc
robcast
parents: 20
diff changeset
36
20
d407cb901df4 Initial revision
robcast
parents:
diff changeset
37 // DEBUG
60
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
38 //alert('DIR: <%= docBean.getDocuPath(request) %> PAGES: <%= docBean.getNumPages(request) %>');
20
d407cb901df4 Initial revision
robcast
parents:
diff changeset
39
d407cb901df4 Initial revision
robcast
parents:
diff changeset
40 // the document's query string (minus "?")
d407cb901df4 Initial revision
robcast
parents:
diff changeset
41 var query = location.search.substring(1);
d407cb901df4 Initial revision
robcast
parents:
diff changeset
42
d407cb901df4 Initial revision
robcast
parents:
diff changeset
43 // first page number
60
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
44 var firstPage = <%= docBean.getFirstPage(request) %>;
20
d407cb901df4 Initial revision
robcast
parents:
diff changeset
45
d407cb901df4 Initial revision
robcast
parents:
diff changeset
46 // number of pages of the document
60
58d23f512c80 New DigilibServlet.jar with new version (with DigilibRequest object).
robcast
parents: 52
diff changeset
47 var numPages = <%= docBean.getNumPages(request) %>;
20
d407cb901df4 Initial revision
robcast
parents:
diff changeset
48
d407cb901df4 Initial revision
robcast
parents:
diff changeset
49 // browser version test to include the corresponding navigation-file
d407cb901df4 Initial revision
robcast
parents:
diff changeset
50 if ((navigator.appName.toLowerCase() == "netscape") && (parseFloat(navigator.appVersion) < 5.0)) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
51 top.document.write('<script src="navcat_n4.js"><\/script>');
d407cb901df4 Initial revision
robcast
parents:
diff changeset
52 } else if (navigator.appName.toLowerCase() == "netscape") {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
53 top.document.write('<script src="navcat_n6.js"><\/script>');
d407cb901df4 Initial revision
robcast
parents:
diff changeset
54 } else if ((navigator.appName.toLowerCase() == "microsoft internet explorer") && (parseFloat(navigator.appVersion) >= 4.0)) {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
55 top.document.write('<script src="navcat_ie.js"><\/script>');
d407cb901df4 Initial revision
robcast
parents:
diff changeset
56 } else {
d407cb901df4 Initial revision
robcast
parents:
diff changeset
57 alert('Your browser is not directly supported by this client right now.\n\nLoading now the optimised version for Netscape 6, that sticks the most to the w3c specifications.');
d407cb901df4 Initial revision
robcast
parents:
diff changeset
58 top.document.write('<script src="navcat_n6.js"><\/script>');
d407cb901df4 Initial revision
robcast
parents:
diff changeset
59 }
d407cb901df4 Initial revision
robcast
parents:
diff changeset
60
d407cb901df4 Initial revision
robcast
parents:
diff changeset
61 </script>
d407cb901df4 Initial revision
robcast
parents:
diff changeset
62
d407cb901df4 Initial revision
robcast
parents:
diff changeset
63 </head>
d407cb901df4 Initial revision
robcast
parents:
diff changeset
64
d407cb901df4 Initial revision
robcast
parents:
diff changeset
65 <frameset cols="*,90" boder="no" border="0" onLoad="whichFrame = parent.mainFrame; initPicture(query); loadThumbTable(); initScripts();">
d407cb901df4 Initial revision
robcast
parents:
diff changeset
66 <frame name="mainFrame" src="about:blank">
d407cb901df4 Initial revision
robcast
parents:
diff changeset
67 <frame name="rightFrame" src="navcat.html" scrolling="no" noresize>
d407cb901df4 Initial revision
robcast
parents:
diff changeset
68 </frameset>
d407cb901df4 Initial revision
robcast
parents:
diff changeset
69
d407cb901df4 Initial revision
robcast
parents:
diff changeset
70 </html>