comparison website/digilib-config.html @ 3:9a472dab7e09

more new documentation
author robcast
date Mon, 12 Dec 2011 20:37:53 +0100
parents
children
comparison
equal deleted inserted replaced
2:8abbc40d0df5 3:9a472dab7e09
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <title>digilib -- Digital Image Library</title>
7 </head>
8 <body>
9 <table border="0" cellspacing="0" cellpadding="10">
10 <tr>
11 <td bgcolor="#a0a0a0">&nbsp;</td>
12 <td>
13 <img src="images/digilib-logo-big.png" align="left" />
14 <h1>
15 <tt>digilib</tt> -- a versatile image viewing environment for the internet
16 </h1>
17 </td>
18 </tr>
19 <tr>
20 <td bgcolor="#a0a0a0" valign="top" align="right">
21 <p>
22 <b><a href="index.html">Info</a> </b>
23 </p>
24 <p>
25 <b><a href="http://developer.berlios.de/projects/digilib/">Project</a> </b>
26 </p>
27 <p>
28 <b><a href="http://developer.berlios.de/project/showfiles.php?group_id=251">Download</a>
29 </b>
30 </p>
31 <p>
32 <b><a href="docs.html">Docs</a></b>
33 <br />
34 <a href="build-maven.html">Building</a>
35 <br />
36 <a href="digilib-config.html">Configuring</a>
37 <br />
38 <a href="http://developer.berlios.de/docman/?group_id=251">...more</a>
39 </p>
40 <p>
41 <b><a href="tips.html">Tips</a> </b>
42 </p>
43 <p>
44 <b><a href="http://hg.berlios.de/repos/digilib">Source</a> </b>
45 </p>
46 </td>
47 <td>
48
49 <h1>Configuring digilib</h1>
50
51 <h2>digilib-config.xml</h2>
52
53 <p>
54 The main configuration for digilib is <code>digilib-config.xml</code> . It's
55 normally in the <code>WEB-INF</code> directory in the webapp. (If you really
56 need another location you can define it in the <code>config-file</code>
57 init-parameter to the servlet)
58 </p>
59
60 <p>In the configuration file you can set several paths and options. The file
61 looks like this:</p>
62
63 <pre>
64 &lt;!-- Digilib servlet config file --&gt;
65
66 &lt;digilib-config&gt;
67 &lt;!-- Image to be sent to indicate general failure. --&gt;
68 &lt;parameter name=&quot;error-image&quot; value=<b>&quot;/docuserver/images/icons/broken.gif&quot;</b> /&gt;
69
70 &lt;!-- Image to be sent to indicate authorization failure. --&gt;
71 &lt;parameter name=&quot;denied-image&quot; value=<b>&quot;/docuserver/images/icons/alert.red.gif&quot;</b> /&gt;
72
73 &lt;!-- List of directories where images are searched.
74 The authoritative directory with the high-resolution images
75 is first in list. --&gt;
76 &lt;parameter name=&quot;basedir-list&quot; value=<b>&quot;/docuserver/images:/docuserver/scaled/small&quot;</b> /&gt;
77
78 &lt;!-- Java class to use for image operations --&gt;
79 &lt;parameter name=&quot;docuimage-class&quot; value=&quot;digilib.image.JAIDocuImage&quot; /&gt;
80
81 &lt;!-- mimimum amount of scaling done with antialiasing --&gt;
82 &lt;parameter name=&quot;subsample-minimum&quot; value=&quot;2&quot;/&gt;
83
84 &lt;!-- default interpolation quality (0=worst) --&gt;
85 &lt;parameter name=&quot;default-quality&quot; value=&quot;1&quot;/&gt;
86
87 &lt;!-- is sending whole image files with mo=file allowed? --&gt;
88 &lt;parameter name=&quot;sendfile-allowed&quot; value=&quot;true&quot; /&gt;
89
90 &lt;!-- the a maximum size of any sent image. (0 means no limit) --&gt;
91 &lt;parameter name=&quot;max-image-size&quot; value=&quot;0&quot; /&gt;
92
93 &lt;!-- number of working threads --&gt;
94 &lt;parameter name=&quot;worker-threads&quot; value=&quot;2&quot; /&gt;
95
96 &lt;!-- number of waiting requests in queue --&gt;
97 &lt;parameter name="max-waiting-threads" value="20" /&gt;
98
99 &lt;!-- Restrict access to authorized users.
100 User authentication and roles are provided by the servlet container
101 (see tomcat-users.xml).
102 Authorization for resources (directories) is evaluated by the servlet
103 (see auth-file). --&gt;
104 &lt;parameter name=&quot;use-authorization&quot; value=&quot;true&quot;/&gt;
105
106 &lt;!-- Location of XML file with authorization requirements. --&gt;
107 &lt;parameter name=&quot;auth-file&quot; value=&quot;digilib-auth.xml&quot;/&gt;
108
109 &lt;!-- Part of URL to indicate authenticated access to Tomcat. --&gt;
110 &lt;parameter name=&quot;auth-url-path&quot; value=&quot;authenticated/&quot;/&gt;
111
112 &lt;!-- use mapping of &quot;virtual directories&quot; to real directories on the server --&gt;
113 &lt;parameter name=&quot;use-mapping&quot; value=&quot;false&quot;/&gt;
114
115 &lt;!-- location of XML mapping file --&gt;
116 &lt;parameter name=&quot;mapping-file&quot; value=&quot;digilib-map.xml&quot;/&gt;
117
118 &lt;!-- location of logger config file --&gt;
119 &lt;parameter name=&quot;log-config-file&quot; value=&quot;log4j-config.xml&quot;/&gt;
120 &lt;/digilib-config&gt;
121 </pre>
122
123 <p>
124 You have to adjust the <code>basedir-list</code> parameter to the directories
125 where your images are installed. You need only one directory if you don't
126 provide prescaled low resolution versions of your images. The directory with the
127 high-resolution images must be the first entry in the list.
128 </p>
129
130 <p>You can supply your own icons for the &quot;error&quot; and &quot;access
131 denied&quot; messages by the servlet. Standard images will be used if these
132 parameters are undefined.</p>
133
134 <p>
135 You can specify the Java toolkit implementation with the <code>docuimage-class</code>
136 parameter. The <code>ImageLoaderDocuImage</code> usually gives best performance
137 and works with JDK 1.4 and up.
138 </p>
139
140
141 <h2>digilib-auth.xml</h2>
142
143 <p>
144 The digilib access authorization is defined in the file defined by the <code>auth-file</code>
145 parameter (usually <code>digilib-auth.xml</code> in <code>WEB-INF</code> ).
146 </p>
147
148 <p>
149 The file has two parts <code>diglib-paths</code> and <code>diglib-addresses</code>
150 . It looks like this:
151 </p>
152
153 <pre>
154 &lt;auth-config&gt;
155
156 &lt;digilib-paths&gt;
157 &lt;!--
158 A user must supply one of the roles under &quot;role&quot;
159 to access the directory &quot;name&quot;.
160 Roles under &quot;role&quot; must be separated by comma only (no spaces).
161 --&gt;
162 &lt;path name=&quot;histast/eastwood-collection&quot; role=&quot;eastwood-coll&quot; /&gt;
163 &lt;path name=&quot;ptolemaios_geo&quot; role=&quot;ptolemaios-geo&quot; /&gt;
164 &lt;/digilib-paths&gt;
165
166 &lt;digilib-addresses&gt;
167 &lt;!--
168 A computer with an ip address that matches &quot;ip&quot;
169 is automatically granted all roles under &quot;role&quot;.
170 The ip address is matched from the left (in full quads).
171 Roles under &quot;role&quot; must be separated by comma only (no spaces).
172 --&gt;
173 &lt;address ip=&quot;127&quot; role=&quot;local&quot; /&gt;
174 &lt;address ip=&quot;130.92.68&quot; role=&quot;eastwood-coll,ptolemaios-geo&quot; /&gt;
175 &lt;address ip=&quot;130.92.151&quot; role=&quot;ALL&quot; /&gt;
176 &lt;/digilib-addresses&gt;
177
178 &lt;/auth-config&gt;
179 </pre>
180
181 <p>
182 <code>diglib-paths</code> defines restricted directories and the roles needed
183 for access. The roles are defined with the users in <code>tomcat-users.xml</code>
184 (see above). All subdirectories of the given directories have the same
185 restrictions. All directories not listed here (and not subdirectories of listed
186 directories) are freely accessible.
187 </p>
188
189 <p>
190 <code>diglib-addresses</code> defines hosts or networks of computers that are
191 automatically authenticated without username and password. Hosts can be assigned
192 roles. The special keyword <code>ALL</code> authorizes for everything. If the
193 role assigned to the computer is not sufficient to access a resource the user
194 will be asked for username and password.
195 </p>
196
197
198
199 </td>
200 </tr>
201 <tr>
202 <td style="padding: 0px" align="left">
203 <a href="http://developer.berlios.de"> <img
204 src="http://developer.berlios.de/bslogo.php?group_id=0&type=1" width="124"
205 height="32" border="0" alt="BerliOS Logo" />
206 </a>
207 </td>
208 <td></td>
209 </tr>
210 </table>
211
212 </body>
213 </html>