Mercurial > hg > digilib-old
comparison client/digitallibrary/dlInfo-xml.jsp @ 216:050fa739066f
image information in XML format
author | robcast |
---|---|
date | Tue, 29 Jun 2004 12:05:30 +0200 |
parents | |
children | a6bd80bcd28b |
comparison
equal
deleted
inserted
replaced
215:b5d395331f24 | 216:050fa739066f |
---|---|
1 <%@ page language="java" %><%! | |
2 // create DocumentBean instance for all JSP requests | |
3 digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean(); | |
4 | |
5 // initialize DocumentBean instance in JSP init | |
6 public void jspInit() { | |
7 try { | |
8 // set servlet init-parameter | |
9 docBean.setConfig(getServletConfig()); | |
10 } catch (javax.servlet.ServletException e) { | |
11 System.out.println(e); | |
12 } | |
13 } | |
14 %><?xml version="1.0" encoding="UTF-8" ?> | |
15 <% | |
16 // process request | |
17 // get digilib config | |
18 digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig(); | |
19 // parsing the query | |
20 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); | |
21 // add number of pages | |
22 dlRequest.setValue("pt", docBean.getNumPages(dlRequest)); | |
23 // dir cache | |
24 digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache"); | |
25 | |
26 %><!-- Automatically generated XML snippet with document parameters --> | |
27 <document-parameters> | |
28 <% | |
29 Object[] keys = dlRequest.keySet().toArray(); | |
30 java.util.Arrays.sort(keys); | |
31 int l = keys.length; | |
32 for (int i = 0; i < l; i++) { | |
33 String key = (String) keys[i]; | |
34 String val = dlRequest.getAsString(key); | |
35 if (val.length() == 0) { | |
36 val = ""; | |
37 } | |
38 %> <parameter name="<%= key %>" value="<%= val %>"/> | |
39 <% | |
40 } | |
41 %></document-parameters> |