annotate client/digitallibrary/server/dlConfig.jsp @ 854:1e2e9599d84c stream

(slightly) fixed enhance and colop in linux.
author robcast
date Mon, 07 Mar 2011 11:59:11 +0100
parents 0885f5ca5b24
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
557
0885f5ca5b24 more refactoring and rearranging
robcast
parents: 548
diff changeset
1 <%@page import="digilib.util.DigilibJobCenter"%>
78
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
2 <%@ page language="java" %>
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
3
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
4 <%!
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
5 // authentication stuff - robert
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
6 // -----------------------------
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
7 // create DocumentBean instance for all JSP requests
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
8 digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean();
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
9
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
10 // initialize DocumentBean instance in JSP init
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
11 public void jspInit() {
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
12 try {
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
13 // set servlet init-parameter
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
14 docBean.setConfig(getServletConfig());
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
15 } catch (javax.servlet.ServletException e) {
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
16 System.out.println(e);
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
17 }
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
18 }
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
19 %>
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
20
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
21 <%
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
22 // get digilib config
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
23 digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig();
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
24 // parsing the query
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
25 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request);
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
26 // add number of pages
168
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
27 dlRequest.setValue("pt", docBean.getNumPages(dlRequest));
154
e4f095227510 Adapted to new DigilibConfig class.
robcast
parents: 117
diff changeset
28 // dir cache
e4f095227510 Adapted to new DigilibConfig class.
robcast
parents: 117
diff changeset
29 digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache");
544
5ff500d6812a more steps towards more standard java.util.concurrent design
robcast
parents: 467
diff changeset
30 // image JobCenter
5ff500d6812a more steps towards more standard java.util.concurrent design
robcast
parents: 467
diff changeset
31 DigilibJobCenter imageProcessor = (DigilibJobCenter)dlConfig.getValue("servlet.worker.imageexecutor");
5ff500d6812a more steps towards more standard java.util.concurrent design
robcast
parents: 467
diff changeset
32
78
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
33 %>
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
34
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
35 <html>
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
36 <head>
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
37 <title>Digilib configuration page</title>
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
38 </head>
358
28f6030aa470 digilib status shows ImageIO's types of supported images
robcast
parents: 342
diff changeset
39 <body>
78
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
40
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
41 <h1>Global servlet configuration</h1>
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
42
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
43 <table>
168
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
44 <%
548
bc9196347188 more refactoring and cleanup
robcast
parents: 544
diff changeset
45 Object[] keys = dlConfig.getParams().keySet().toArray();
168
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
46 java.util.Arrays.sort(keys);
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
47 int l = keys.length;
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
48 for (int i = 0; i < l; i++) {
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
49 String key = (String) keys[i];
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
50 String val = dlConfig.getAsString(key);
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
51 if (key.equals("basedir-list")) {
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
52 String[] bd = (String[]) dlConfig.getValue("basedir-list");
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
53 val = "";
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
54 if (bd != null) {
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
55 for (int j = 0; j < bd.length; j++) {
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
56 val += bd[j] + "<br> ";
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
57 }
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
58 }
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
59 }
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
60 if (val.length() == 0) {
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
61 val = "(none)";
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
62 }
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
63 %>
78
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
64 <tr>
168
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
65 <td valign="top"><%= key %></td><td><b><%= val %></b></td>
78
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
66 <td></td>
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
67 </tr>
168
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
68 <%
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
69 }
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
70 %>
78
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
71 </table>
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
72
342
84bfba8a1c9e servlet version 1.5.5b
robcast
parents: 168
diff changeset
73 <h2>Threads</h2>
84bfba8a1c9e servlet version 1.5.5b
robcast
parents: 168
diff changeset
74
84bfba8a1c9e servlet version 1.5.5b
robcast
parents: 168
diff changeset
75 <table>
84bfba8a1c9e servlet version 1.5.5b
robcast
parents: 168
diff changeset
76 <tr>
544
5ff500d6812a more steps towards more standard java.util.concurrent design
robcast
parents: 467
diff changeset
77 <td>currently waiting</td><td><b><%= imageProcessor.getWaitingJobs() %></b></td>
342
84bfba8a1c9e servlet version 1.5.5b
robcast
parents: 168
diff changeset
78 <td></td>
84bfba8a1c9e servlet version 1.5.5b
robcast
parents: 168
diff changeset
79 </tr>
84bfba8a1c9e servlet version 1.5.5b
robcast
parents: 168
diff changeset
80 <tr>
544
5ff500d6812a more steps towards more standard java.util.concurrent design
robcast
parents: 467
diff changeset
81 <td>currently running</td><td><b><%= imageProcessor.getRunningJobs() %></b></td>
342
84bfba8a1c9e servlet version 1.5.5b
robcast
parents: 168
diff changeset
82 <td></td>
84bfba8a1c9e servlet version 1.5.5b
robcast
parents: 168
diff changeset
83 </tr>
84bfba8a1c9e servlet version 1.5.5b
robcast
parents: 168
diff changeset
84 </table>
84bfba8a1c9e servlet version 1.5.5b
robcast
parents: 168
diff changeset
85
117
a934824c894d config with cache info
robcast
parents: 78
diff changeset
86 <h2>Directory cache</h2>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
87
a934824c894d config with cache info
robcast
parents: 78
diff changeset
88 <table>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
89 <tr>
154
e4f095227510 Adapted to new DigilibConfig class.
robcast
parents: 117
diff changeset
90 <td>size (directories)</td><td><b><%= dirCache.size() %></b></td>
117
a934824c894d config with cache info
robcast
parents: 78
diff changeset
91 <td></td>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
92 </tr>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
93 <tr>
154
e4f095227510 Adapted to new DigilibConfig class.
robcast
parents: 117
diff changeset
94 <td>numFiles</td><td><b><%= dirCache.getNumFiles() %></b></td>
117
a934824c894d config with cache info
robcast
parents: 78
diff changeset
95 <td></td>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
96 </tr>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
97 <tr>
154
e4f095227510 Adapted to new DigilibConfig class.
robcast
parents: 117
diff changeset
98 <td>hits</td><td><b><%= dirCache.getHits() %></b></td>
117
a934824c894d config with cache info
robcast
parents: 78
diff changeset
99 <td></td>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
100 </tr>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
101 <tr>
154
e4f095227510 Adapted to new DigilibConfig class.
robcast
parents: 117
diff changeset
102 <td>misses</td><td><b><%= dirCache.getMisses() %></b></td>
117
a934824c894d config with cache info
robcast
parents: 78
diff changeset
103 <td></td>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
104 </tr>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
105 </table>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
106
a934824c894d config with cache info
robcast
parents: 78
diff changeset
107 <h2>JVM configuration</h2>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
108
a934824c894d config with cache info
robcast
parents: 78
diff changeset
109 <table>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
110 <tr>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
111 <td>java.awt.headless</td><td><b><%= System.getProperty("java.awt.headless") %></b></td>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
112 <td></td>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
113 </tr>
154
e4f095227510 Adapted to new DigilibConfig class.
robcast
parents: 117
diff changeset
114 <tr>
e4f095227510 Adapted to new DigilibConfig class.
robcast
parents: 117
diff changeset
115 <td>java.version</td><td><b><%= System.getProperty("java.version") %></b></td>
e4f095227510 Adapted to new DigilibConfig class.
robcast
parents: 117
diff changeset
116 <td></td>
e4f095227510 Adapted to new DigilibConfig class.
robcast
parents: 117
diff changeset
117 </tr>
168
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
118 <tr>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
119 <td>java.vendor</td><td><b><%= System.getProperty("java.vendor") %></b></td>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
120 <td></td>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
121 </tr>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
122 <tr>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
123 <td>os.name</td><td><b><%= System.getProperty("os.name") %></b></td>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
124 <td></td>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
125 </tr>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
126 <tr>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
127 <td>Runtime.maxMemory</td><td><b><%= Runtime.getRuntime().maxMemory() %></b></td>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
128 <td></td>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
129 </tr>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
130 <tr>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
131 <td>Runtime.totalMemory</td><td><b><%= Runtime.getRuntime().totalMemory() %></b></td>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
132 <td></td>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
133 </tr>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
134 <tr>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
135 <td>Runtime.freeMemory</td><td><b><%= Runtime.getRuntime().freeMemory() %></b></td>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
136 <td></td>
cf1825c48e9d Servlet Version 1.16b2 with new DigilibParameter code.
robcast
parents: 157
diff changeset
137 </tr>
117
a934824c894d config with cache info
robcast
parents: 78
diff changeset
138 </table>
a934824c894d config with cache info
robcast
parents: 78
diff changeset
139
467
6a74da78f304 Servlet version 1.10b
robcast
parents: 358
diff changeset
140 <h2>DocuImage configuration</h2>
358
28f6030aa470 digilib status shows ImageIO's types of supported images
robcast
parents: 342
diff changeset
141
28f6030aa470 digilib status shows ImageIO's types of supported images
robcast
parents: 342
diff changeset
142 <p>Supported image types</p>
28f6030aa470 digilib status shows ImageIO's types of supported images
robcast
parents: 342
diff changeset
143 <ul>
28f6030aa470 digilib status shows ImageIO's types of supported images
robcast
parents: 342
diff changeset
144 <%
467
6a74da78f304 Servlet version 1.10b
robcast
parents: 358
diff changeset
145 java.util.Iterator dlfs = dlConfig.getDocuImageInstance().getSupportedFormats();
6a74da78f304 Servlet version 1.10b
robcast
parents: 358
diff changeset
146 for (Object f = dlfs.next(); dlfs.hasNext(); f = dlfs.next()) {
358
28f6030aa470 digilib status shows ImageIO's types of supported images
robcast
parents: 342
diff changeset
147 %>
467
6a74da78f304 Servlet version 1.10b
robcast
parents: 358
diff changeset
148 <li><%= (String)f %></li>
358
28f6030aa470 digilib status shows ImageIO's types of supported images
robcast
parents: 342
diff changeset
149 <%
467
6a74da78f304 Servlet version 1.10b
robcast
parents: 358
diff changeset
150 }
358
28f6030aa470 digilib status shows ImageIO's types of supported images
robcast
parents: 342
diff changeset
151 %>
28f6030aa470 digilib status shows ImageIO's types of supported images
robcast
parents: 342
diff changeset
152 </ul>
28f6030aa470 digilib status shows ImageIO's types of supported images
robcast
parents: 342
diff changeset
153
467
6a74da78f304 Servlet version 1.10b
robcast
parents: 358
diff changeset
154
78
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
155 </body>
e0dcac9c66fa New servlet version 1.5b.
robcast
parents:
diff changeset
156 </html>