# HG changeset patch # User luginbue # Date 1089332154 -7200 # Node ID 88f2de6b518a256d9f9a69f40ded6868dcded04e # Parent 7349d58cd391e75ef24415b35daa9947fd59448f new digicat version with only one js file diff -r 7349d58cd391 -r 88f2de6b518a client/digitallibrary/digicat.jsp --- a/client/digitallibrary/digicat.jsp Fri Jul 09 02:15:54 2004 +0200 +++ b/client/digitallibrary/digicat.jsp Fri Jul 09 02:15:54 2004 +0200 @@ -1,67 +1,172 @@ -<%@ page language="java" %> - -<%! -// 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 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(dlRequest, response); - -// add number of pages -dlRequest.setValue("pt", docBean.getNumPages(dlRequest)); -%> - - - - - - - - - - - - - - +<%@ page language="java" %> + +<%! +// 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 dcRequest = new digilib.servlet.DigilibRequest(request); +// check if authentication is needed and redirect if necessary +docBean.doAuthentication(dcRequest, response); + +%> + + +<% + +// the different levels of presentation +// ------------------------------------ + + +// level 3 representation hack - lugi + // it would be much 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 (dcRequest.getAsInt("lv") == 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) dcRequest.setValue("lv", 2); + if (userAgent.indexOf("chimera") > -1) dcRequest.setValue("lv", 2); + if (userAgent.indexOf("camino") > -1) dcRequest.setValue("lv", 2); + if (userAgent.indexOf("konqueror") > -1) dcRequest.setValue("lv", 2); + if (userAgent.indexOf("safari") > -1) dcRequest.setValue("lv", 2); + if (userAgent.indexOf("galeon") > -1) dcRequest.setValue("lv", 2); + if (userAgent.indexOf("skipstone") > -1) dcRequest.setValue("lv", 2); + if (userAgent.indexOf("k-meleon") > -1) dcRequest.setValue("lv", 2); + if (userAgent.indexOf("firefox") > -1) dcRequest.setValue("lv", 2); + + // the chance is quite big, that the browser supports xul-sidebars + dcRequest.setValue("lv", 1); + + } else { + + // redirect to level 2 because of definitive lack of sidebar support + dcRequest.setValue("lv", 2); + } +} + + + +switch (dcRequest.getAsInt("lv")) { + + // LEVEL 0 -------------------------------------------------------------- + + case 0: +%> + +<% + break; // level 0 + + + + + // LEVEL 1 -------------------------------------------------------------- + + case 1: + + // set number of pages + dcRequest.setValue("pt", docBean.getNumPages(dcRequest)); +%> + + + + + + + + + + + + +
+ +
+ + + + +<% + break; // level 1 + + + + + // LEVEL 2 -------------------------------------------------------------- + + case 2: +%> + +<% + // retrieve request in new paramter format and redirect to level 1 + dcRequest.setValue("lv", 1); + String query = "digicat.jsp?" + dcRequest.getAsString(); +%> + + + +Digital Document Library - Alcatraz (Level 2) + + + + + + + + + +<% + break; // level 2 + +} // end switch + +%>