107
|
1 <%@ page language="java" %>
|
|
2
|
|
3 <%!
|
|
4 /*
|
|
5 Copyright (C) 2003 WTWG, Uni Bern
|
|
6
|
|
7 This program is free software; you can redistribute it and/or
|
|
8 modify it under the terms of the GNU General Public License
|
|
9 as published by the Free Software Foundation; either version 2
|
|
10 of the License, or (at your option) any later version.
|
|
11
|
|
12 This program is distributed in the hope that it will be useful,
|
|
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 GNU General Public License for more details.
|
|
16
|
|
17 You should have received a copy of the GNU General Public License
|
|
18 along with this program; if not, write to the Free Software
|
|
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
20
|
|
21 Author: Christian Luginbuehl, 01.05.2003 , Version Alcatraz 0.3
|
|
22 */
|
|
23 // authentication stuff - robert
|
|
24 // -----------------------------
|
|
25 // create DocumentBean instance for all JSP requests
|
|
26 digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean();
|
|
27
|
|
28 // initialize DocumentBean instance in JSP init
|
|
29 public void jspInit() {
|
|
30 try {
|
|
31 // set servlet init-parameter
|
|
32 docBean.setConfig(getServletConfig());
|
|
33 } catch (javax.servlet.ServletException e) {
|
|
34 System.out.println(e);
|
|
35 }
|
|
36 }
|
|
37 %>
|
|
38
|
|
39
|
|
40
|
|
41
|
|
42 <%
|
|
43
|
|
44 // parsing the query
|
|
45 // -----------------
|
|
46
|
|
47 //digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
|
|
48 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest();
|
|
49 dlRequest.setWithRequest(request);
|
|
50 // check if authentication is needed and redirect if necessary
|
|
51 docBean.doAuthentication(dlRequest, response);
|
|
52
|
|
53 %>
|
|
54
|
|
55 <%
|
|
56
|
|
57 // the different levels of presentation
|
|
58 // ------------------------------------
|
|
59
|
|
60
|
|
61 // level 3 representation hack - lugi
|
|
62 // it would be musch more interesting to check
|
|
63 // if the sidebar is actually installed and in
|
|
64 // the case it isn't - automatically do it.
|
|
65 // however this requires client-side tests and
|
|
66 // so slows down everything.
|
|
67 // we might want to talk about it for a future
|
|
68 // release
|
|
69
|
|
70 if (dlRequest.getLv() == 3) {
|
|
71 String userAgent = request.getHeader("User-Agent").toLowerCase();
|
|
72
|
|
73 if (userAgent.indexOf("mozilla/5.0") == 0) {
|
|
74
|
|
75 // mozilla 5 that does not support xul-sidebars
|
|
76 if (userAgent.indexOf("opera") > -1) dlRequest.setLv(2);
|
|
77 if (userAgent.indexOf("chimera") > -1) dlRequest.setLv(2);
|
|
78 if (userAgent.indexOf("camino") > -1) dlRequest.setLv(2);
|
|
79 if (userAgent.indexOf("konqueror") > -1) dlRequest.setLv(2);
|
|
80 if (userAgent.indexOf("safari") > -1) dlRequest.setLv(2);
|
|
81 if (userAgent.indexOf("galeon") > -1) dlRequest.setLv(2);
|
|
82 if (userAgent.indexOf("skipstone") > -1) dlRequest.setLv(2);
|
|
83 if (userAgent.indexOf("k-meleon") > -1) dlRequest.setLv(2);
|
|
84 if (userAgent.indexOf("firebird") > -1) dlRequest.setLv(2);
|
|
85
|
|
86 // the chance is quite big, that the browser supports xul-sidebars
|
|
87 dlRequest.setLv(1);
|
|
88
|
|
89 } else {
|
|
90
|
|
91 // redirect to level 2 because of definitive lack of sidebar support
|
|
92 dlRequest.setLv(2);
|
|
93 }
|
|
94 }
|
|
95
|
|
96
|
|
97
|
|
98 switch (dlRequest.getLv()) {
|
|
99
|
|
100 // LEVEL 0 --------------------------------------------------------------
|
|
101
|
|
102 case 0:
|
|
103 %>
|
|
104
|
|
105 <%
|
|
106 break; // level 0
|
|
107
|
|
108
|
|
109
|
|
110
|
|
111 // LEVEL 1 --------------------------------------------------------------
|
|
112
|
|
113 case 1:
|
|
114 %>
|
|
115
|
|
116 <%
|
|
117 // checking if the height and width of this client is already known
|
|
118 if ((dlRequest.getDw() == 0) || (dlRequest.getDh() == 0)) {
|
|
119 %>
|
|
120
|
|
121 <html>
|
|
122 <head>
|
|
123 <script language="Javascript">
|
|
124
|
|
125 function redirect() {
|
|
126
|
|
127 if (document.body) {
|
|
128
|
|
129 // internet explorer + opera
|
|
130 client = "&dw=" + (document.body.clientWidth-30) + "&dh=" + (document.body.clientHeight-30);
|
|
131
|
|
132 } else {
|
|
133
|
|
134 // mozilla-browsers (netscape 4.xx, netscape 6.xx, etc.)
|
|
135 client = "&dw=" + (innerWidth-30) + "&dh=" + (innerHeight-30);
|
|
136
|
|
137 }
|
|
138
|
|
139 location.replace(document.URL + client);
|
|
140 }
|
|
141
|
|
142 </script>
|
|
143 </head>
|
|
144 <body bgcolor="#666666" onload="redirect()">
|
|
145 </body>
|
|
146 </html>
|
|
147
|
|
148 <%
|
|
149 } else {
|
|
150
|
|
151 // add number of pages
|
|
152 dlRequest.setPt(docBean.getNumPages(dlRequest));
|
|
153
|
|
154 String imageLocation = dlRequest.getBaseURL() + "/servlet/Scaler/?" + dlRequest.getAsString();
|
|
155 %>
|
|
156
|
|
157 <html>
|
|
158 <head>
|
|
159 <title>Digital Document Library - Alcatraz (Level 1)</title>
|
|
160
|
|
161 <script language="JavaScript">
|
|
162
|
|
163 var baseUrl = "<%= dlRequest.getBaseURL() %>";
|
|
164
|
|
165 // browser version test to include the corresponding navigation-file
|
|
166 if (navigator.userAgent.toLowerCase().indexOf("opera") > -1) {
|
|
167 document.write('<script src="navigation_o6.js"><\/script>');
|
|
168 } else if (navigator.userAgent.toLowerCase().indexOf("msie") > -1) {
|
|
169 document.write('<script src="navigation_ie.js"><\/script>');
|
|
170 } else if (navigator.userAgent.toLowerCase().indexOf("mozilla\/4") > -1) {
|
|
171 document.write('<script src="navigation_n4.js"><\/script>');
|
|
172 } else if (navigator.userAgent.toLowerCase().indexOf("mozilla\/5") > -1) {
|
|
173 document.write('<script src="navigation_n6.js"><\/script>');
|
|
174 } else {
|
|
175 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.');
|
|
176 document.write('<script src="navigation_n6.js"><\/script>');
|
|
177 }
|
|
178
|
|
179 // add module to show the total number of pages (not browser dependant!)
|
|
180 document.write('<script src="modules\/pagesTotal.js"><\/script>\n');
|
|
181 document.write('<script src="modules\/mirror.js"><\/script>\n');
|
|
182 document.write('<script src="modules\/imago.js"><\/script>\n');
|
|
183 document.write('<script src="modules\/pixelByPixel.js"><\/script>\n');
|
|
184 document.write('<script src="modules\/newReferences.js"><\/script>\n');
|
|
185 document.write('<script src="modules\/fitGIFs.js"><\/script>\n');
|
|
186
|
|
187 </script>
|
|
188
|
|
189 </head>
|
|
190
|
|
191 <body bgcolor="#666666" onload='init_imago("<%= dlRequest.getFilePath() %>", "<%= dlRequest.getPn() %>", "<%= dlRequest.getWs() %>", "<%= dlRequest.getMo() %>", "<%= dlRequest.getMk() %>", "<%= dlRequest.getWx() %>", "<%= dlRequest.getWy() %>", "<%= dlRequest.getWw() %>", "<%= dlRequest.getWh() %>", "<%= dlRequest.getPt() %>", "<%= dlRequest.getBrgt() %>", "<%= dlRequest.getCont() %>", "<%= dlRequest.getRot() %>", "<%= dlRequest.getRgba_s() %>", "<%= dlRequest.getRgbm_s() %>")'>
|
|
192
|
|
193 <div id="lay1" style="position: absolute; left: 10px; top: 10px; visibility: visible"><img name="pic" src="<%= imageLocation %>" border="0"></div>
|
|
194
|
|
195 <div id="dot0" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark1.gif" border="0"></div>
|
|
196 <div id="dot1" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark2.gif" border="0"></div>
|
|
197 <div id="dot2" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark3.gif" border="0"></div>
|
|
198 <div id="dot3" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark4.gif" border="0"></div>
|
|
199 <div id="dot4" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark5.gif" border="0"></div>
|
|
200 <div id="dot5" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark6.gif" border="0"></div>
|
|
201 <div id="dot6" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark7.gif" border="0"></div>
|
|
202 <div id="dot7" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="mark8.gif" border="0"></div>
|
|
203 <div id="eck1" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="olinks.gif" border="0"></div>
|
|
204 <div id="eck2" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="orechts.gif" border="0"></div>
|
|
205 <div id="eck3" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="ulinks.gif" border="0"></div>
|
|
206 <div id="eck4" style="position: absolute; left: -20; top: 100; visibility: hidden"><img src="urechts.gif" border="0"></div>
|
|
207
|
|
208 </body>
|
|
209
|
|
210 </html>
|
|
211 <%
|
|
212 }
|
|
213 %>
|
|
214
|
|
215 <%
|
|
216 break; // level 1
|
|
217
|
|
218
|
|
219
|
|
220
|
|
221 // LEVEL 2 --------------------------------------------------------------
|
|
222
|
|
223 case 2:
|
|
224 %>
|
|
225
|
|
226 <%
|
|
227 // retrieve request in new paramter format and redirect to level 1
|
|
228 dlRequest.setLv(1);
|
|
229 String query = "digilib.jsp?" + dlRequest.getAsString();
|
|
230 %>
|
|
231
|
|
232 <html>
|
|
233 <head>
|
|
234 <title>Digital Document Library - Alcatraz (Level 2)</title>
|
|
235 </head>
|
|
236
|
|
237 <frameset cols="*,90" border="0">
|
|
238 <frame name="mainFrame" src="<%= query %>" scrolling="auto">
|
|
239 <frameset rows="20,*" border="0">
|
|
240 <frame name="pageFrame" src="about:blank" scrolling="no" noresize>
|
|
241 <frame name="rightFrame" src="dlMenu.html" scrolling="no" noresize>
|
|
242 </frameset>
|
|
243 </frameset>
|
|
244
|
|
245 </html>
|
|
246
|
|
247 <%
|
|
248 break; // level 2
|
|
249
|
|
250 } // end switch
|
|
251
|
|
252 %>
|