view client/digitallibrary/digicat.jsp @ 52:36505ac4a334

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. - removed xerces.jar. It seems not necessary any more (JDK 1.3.1, Tomcat 4.0.4)
author robcast
date Thu, 15 Aug 2002 23:40:15 +0200
parents d407cb901df4
children 58d23f512c80
line wrap: on
line source

<html>
<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);

// calculate base URL string from request (minus last part)
String baseUrl = request.getRequestURL().toString();
int eop = baseUrl.lastIndexOf("/");
if (eop > 0) {
    baseUrl = baseUrl.substring(0, eop);
} else {
    baseUrl = "http://" + request.getServerName() + "/docuserver/digitallibrary";
}

%>

<script language="JavaScript">

var baseUrl = "<%= baseUrl %>";

// DEBUG
//alert('DIR: <%= DB.getDocuPath(request) %> PAGES: <%= DB.getNumPages(request) %>');

// the document's query string (minus "?")
var query = location.search.substring(1);

// first page number
var firstPage = <%= DB.getFirstPage(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="navcat_n4.js"><\/script>');
    } else if (navigator.appName.toLowerCase() == "netscape") {
        top.document.write('<script src="navcat_n6.js"><\/script>');
    } else if ((navigator.appName.toLowerCase() == "microsoft internet explorer") && (parseFloat(navigator.appVersion) >= 4.0)) {
    	top.document.write('<script src="navcat_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="navcat_n6.js"><\/script>');
    }   

</script>

</head>

<frameset cols="*,90" boder="no" border="0" onLoad="whichFrame = parent.mainFrame; initPicture(query); loadThumbTable(); initScripts();">
  <frame name="mainFrame" src="about:blank">
  <frame name="rightFrame" src="navcat.html" scrolling="no" noresize>
</frameset>

</html>