changeset 216:050fa739066f

image information in XML format
author robcast
date Tue, 29 Jun 2004 12:05:30 +0200
parents b5d395331f24
children 9f596e9ab6fb
files client/digitallibrary/dlInfo-xml.jsp
diffstat 1 files changed, 41 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/dlInfo-xml.jsp	Tue Jun 29 12:05:30 2004 +0200
@@ -0,0 +1,41 @@
+<%@ page language="java" %><%!
+// 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);
+    }
+}
+%><?xml version="1.0" encoding="UTF-8" ?>
+<%
+// process request
+// get digilib config
+digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig();
+// parsing the query
+digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
+// add number of pages
+dlRequest.setValue("pt", docBean.getNumPages(dlRequest));
+// dir cache
+digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache");
+
+%><!-- Automatically generated XML snippet with document parameters -->
+<document-parameters>
+<%
+    Object[] keys = dlRequest.keySet().toArray();
+    java.util.Arrays.sort(keys);
+    int l = keys.length;
+    for (int i = 0; i < l; i++) {
+	String key = (String) keys[i];
+	String val = dlRequest.getAsString(key);
+	if (val.length() == 0) {
+	    val = "";
+	}
+%>  <parameter name="<%= key %>" value="<%= val %>"/>
+<%
+       }
+%></document-parameters>