Commit 1ccd1a96 authored by engler's avatar engler
Browse files

XUL: Digilib Buttons in chrome

parent 926fb20c
changes document for digilib-client
-----------------------------------
CURRENT SYMLINKS
navigation_XX.js -> navigation14_XX.js
digilib.jsp -> digilib19.jsp
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).
27.8.2002 - digilib.jsp, digicat.jsp, dlImage.jsp : roc
- Initialization of docBean only once in jspInit.
- Use of new DigilibRequest object for translation of +++-style requests
into parameter-style requests and processing of baseURL.
13.8.2002 - [different files] : roc
- changed all hardcoded occurrences of /docuserver/digitallibrary to
work relative or take the path from the request URL. Introduced a
variable baseURL to hold the URL path (up to digilib.jsp etc.). Now
it should be possible to install digilib in other directories.
20.05.2002 - navigation_o6.js : luginbuehl
- Opera browser support done. the 'b'-key does not work currently, beause
Opera uses this key on its own - have to work something out...
18.05.2002 - [different files] : luginbuehl
- works on Opera browser support (functionality is getting better, menu
still has lots of errors)
- working on a Opera version that does work independantly of the http
browser imitation set (though!)
18.05.2002 - modules/pagesTotal.js : luginbuehl
- fixied an error in function page(keepArea) which did not work on all
browsers correctly.
<!--
-->
<!-- Authentication configuration file for Digital Document Library -->
<auth-config>
<digilib-paths>
......
......@@ -13,6 +13,12 @@
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).
......
......@@ -3,81 +3,117 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- General description of your web application -->
<display-name>Docuserver</display-name>
<description>
This is the web frontend of Docuserver.
</description>
<servlet>
<servlet-name>Scaler</servlet-name>
<description>
The servlet to scale the digilib images.
</description>
<servlet-class>digilib.servlet.Scaler</servlet-class>
<!-- parameters to the servlet -->
<init-param>
<param-name>config-file</param-name>
<param-value>
/docuserver/www/digitallibrary/WEB-INF/digilib-config.xml
</param-value>
</init-param>
<!-- Load this servlet at server startup time -->
<load-on-startup>5</load-on-startup>
</servlet>
<!-- General description of your web application -->
<display-name>
digilib
</display-name>
<description>
This is the web frontend of the Digital Document Library.
</description>
<!-- The Scaler servlet -->
<servlet>
<servlet-name>
Scaler
</servlet-name>
<description>
The servlet to scale the digilib images.
</description>
<servlet-class>
digilib.servlet.Scaler
</servlet-class>
<!-- parameters to the servlet -->
<init-param>
<param-name>
config-file
</param-name>
<param-value>
/docuserver/www/digitallibrary/WEB-INF/digilib-config.xml
</param-value>
</init-param>
<!-- Load this servlet at server startup time -->
<load-on-startup>
5
</load-on-startup>
</servlet>
<!-- We want to finger around with the default JSP servlet... -->
<servlet>
<servlet-name>doc-jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>logVerbosityLevel</param-name>
<param-value>WARNING</param-value>
</init-param>
<!-- parameters to the servlet -->
<init-param>
<param-name>config-file</param-name>
<param-value>
/docuserver/www/digitallibrary/WEB-INF/digilib-config.xml
</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
<servlet-name>
doc-jsp
</servlet-name>
<servlet-class>
org.apache.jasper.servlet.JspServlet
</servlet-class>
<!-- parameters to the JSP servlet -->
<init-param>
<param-name>
logVerbosityLevel
</param-name>
<param-value>
WARNING
</param-value>
</init-param>
<init-param>
<param-name>
config-file
</param-name>
<param-value>
/docuserver/www/digitallibrary/WEB-INF/digilib-config.xml
</param-value>
</init-param>
<load-on-startup>
3
</load-on-startup>
</servlet>
<!-- The mapping for the Scaler servlet -->
<servlet-mapping>
<servlet-name>
Scaler
</servlet-name>
<url-pattern>
/servlet/Scaler/*
</url-pattern>
</servlet-mapping>
<!-- The mapping for the JSP servlet -->
<servlet-mapping>
<servlet-name>doc-jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
<servlet-name>
doc-jsp
</servlet-name>
<url-pattern>
*.jsp
</url-pattern>
</servlet-mapping>
<!-- region for authenticated access -->
<security-constraint>
<web-resource-collection>
<web-resource-name>Authenticated Digilib</web-resource-name>
<url-pattern>/authenticated/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<!--
<auth-method>BASIC</auth-method>
<realm-name>digilib</realm-name>
-->
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/digilib-login.html</form-login-page>
<form-error-page>/digilib-fail.html</form-error-page>
</form-login-config>
</login-config>
<security-constraint>
<web-resource-collection>
<web-resource-name>
Authenticated Digilib
</web-resource-name>
<url-pattern>
/authenticated/*
</url-pattern>
</web-resource-collection>
<!-- we need a default user -->
<auth-constraint>
<role-name>
user
</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<!--
<auth-method>BASIC</auth-method>
<realm-name>digilib</realm-name>
-->
<auth-method>
FORM
</auth-method>
<form-login-config>
<form-login-page>
/digilib-login.html
</form-login-page>
<form-error-page>
/digilib-fail.html
</form-error-page>
</form-login-config>
</login-config>
</web-app>
function checkBrowser(){
this.ver = navigator.appVersion;
this.dom = document.getElementById ? 1 : 0;
this.ie5 = (this.ver.indexOf("MSIE 5")>-1 && this.dom) ? 1 : 0;
this.ie4 = (document.all && !this.dom) ? 1 : 0;
this.ns5 = (this.dom && parseInt(this.ver) >= 5) ? 1 : 0;
this.ns4 = (document.layers && !this.dom) ? 1 : 0;
this.ie = (this.ie4 || this.ie5);
return this;
}
function checkBrowser() {
this.ua = navigator.userAgent;
this.ver = navigator.appVersion;
this.dom = ( document.getElementById );
this.opera = ( this.dom ) && ( this.ua.toLowerCase().indexOf("opera") > -1 );
this.ie4 = ( document.all ) && ( !this.dom );
this.ie5 = ( this.ver.indexOf("MSIE 5") > -1 ) && ( this.dom );
this.ie6 = ( this.ver.indexOf("MSIE 6") > -1 ) && ( this.dom );
this.ns4 = ( document.layers ) && ( !this.dom );
this.ns6 = ( this.dom ) && ( parseInt(this.ver) >= 5 ) && ( !this.opera );
this.ns = this.ns4 || this.ns6;
this.ie = this.ie4 || this.ie5 || this.ie6;
return this;
}
browser = new checkBrowser();
......@@ -63,7 +69,7 @@ function overItem(obj) {
}
function awayItem(obj) {
changeBc("menu" + obj, '');
changeBc("menu" + obj, '#666666');
timeID = setTimeout("hideMenu()", 700);
}
......@@ -138,10 +144,17 @@ function contextHelp(n) {
helpWindow.document.close();
// stupid workaround because of netscape 6, that doesen't know the opener property
// this workaround is still ok cause netscape 6 has eventbuffer checks so no overflow
if (browser.ns5) {
// this workaround is still ok because netscape 6 has eventbuffer checks so no overflow
if (browser.ns6) {
semaphor = true;
}
// next stupid workaround because of opera 6, that somehow don't start the 'onLoad'-
// attribute in the body tag (the helpwindow does not finish loading)
if (browser.opera) {
setTimeout("semaphor = true;", 50);
}
}
}
......
......@@ -8,7 +8,9 @@
<!-- Beginning of JavaScript --------
this.location = "http://"+location.host+"/docuserver/digitallibrary/digicat.jsp"+location.search;
//this.location = "http://"+location.host+"/docuserver/digitallibrary/digicat.jsp"+location.search;
this.location.replace(this.location.href.replace(/\.html/, ".jsp"));
// -- End of JavaScript code -------------- -->
......@@ -17,9 +19,12 @@ this.location = "http://"+location.host+"/docuserver/digitallibrary/digicat.jsp"
<body>
<h1>Digital Library Redirect</h1>
<p>You should automatically be redirected to the Digital Library page.</p>
<p>You should automatically be redirected to the Digital Library page.
(<tt>digicat.<b>jsp</b></tt>)</p>
<p>If this doesn't happen please <a href="digicat.jsp">click here</a>.</p>
<p>If this doesn't happen make shure JavaScript is enabled in your browser.
The Digital Library pages need JavaScript to work. If your problem still
remains, please contact the administrator.</p>
<hr>
<address>robert.casties@philo.unibe.ch</address>
......
<html>
<head>
<%@ page language="java" %>
<jsp:useBean id="DB" scope="page" class="digilib.servlet.DocumentBean" />
<%!
// 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);
}
}
%>
<%
// set servlet init-parameter
DB.setConfig(getServletConfig());
// 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
DB.doAuthentication(request, response);
docBean.doAuthentication(dlRequest, response);
// add number of pages
dlRequest.setPt(docBean.getNumPages(dlRequest));
%>
<html>
<head>
<script language="JavaScript">
// DEBUG
//alert('DIR: <%= DB.getDocuPath(request) %> PAGES: <%= DB.getNumPages(request) %>');
var baseUrl = "<%= dlRequest.getBaseURL() %>";
// the document's query string (minus "?")
var query = location.search.substring(1);
// first page number
var firstPage = <%= DB.getFirstPage(request) %>;
var firstPage = <%= docBean.getFirstPage(dlRequest) %>;
// number of pages of the document
var numPages = <%= DB.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)) {
......
......@@ -5,20 +5,24 @@
</head>
<script LANGUAGE="JavaScript">
<!-- Beginning of JavaScript --------
this.location = "http://"+location.host+"/docuserver/digitallibrary/digilib.jsp"+location.search;
// this.location = "http://"+location.host+"/docuserver/digitallibrary/digilib.jsp"+location.search;
this.location.replace(this.location.href.replace(/\.html/, ".jsp"));
// -- End of JavaScript code -------------- -->
</script>
</SCRIPT>
<body>
<h1>Digital Library Redirect</h1>
<p>You should automatically be redirected to the Digital Library page.</p>
<p>You should automatically be redirected to the Digital Library page.
(<tt>digilib.<b>jsp</b></tt>)</p>
<p>If this doesn't happen please <a href="digilib.jsp">click here</a>.</p>
<p>If this doesn't happen make shure JavaScript is enabled in your browser.
The Digital Library pages need JavaScript to work. If your problem still
remains, please contact the administrator.</p>
<hr>
<address>robert.casties@philo.unibe.ch</address>
......
<html>
<title>Digital Document Library</title>
<head>
<jsp:useBean id="DB" scope="page" class="digilib.servlet.DocumentBean" />
<%
// set servlet init-parameter
DB.setConfig(getServletConfig());
// check if authentication is needed and redirect if necessary
DB.doAuthentication(request, response);
%>
<script language="JavaScript">
// the document's query string (minus "?")
var query = location.search.substring(1);
// feel free to uncomment - i have never seen a problem so...
// // DEBUG
// alert('DIR: <%= DB.getDocuPath(request) %> PAGES: <%= DB.getNumPages(request) %>');
// number of pages of the document
var numPages = <%= DB.getNumPages(request) %>;
// browser version test to include the corresponding navigation-file
if ((navigator.appName.toLowerCase() == "netscape") && (parseFloat(navigator.appVersion) < 5.0)) {
top.document.write('<script src="navigation_n4.js"><\/script>');
} else if (navigator.appName.toLowerCase() == "netscape") {
top.document.write('<script src="navigation_n6.js"><\/script>');
} else if ((navigator.appName.toLowerCase() == "microsoft internet explorer") && (parseFloat(navigator.appVersion) >= 4.0)) {
top.document.write('<script src="navigation11_ie.js"><\/script>');
} else {
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.');
top.document.write('<script src="navigation_n6.js"><\/script>');
}
</script>
</head>
<frameset cols="*,90" border="0" onLoad="whichFrame = parent.mainFrame; initPicture(query); loadPicture(2); initScripts();">
<frame name="mainFrame" src="about:blank" scrolling="auto">
<frameset rows="20,*" border="0">
<frame name="pageFrame" src="about:blank" scrolling="no" noresize>
<frame name="rightFrame" src="navigation.html" scrolling="no" noresize>
</frameset>
</frameset>
</html>
<%@ page language="java" %>
<%!
/*
Copyright (C) 2003 WTWG, Uni Bern
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Author: Christian Luginbuehl, 01.05.2003 , Version Alcatraz 0.3
*/
// 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);
}
}
%>
<%
// parsing the query
// -----------------
//digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest();
dlRequest.setWithRequest(request);
// check if authentication is needed and redirect if necessary
docBean.doAuthentication(dlRequest, response);
%>
<%
// the different levels of presentation
// ------------------------------------
// level 3 representation hack - lugi
// it would be musch more interesting to check
// if the sidebar is actually installed and in
// the case it isn't - automatically do it.
// however this requires client-side tests and
// so slows down everything.
// we might want to talk about it for a future
// release
if (dlRequest.getLv() == 3) {
String userAgent = request.getHeader("User-Agent").toLowerCase();
if (userAgent.indexOf("mozilla/5.0") == 0) {
// mozilla 5 that does not support xul-sidebars
if (userAgent.indexOf("opera") > -1) dlRequest.setLv(2);
if (userAgent.indexOf("chimera") > -1) dlRequest.setLv(2);
if (userAgent.indexOf("camino") > -1) dlRequest.setLv(2);
if (userAgent.indexOf("konqueror") > -1) dlRequest.setLv(2);
if (userAgent.indexOf("safari") > -1) dlRequest.setLv(2);
if (userAgent.indexOf("galeon") > -1) dlRequest.setLv(2);
if (userAgent.indexOf("skipstone") > -1) dlRequest.setLv(2);
if (userAgent.indexOf("k-meleon") > -1) dlRequest.setLv(2);
if (userAgent.indexOf("firebird") > -1) dlRequest.setLv(2);
// the chance is quite big, that the browser supports xul-sidebars
dlRequest.setLv(1);
} else {
// redirect to level 2 because of definitive lack of sidebar support
dlRequest.setLv(2);
}
}
switch (dlRequest.getLv()) {
// LEVEL 0 --------------------------------------------------------------
case 0:
%>
<%
break; // level 0
// LEVEL 1 --------------------------------------------------------------
case 1:
%>
<%
// checking if the height and width of this client is already known
if ((dlRequest.getDw() == 0) || (dlRequest.getDh() == 0)) {
%>
<html>
<head>
<script language="Javascript">
function