# HG changeset patch # User robcast # Date 1293008074 -3600 # Node ID beeedf90cb81613b97b406939999edfb65fa7448 # Parent 34701340922e0f28434aec88c2199a36deacd4e4# Parent fd2ef7e461198ef4a9d9a02459be2057038d600d Merge from HEAD fd2ef7e461198ef4a9d9a02459be2057038d600d diff -r 34701340922e -r beeedf90cb81 client/digitallibrary/WEB-INF/classes/info.txt --- a/client/digitallibrary/WEB-INF/classes/info.txt Tue Dec 21 12:16:33 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -# hier zusaetzliche klassen zum kompilieren, diese muessen im laufenden -# tomcat system in WEB-INF/lib sein. - -export CLASSPATH=$CLASSPATH:/opt/javalibs/xerces/xercesImpl.jar:/opt/javalibs/xerces/xml-apis.jar:/opt/javalibs/xalan/bin/xalan.jar:/opt/tomcat/common/lib/servlet-api.jar diff -r 34701340922e -r beeedf90cb81 client/digitallibrary/contexto/contexto.jsp --- a/client/digitallibrary/contexto/contexto.jsp Tue Dec 21 12:16:33 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -<%@ page language="java" %> -<%@ page import="java.io.*" %> -<%@ page import="java.net.*" %> - -<% - digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(); - dlRequest.setWithRequest(request); - -%> - -<% - // Possible parameters - String htmlPage = request.getParameter("htmlPage"); - // neu eingebaut - christian - // @beat: kannst du das zeugs bitte checken und mir sagen, ob du - // dagegen bist oder nicht. es ist ein uebler hack, der keine - // kontrollmechanismen hat, aber im moment halt meinen anspruechen - // genuegt. (den import von java.net.* ist auch von mir) - String htmlURL = request.getParameter("htmlURL"); - String xmlURL = request.getParameter("xmlURL"); - String xslURL = request.getParameter("xslURL"); - String fileName = request.getParameter("fn"); - String pageNumber = request.getParameter("pn"); - - // funcktioniert leider nicht - christian - //System.setProperty("http.proxyHost", "proxy.unibe.ch"); - //System.setProperty("http.proxyPort", "8080"); - - if(htmlPage != null) { - response.getWriter().println(htmlPage); - // neue parameterart eingebaut - christian - } else if(htmlURL != null) { - try { - URL u = new URL(htmlURL); - String content_type = u.openConnection().getContentType(); - InputStream is = u.openStream(); - InputStreamReader isr = new InputStreamReader(is); - BufferedReader br = new BufferedReader(isr); - //response.setContentType(content_type); - String aLine; - while ((aLine = br.readLine()) != null) { - response.getWriter().println(aLine); - } - } catch (Exception e) { - response.getWriter().println(e); - } - } else if((xmlURL != null) && (xslURL != null)) { - out.println("xsl"); - response.sendRedirect("http://sophia.unibe.ch:8080/xslt/ApplyXSLT?URL="+ xmlURL + "&xslURL=" + xslURL); - } else if(fileName != null && pageNumber != null) { - response.sendRedirect("http://hera.unibe.ch:8080/alcatraz/servlet/Texter?fn=" + fileName + "&pn=" + pageNumber); - } -%> diff -r 34701340922e -r beeedf90cb81 client/digitallibrary/digilib-new.html --- a/client/digitallibrary/digilib-new.html Tue Dec 21 12:16:33 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,366 +0,0 @@ - - - - - - The new digilib - - - - - - - - - - - - - - - -
-
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - \ No newline at end of file diff -r 34701340922e -r beeedf90cb81 client/digitallibrary/dlContext-xml.jsp --- a/client/digitallibrary/dlContext-xml.jsp Tue Dec 21 12:16:33 2010 +0100 +++ b/client/digitallibrary/dlContext-xml.jsp Wed Dec 22 09:54:34 2010 +0100 @@ -27,7 +27,7 @@ int pn = dlRequest.getAsInt("pn"); String fn = dlRequest.getFilePath(); String ctx = ""; -digilib.io.DocuDirent f = dirCache.getFile(fn, pn, digilib.io.FileOps.CLASS_IMAGE); +digilib.io.DocuDirent f = dirCache.getFile(fn, pn, digilib.io.FileOps.FileClass.IMAGE); if (f != null) { //ctx = "hasfile:"+f.getName(); f.checkMeta(); diff -r 34701340922e -r beeedf90cb81 client/digitallibrary/modules/cm_separator.gif Binary file client/digitallibrary/modules/cm_separator.gif has changed diff -r 34701340922e -r beeedf90cb81 client/digitallibrary/modules/imago.js --- a/client/digitallibrary/modules/imago.js Tue Dec 21 12:16:33 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,441 +0,0 @@ -/* - -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, 22.05.2003 , Version Alcatraz 0.4 - -*/ - -/************************************************************************* - * imago.js : digilib-module * - * * - * desc: adds different image manipulation functions. * - * * - *************************************************************************/ - - -/** - * brightness (value of brightness between -255 - +255) - */ -function brightness(value) { - - if ( (value >= -255) && (value <= 255) ) { - - dlParams.brgt.value = value; - display(3); - - } - -} - - -/** - * contrast (value of contrast - range?) - */ -function contrast(value) { - - dlParams.cont.value = parseFloat(value); - display(3); - -} - - -/** - * brightness/contrast in one call - */ -function brightnessContrast(brightness, contrast) { - - dlParams.cont.value = parseFloat(contrast); - - if ( (brightness >= -255) && (brightness <= 255) ) { - - dlParams.brgt.value = parseFloat(brightness); - display(3); - - } - -} - - -/** - * mirror (horizontal or vertical) - */ -function mirror(direction) { - - if ( direction == 'v' ) { - if ( dlParams.mo.value.indexOf('vmir') > -1 ) { - removeMoFlag('vmir'); - } else { - addMoFlag('vmir'); - } - } - - if ( direction == 'h' ) { - if ( dlParams.mo.value.indexOf('hmir') > -1 ) { - removeMoFlag('hmir'); - } else { - addMoFlag('hmir'); - } - } - - display(3); - -} - - -/** - * rotation - */ -function rotation(value) { - - value = parseFloat(value) % 360; - - if ( value < 0 ) { - value += 360; - } - - dlParams.rot.value = value; - display(3); - -} - - -/** - * rgb add (r/g/b, each value from -255 to +255) - */ -function rgba(value) { - - values = value.split("/"); - - if ( values.length != 3 ) { - alert ("Illegal parameter format (r/g/b)"); - } else if ( (values[0] < -255) || (values[0] > 255) ) { - alert ("Illegal red additioner (-255 to 255)"); - } else if ( (values[1] < -255) || (values[1] > 255) ) { - alert ("Illegal green additioner (-255 to 255)"); - } else if ( (values[2] < -255) || (values[2] > 255) ) { - alert ("Illegal blue additioner (-255 to 255)"); - } else { - - dlParams.rgba.value = value; - display(3); - - } -} - - -/** - * rgb mutiply (r/g/b, range?) - */ -function rgbm(value) { - - values = value.split("/"); - - if ( values.length != 3 ) { - alert ("Illegal parameter format (r/g/b)"); - } else if ( !isFinite(values[0]) ) { - alert ("Illegal red exponent"); - } else if ( !isFinite(values[1]) ) { - alert ("Illegal green exponent"); - } else if ( !isFinite(values[2]) ) { - alert ("Illegal blue exponent"); - } else { - - dlParams.rgbm.value = value; - display(3); - - } -} - - -/** - * rgba/rgbm in one call - */ -function colors(rgba, rgbm) { - - add = rgba.split("/"); - mult = rgba.split("/"); - - if ( (add.length) == 3 && (mult.length == 3) && - (add[0] >= -255) && (add[0] <= 255) && - (add[1] >= -255) && (add[1] <= 255) && - (add[2] >= -255) && (add[2] <= 255) && - (isFinite(mult[0])) && - (isFinite(mult[1])) && - (isFinite(mult[2])) ) { - - dlParams.rgba.value = rgba; - dlParams.rgbm.value = rgbm; - - display(3); - - } -} - - -/** - * pixel by pixel view of images - */ -function pixelByPixel() { - - removeMoFlag('osize'); - - addMoFlag('clip'); - - // change scale to 1 - dlParams.ws.value = 1.0; - - display(3); - -} - - -/** - * original size view of images - */ -function originalSize(dpi_v, dpi_h) { - - removeMoFlag('clip'); - - addMoFlag('osize'); - - // change scale to 1 - dlParams.ws.value = 1.0; - - dlParams.ddpix.value = cropFloat(dpi_h); - dlParams.ddpiy.value = cropFloat(dpi_v); - - display(3); - -} - - -/** - * scale (overriding old one) - * as pixel by pixel is some kind of scale, it does turn scale factor to 1 - * if chosen. also if a scale factor is chosen, - * then pixel by pixel is turned off. - */ -function scale(factor) { - - dlParams.ws.value = factor; - - removeMoFlag('clip'); - removeMoFlag('osize'); - - display(3); - -} - - -/** - * placeMarks (overriding old one) - * take care of rotation and mirroring when placing marks - */ -function placeMarks() { - - if ( dlParams.mk.value != '' ) { - - var mark = dlParams.mk.value.split(";"); - var mark_count = mark.length; - - // maximum of marks is 8 - // we do not report this error because this is already done in function 'mark' - if ( mark_count > 8 ) mark_count = 8; - - var picWidth = (document.all) ? parseInt(document.all.lay1.offsetWidth) : (typeof(document.getElementById) == "function") ? parseInt(document.pic.offsetWidth) : parseInt(document.lay1.clip.width); - var picHeight = (document.all) ? parseInt(document.all.lay1.offsetHeight) : (typeof(document.getElementById) == "function") ? parseInt(document.pic.offsetHeight) : parseInt(document.lay1.clip.height); - - // catch the cases where the picture had not been loaded already and - // make a timeout so that the coordinates are calculated with the real dimensions - if ( (picWidth > 30) || (document.pic.complete) ) { - - var xOffset = (document.all) ? parseInt(document.all.lay1.style.left) : (typeof(document.getElementById) == "function") ? parseInt(document.getElementById('lay1').style.left) : document.lay1.left; - var yOffset = (document.all) ? parseInt(document.all.lay1.style.top) : (typeof(document.getElementById) == "function") ? parseInt(document.getElementById('lay1').style.top) : document.lay1.top; - - for (var i = 0; i < mark_count; i++) { - mark[i] = mark[i].split("/"); - - if ( (parseFloat(mark[i][0]) >= parseFloat(dlParams.wx.value)) && - (parseFloat(mark[i][1]) >= parseFloat(dlParams.wy.value)) && - (parseFloat(mark[i][0]) <= (parseFloat(dlParams.wx.value) + parseFloat(dlParams.ww.value))) && - (parseFloat(mark[i][1]) <= (parseFloat(dlParams.wy.value) + parseFloat(dlParams.wh.value))) ) { - - mark[i][0] = (mark[i][0] - dlParams.wx.value)/dlParams.ww.value; - mark[i][1] = (mark[i][1] - dlParams.wy.value)/dlParams.wh.value; - - // mirror - if ( dlParams.mo.value.indexOf('hmir') > -1 ) { - mark[i][0] = 1 - mark[i][0]; - } - if ( dlParams.mo.value.indexOf('vmir') > -1 ) { - mark[i][1] = 1 - mark[i][1]; - } - - // just the beginning - not working currently - var ang_rad = dlParams.rot.value*2*3.1415926/360; - - var ws = Math.sin(ang_rad)/(Math.cos(ang_rad)*dlParams.ww.value/dlParams.wh.value+Math.sin(ang_rad)) * picWidth; - var wc = (Math.cos(ang_rad)*dlParams.ww.value/dlParams.wh.value)/(Math.cos(ang_rad)*dlParams.ww.value/dlParams.wh.value+Math.sin(ang_rad)) * picWidth; - - var hs = (Math.sin(ang_rad)*dlParams.ww.value/dlParams.wh.value)/(Math.sin(ang_rad)*dlParams.ww.value/dlParams.wh.value+Math.cos(ang_rad)) * picHeight; - var hc = Math.cos(ang_rad)/(Math.sin(ang_rad)*dlParams.ww.value/dlParams.wh.value+Math.cos(ang_rad)) * picHeight; - - var origPicWidth = Math.sqrt(Math.pow(wc, 2) + Math.pow(hs, 2)); - var origPicHeight = Math.sqrt(Math.pow(ws, 2) + Math.pow(hc, 2)); - // end of the beginning ;-) - - mark[i][0] = parseInt(xOffset + picWidth * mark[i][0]); - mark[i][1] = parseInt(yOffset + picHeight * mark[i][1]); - - if ( (document.all) || (typeof(document.getElementById) == "function") ) { - // suboptimal to place -5 pixels and not half size of mark-image - // should be changed in the future - document.getElementById("dot" + i).style.left = mark[i][0]-5; - document.getElementById("dot" + i).style.top = mark[i][1]-5; - document.getElementById("dot" + i).style.visibility = "visible"; - } else { - document.layers[i+1].moveTo(mark[i][0]-5, mark[i][1]-5); - document.layers[i+1].visibility = "show"; - } - } - } - - } else { - setTimeout("placeMarks()", 100); - } - } -} - - -/**** - * helper functions - ****/ - -/** - * Point (overriding old one) - * constructor holding different values of a point - * depending also on mirror or rotation - */ -function Point(evt) { - - if ( document.all ) { - - this.pageX = parseInt(document.body.scrollLeft+event.clientX); - this.pageY = parseInt(document.body.scrollLeft+event.clientY); - - this.x = this.pageX-parseInt(document.all.lay1.style.left); - this.y = this.pageY-parseInt(document.all.lay1.style.top); - - // mirror - if ( dlParams.mo.value.indexOf('hmir') > -1 ) { - this.relX = cropFloat(parseFloat(parseFloat(dlParams.wx.value)+parseFloat(dlParams.ww.value))-(dlParams.ww.value*this.x/document.all.lay1.offsetWidth)); - } else { - this.relX = cropFloat(parseFloat(dlParams.wx.value)+(dlParams.ww.value*this.x/document.all.lay1.offsetWidth)); - } - if ( dlParams.mo.value.indexOf('vmir') > -1 ) { - this.relY = cropFloat(parseFloat(parseFloat(dlParams.wy.value)+parseFloat(dlParams.wh.value))-(dlParams.wh.value*this.y/document.all.lay1.offsetHeight)); - } else { - this.relY = cropFloat(parseFloat(dlParams.wy.value)+(dlParams.wh.value*this.y/document.all.lay1.offsetHeight)); - } - - } else { - - this.pageX = parseInt(evt.pageX); - this.pageY = parseInt(evt.pageY); - - if ( typeof(document.getElementById) == "function" ) { - - this.x = this.pageX-parseInt(document.getElementById("lay1").style.left); - this.y = this.pageY-parseInt(document.getElementById("lay1").style.top); - - // mirror - if ( dlParams.mo.value.indexOf('hmir') > -1 ) { - this.relX = cropFloat(parseFloat(parseFloat(dlParams.wx.value)+parseFloat(dlParams.ww.value))-(dlParams.ww.value*this.x/document.pic.offsetWidth)); - } else { - this.relX = cropFloat(parseFloat(dlParams.wx.value)+(dlParams.ww.value*this.x/document.pic.offsetWidth)); - } - if ( dlParams.mo.value.indexOf('vmir') > -1 ) { - this.relY = cropFloat(parseFloat(parseFloat(dlParams.wy.value)+parseFloat(dlParams.wh.value))-(dlParams.wh.value*this.y/document.pic.offsetHeight)); - } else { - this.relY = cropFloat(parseFloat(dlParams.wy.value)+(dlParams.wh.value*this.y/document.pic.offsetHeight)); - } - - } else { - - this.x = this.pageX-document.lay1.left; - this.y = this.pageY-document.lay1.top; - - // mirror - if ( dlParams.mo.value.indexOf('hmir') > -1 ) { - this.relX = cropFloat(parseFloat(parseFloat(dlParams.wx.value)+parseFloat(dlParams.ww.value))-(dlParams.ww.value*this.x/document.lay1.clip.width)); - } else { - this.relX = cropFloat(parseFloat(dlParams.wx.value)+(dlParams.ww.value*this.x/document.lay1.clip.width)); - } - if ( dlParams.mo.value.indexOf('vmir') > -1 ) { - this.relY = cropFloat(parseFloat(parseFloat(dlParams.wy.value)+parseFloat(dlParams.wh.value))-(dlParams.wh.value*this.y/document.lay1.clip.height)); - } else { - this.relY = cropFloat(parseFloat(dlParams.wy.value)+(dlParams.wh.value*this.y/document.lay1.clip.height)); - } - - } - - } - - return this; - -} - - -/** - * removeMoFlag from mo parameter - */ -function removeMoFlag(name) { - - if ( dlParams.mo.value != '' ) { - - var idx_comma_after = dlParams.mo.value.indexOf(name + ','); - var idx_comma_before = dlParams.mo.value.indexOf(',' + name); - var idx_nocomma = dlParams.mo.value.indexOf(name); - - if ( idx_comma_after > -1 ) { - dlParams.mo.value = dlParams.mo.value.slice(0, idx_comma_after) + dlParams.mo.value.slice(idx_comma_after+name.length+1); - }else if ( idx_comma_before > -1 ) { - dlParams.mo.value = dlParams.mo.value.slice(0, idx_comma_before) + dlParams.mo.value.slice(idx_comma_before+name.length+1); - } else if ( idx_nocomma > -1 ) { - dlParams.mo.value = dlParams.mo.value.slice(0, idx_nocomma) + dlParams.mo.value.slice(idx_nocomma+name.length); - } - } - -} - - -/** - * addMoFlag from mo parameter - */ -function addMoFlag(name) { - - if ( dlParams.mo.value.indexOf(name) == -1 ) { - - if ( dlParams.mo.value.length > 0 ) { - dlParams.mo.value += ',' + name; - } else { - dlParams.mo.value = name; - } - } - -} diff -r 34701340922e -r beeedf90cb81 client/digitallibrary/modules/newReferences.js --- a/client/digitallibrary/modules/newReferences.js Tue Dec 21 12:16:33 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* - -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, 22.05.2003 , Version Alcatraz 0.4 - -*/ - -/************************************************************************* - * newReferences.js : digilib-module * - * * - * desc: creates references in the new parameter format (key-value) * - * * - *************************************************************************/ - - -/** - * ref, overriding original one - */ -function ref(select) { - - var hyperlinkRef = baseUrl + "/digilib.jsp?"; - - if ( select >= 2 ) { - - // no original size is referenced at the moment, - // because the dpi values are not constant from user to user - removeMoFlag('osize'); - - var parameterString = ''; - - for ( param in dlParams ) { - if ( (dlParams[param].detail < 9) && (dlParams[param].defaultValue != dlParams[param].value) ) { - parameterString += "&" + param + "=" + dlParams[param].value; - } - } - - if (select == 2) { - parameterString += "&lv=3"; // level three - parameterString = parameterString.slice(1); - prompt("Alcatraz-style HTML link", hyperlinkRef + parameterString); - } else { - parameterString += "&lv=1"; // i just really want the image - parameterString = parameterString.slice(1); - return hyperlinkRef + parameterString; - } - - } else { - - var parameterString = ''; - - parameterString += dlParams.fn.value + "+" + dlParams.pn.value + "+" + dlParams.ws.value + "+"; - parameterString += dlParams.mo.value + "+" + dlParams.mk.value; - - if ( (dlParams.wx.value != 0) || (dlParams.wy.value != 0) || (dlParams.ww.value != 1) || (dlParams.wh.value != 1) ) { - parameterString += "+" + dlParams.wx.value + "+" + dlParams.wy.value + "+" + dlParams.ww.value; - parameterString += "+" + dlParams.wh.value; - } - - if ( select == 1 ) { - prompt("Link for HTML-documents", hyperlinkRef + parameterString); - } - - if ( select == 0 ) { - prompt("Link for LaTeX-documents", "\\href{" + hyperlinkRef + parameterString + "}{TEXT}"); - } - } -} diff -r 34701340922e -r beeedf90cb81 client/digitallibrary/relato/astro.xml --- a/client/digitallibrary/relato/astro.xml Tue Dec 21 12:16:33 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ - - - - - - - - - - In order to use <i>relato</i> you need to have a frame capable browser. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -