changeset 227:27591a0dceb1

new versions on modules and contexto tool to show text
author luginbue
date Fri, 09 Jul 2004 02:39:46 +0200
parents 88f2de6b518a
children fddb9a2577fc
files client/digitallibrary/contexto/contexto.jsp
diffstat 1 files changed, 53 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/contexto/contexto.jsp	Fri Jul 09 02:39:46 2004 +0200
@@ -0,0 +1,53 @@
+<%@ 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);
+    }
+%>