1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <!DOCTYPE appendix PUBLIC |
---|
3 | "-//Dawid Weiss//DTD DocBook V3.1-Based Extension for XML and graphics inclusion//EN" |
---|
4 | "../../../../lib/docbook/preprocess/dweiss-docbook-extensions.dtd"> |
---|
5 | <!-- |
---|
6 | $Id: extended_properties.xml 5782 2011-10-04 13:43:16Z nicklas $ |
---|
7 | |
---|
8 | Copyright (C) 2007 Nicklas Nordborg, Martin Svensson |
---|
9 | |
---|
10 | This file is part of BASE - BioArray Software Environment. |
---|
11 | Available at http://base.thep.lu.se/ |
---|
12 | |
---|
13 | BASE is free software; you can redistribute it and/or |
---|
14 | modify it under the terms of the GNU General Public License |
---|
15 | as published by the Free Software Foundation; either version 3 |
---|
16 | of the License, or (at your option) any later version. |
---|
17 | |
---|
18 | BASE is distributed in the hope that it will be useful, |
---|
19 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
21 | GNU General Public License for more details. |
---|
22 | |
---|
23 | You should have received a copy of the GNU General Public License |
---|
24 | along with BASE. If not, see <http://www.gnu.org/licenses/>. |
---|
25 | --> |
---|
26 | |
---|
27 | <appendix id="appendix.extendedproperties"> |
---|
28 | <?dbhtml filename="extendedproperties.html" ?> |
---|
29 | <title>extended-properties.xml reference</title> |
---|
30 | |
---|
31 | |
---|
32 | <bridgehead>What is extended-properties.xml?</bridgehead> |
---|
33 | |
---|
34 | <para> |
---|
35 | The <filename>extended-properties.xml</filename> file is a configuration |
---|
36 | file for customizing some of the tables in the BASE database. |
---|
37 | It is located in the <filename><basedir>/www/WEB-INF/classes</filename> |
---|
38 | directory. Only a limited number of tables support this feature, the most important |
---|
39 | one is the table for storing reporter information. |
---|
40 | </para> |
---|
41 | |
---|
42 | <tip> |
---|
43 | <para> |
---|
44 | It is also possible to put additional extended property definitions in the |
---|
45 | <filename><basedir>/www/WEB-INF/classes/extended-properties</filename> |
---|
46 | subdirectory. BASE will merge all <filename>*.xml</filename> it finds with |
---|
47 | the main <filename>extended-properties.xml</filename> file. The extra |
---|
48 | configuration files should have the same format as the main |
---|
49 | <filename>extended-properties.xml</filename> file. The extra files |
---|
50 | may contain extra columns for classes that are already |
---|
51 | defined in the main file, but existing columns can't be removed or |
---|
52 | re-defined. |
---|
53 | We recommend that you don't modify the default <filename>extended-properties.xml</filename> |
---|
54 | file at all (unless you want to remove some of the columns). This will make it |
---|
55 | easier when upgrading BASE since you don't have to worry about losing |
---|
56 | your own changes. |
---|
57 | |
---|
58 | </para> |
---|
59 | </tip> |
---|
60 | |
---|
61 | |
---|
62 | <para> |
---|
63 | The default <filename>extended-properties.xml</filename> that ships |
---|
64 | with BASE is biased towards the BASE version 1.2 setup for 2-spotted microarray |
---|
65 | data. If you want your BASE installation to be configured differently we |
---|
66 | recommend that you do it before the first initialisation of the database. |
---|
67 | It is possible to change the configuration of an existing BASE installation but it |
---|
68 | may require manual updates to the database. Follow this procedure: |
---|
69 | </para> |
---|
70 | |
---|
71 | <orderedlist> |
---|
72 | <listitem> |
---|
73 | <para> |
---|
74 | Shut down the BASE web server. If you have installed job agents you should shut |
---|
75 | down them as well. |
---|
76 | </para> |
---|
77 | </listitem> |
---|
78 | |
---|
79 | <listitem> |
---|
80 | <para> |
---|
81 | Modify the <filename>extended-properties.xml</filename> file or create a new file |
---|
82 | in the <filename>extended-properties</filename> subdirectory. If you have installed |
---|
83 | job agents, make sure they all have the same version as the web server. |
---|
84 | </para> |
---|
85 | </listitem> |
---|
86 | |
---|
87 | <listitem> |
---|
88 | <para> |
---|
89 | Run the <filename>updatedb.sh</filename> script. New |
---|
90 | columns will automatically be created, but the script can't delete columns that |
---|
91 | have been removed, or modify columns that have changed data type. You will have to |
---|
92 | do these kind of changes by manually executing SQL against your database. Check your |
---|
93 | database documentation for information about SQL syntax. |
---|
94 | </para> |
---|
95 | |
---|
96 | <tip> |
---|
97 | <title>Create a parallel installation</title> |
---|
98 | <para> |
---|
99 | You can always create a new temporary parallel installation to check |
---|
100 | what the table generated by installation script looks like. Compare the |
---|
101 | new table to the existing one and make sure they match. |
---|
102 | </para> |
---|
103 | </tip> |
---|
104 | </listitem> |
---|
105 | |
---|
106 | <listitem> |
---|
107 | <para> |
---|
108 | Start up the BASE web server and job agents, if any, again. |
---|
109 | </para> |
---|
110 | </listitem> |
---|
111 | |
---|
112 | </orderedlist> |
---|
113 | |
---|
114 | <tip> |
---|
115 | <title>Start with few columns</title> |
---|
116 | <para> |
---|
117 | It is better to start with too few columns, since it is easier to add |
---|
118 | more columns than it is to remove columns that are not needed. |
---|
119 | </para> |
---|
120 | </tip> |
---|
121 | |
---|
122 | <bridgehead>Sample extended properties setups</bridgehead> |
---|
123 | |
---|
124 | <itemizedlist> |
---|
125 | <listitem> |
---|
126 | <para> |
---|
127 | After installing BASE the default <filename>extended-properties.xml</filename> |
---|
128 | is located in the <filename><basedir>/www/WEB-INF/classes</filename> directory. |
---|
129 | This setup is biased towards the BASE version 1.2 setup for |
---|
130 | 2-spotted cDNA arrays. If you are migrating from BASE version 1.2 |
---|
131 | you <emphasis>must</emphasis> to use the default setup. |
---|
132 | </para> |
---|
133 | </listitem> |
---|
134 | |
---|
135 | <listitem> |
---|
136 | <para> |
---|
137 | A <filename>minimalistic_extended-properties.xml</filename> setup which doesn't |
---|
138 | define any extra columns at all. This file |
---|
139 | can be found in the <filename><basedir>/misc/config</filename> directory, |
---|
140 | and should be used if it is not known what reporter data will be stored in the |
---|
141 | database. The addition of more columns later is straightforward. |
---|
142 | </para> |
---|
143 | </listitem> |
---|
144 | </itemizedlist> |
---|
145 | |
---|
146 | <bridgehead>Format of the extended-properties.xml file</bridgehead> |
---|
147 | <para> |
---|
148 | The <filename>extended-properties.xml</filename> is an XML file. |
---|
149 | The following example will serve as a description of the format: |
---|
150 | </para> |
---|
151 | |
---|
152 | <programlisting language="xml"> |
---|
153 | <?xml version="1.0" ?> |
---|
154 | <!DOCTYPE extended-properties SYSTEM "extended-properties.dtd"> |
---|
155 | <extended-properties> |
---|
156 | <class name="ReporterData"> |
---|
157 | <property |
---|
158 | name="extra1" |
---|
159 | column="extra1" |
---|
160 | title="Extra property" |
---|
161 | type="string" |
---|
162 | length="255" |
---|
163 | null="true" |
---|
164 | update="true" |
---|
165 | insert="true" |
---|
166 | averagemethod="max" |
---|
167 | description="An extra property for all reporters" |
---|
168 | > |
---|
169 | <link |
---|
170 | regexp=".*" |
---|
171 | url="http://www.myexternaldb.com/find?{value}" |
---|
172 | /> |
---|
173 | </property> |
---|
174 | </class> |
---|
175 | </extended-properties> |
---|
176 | </programlisting> |
---|
177 | |
---|
178 | <para> |
---|
179 | Each table that can be customized is represented by a <sgmltag class="starttag">class</sgmltag> |
---|
180 | tag. The value of the <sgmltag>name</sgmltag> attribute is the name of the Java class |
---|
181 | that handles the information in that table. In the case of reporters |
---|
182 | the class name is <constant>ReporterData</constant>. |
---|
183 | </para> |
---|
184 | |
---|
185 | <para> |
---|
186 | Each <sgmltag class="starttag">class</sgmltag> tag may contain one or more |
---|
187 | <sgmltag class="starttag">property</sgmltag> tags, each one describing a single |
---|
188 | column in the table. The possible attributes of the <sgmltag class="starttag">property</sgmltag> |
---|
189 | tag are: |
---|
190 | </para> |
---|
191 | |
---|
192 | <table frame="all" id="appendix.extendedproperties.property"> |
---|
193 | <title>Attributes for the <sgmltag class="starttag">property</sgmltag> tag</title> |
---|
194 | <tgroup cols="3" align="left"> |
---|
195 | <colspec colname="attribute" align="left" /> |
---|
196 | <colspec colname="required" /> |
---|
197 | <colspec colname="comment" /> |
---|
198 | <thead> |
---|
199 | <row> |
---|
200 | <entry>Attribute</entry> |
---|
201 | <entry>Required</entry> |
---|
202 | <entry>Comment</entry> |
---|
203 | </row> |
---|
204 | </thead> |
---|
205 | <tbody> |
---|
206 | <row> |
---|
207 | <entry>name</entry> |
---|
208 | <entry>yes</entry> |
---|
209 | <entry> |
---|
210 | A unique name (within the class) of the extra property. |
---|
211 | The name must only contain letters, numbers and underscores but the first character |
---|
212 | can't be a number. The name is used to identify the extra column in the Java code |
---|
213 | and in the Query API. |
---|
214 | </entry> |
---|
215 | </row> |
---|
216 | <row> |
---|
217 | <entry>column</entry> |
---|
218 | <entry>yes</entry> |
---|
219 | <entry> |
---|
220 | The name of the database column. This value must be unique within the |
---|
221 | class. Valid names depends on the database, but it should be safe |
---|
222 | to follow the same rules as for the <sgmltag>name</sgmltag> attribute. |
---|
223 | In most cases, it makes sense to use the same value for both the |
---|
224 | <sgmltag>name</sgmltag> and <sgmltag>column</sgmltag> attributes. |
---|
225 | </entry> |
---|
226 | </row> |
---|
227 | <row> |
---|
228 | <entry>title</entry> |
---|
229 | <entry>no</entry> |
---|
230 | <entry> |
---|
231 | The title of the extra property as it is displayed in client applications. |
---|
232 | If not specified the value of the <sgmltag>name</sgmltag> attribute is used. |
---|
233 | </entry> |
---|
234 | </row> |
---|
235 | <row> |
---|
236 | <entry>description</entry> |
---|
237 | <entry>no</entry> |
---|
238 | <entry> |
---|
239 | A longer (but still short!) description of the extra property which can be |
---|
240 | used in client applications to provide help. |
---|
241 | </entry> |
---|
242 | </row> |
---|
243 | <row> |
---|
244 | <entry>type</entry> |
---|
245 | <entry>yes</entry> |
---|
246 | <entry> |
---|
247 | The data type of the column. Allowed values are: |
---|
248 | <itemizedlist> |
---|
249 | <listitem> |
---|
250 | <simpara>int</simpara> |
---|
251 | </listitem> |
---|
252 | <listitem> |
---|
253 | <simpara>long</simpara> |
---|
254 | </listitem> |
---|
255 | <listitem> |
---|
256 | <simpara>float</simpara> |
---|
257 | </listitem> |
---|
258 | <listitem> |
---|
259 | <simpara>double</simpara> |
---|
260 | </listitem> |
---|
261 | <listitem> |
---|
262 | <simpara>boolean</simpara> |
---|
263 | </listitem> |
---|
264 | <listitem> |
---|
265 | <simpara>string</simpara> |
---|
266 | </listitem> |
---|
267 | <listitem> |
---|
268 | <simpara>date</simpara> |
---|
269 | </listitem> |
---|
270 | <listitem> |
---|
271 | <simpara>timestamp</simpara> |
---|
272 | </listitem> |
---|
273 | </itemizedlist> |
---|
274 | |
---|
275 | <para> |
---|
276 | Note that the given types are converted into the most appropriate database |
---|
277 | column type by Hibernate. |
---|
278 | </para> |
---|
279 | </entry> |
---|
280 | </row> |
---|
281 | <row> |
---|
282 | <entry>length</entry> |
---|
283 | <entry>no</entry> |
---|
284 | <entry> |
---|
285 | If the column is a string type, this is the maximum length that can |
---|
286 | be stored in the database. If no value is given, 255 is assumed. |
---|
287 | </entry> |
---|
288 | </row> |
---|
289 | <row> |
---|
290 | <entry>null</entry> |
---|
291 | <entry>no</entry> |
---|
292 | <entry> |
---|
293 | If the column should allow <constant>null</constant> values or not. |
---|
294 | Allowed values are <constant>true</constant> (default) and |
---|
295 | <constant>false</constant>. |
---|
296 | </entry> |
---|
297 | </row> |
---|
298 | <row> |
---|
299 | <entry>insert</entry> |
---|
300 | <entry>no</entry> |
---|
301 | <entry> |
---|
302 | If values for this property should be inserted into the database or not. |
---|
303 | Allowed values are <constant>true</constant> (default) and |
---|
304 | <constant>false</constant>. |
---|
305 | </entry> |
---|
306 | </row> |
---|
307 | <row> |
---|
308 | <entry>update</entry> |
---|
309 | <entry>no</entry> |
---|
310 | <entry> |
---|
311 | If values for this property should be updated in the database or not. |
---|
312 | Allowed values are <constant>true</constant> (default) and |
---|
313 | <constant>false</constant>. |
---|
314 | </entry> |
---|
315 | </row> |
---|
316 | <row> |
---|
317 | <entry>averagemethod</entry> |
---|
318 | <entry>no</entry> |
---|
319 | <entry> |
---|
320 | The method to use when calculating the average of a set of values. |
---|
321 | This attribute replaces the <sgmltag>averagable</sgmltag> attribute. |
---|
322 | The following values can be used: |
---|
323 | |
---|
324 | <itemizedlist> |
---|
325 | <listitem> |
---|
326 | <simpara> |
---|
327 | <constant>none</constant>: average values are not supported |
---|
328 | (default for non-numerical columns) |
---|
329 | </simpara> |
---|
330 | </listitem> |
---|
331 | <listitem> |
---|
332 | <simpara> |
---|
333 | <constant>arithmetic_mean</constant>: calculate the arithmetic mean |
---|
334 | (default for numerical columns; not supported for non-numerical columns) |
---|
335 | </simpara> |
---|
336 | </listitem> |
---|
337 | <listitem> |
---|
338 | <simpara> |
---|
339 | <constant>geometric_mean</constant>: calculate the geometric mean |
---|
340 | (not supported for non-numerical columns) |
---|
341 | </simpara> |
---|
342 | </listitem> |
---|
343 | <listitem> |
---|
344 | <simpara> |
---|
345 | <constant>quadratic_mean</constant>: calculate the quadtratic mean |
---|
346 | (not supported for non-numerical columns) |
---|
347 | </simpara> |
---|
348 | </listitem> |
---|
349 | <listitem> |
---|
350 | <simpara> |
---|
351 | <constant>min</constant>: use the minimum value of the values in the set |
---|
352 | </simpara> |
---|
353 | </listitem> |
---|
354 | <listitem> |
---|
355 | <simpara> |
---|
356 | <constant>max</constant>: use the maximum value of the values in the set |
---|
357 | </simpara> |
---|
358 | </listitem> |
---|
359 | </itemizedlist> |
---|
360 | |
---|
361 | </entry> |
---|
362 | </row> |
---|
363 | </tbody> |
---|
364 | </tgroup> |
---|
365 | </table> |
---|
366 | |
---|
367 | <para> |
---|
368 | Each <sgmltag class="starttag">property</sgmltag> tag may contain zero or more |
---|
369 | <sgmltag class="starttag">link</sgmltag> tags that can be used by client |
---|
370 | application to provide clickable links to other databases. Each |
---|
371 | <sgmltag class="starttag">link</sgmltag> has a <sgmltag>regexp</sgmltag> |
---|
372 | and an <sgmltag>url</sgmltag> attribute. If the regular expression matches |
---|
373 | the value a link will be created, otherwise not. The order of the |
---|
374 | <sgmltag class="starttag">link</sgmltag> tags are important, since only |
---|
375 | the first one that matches is used. The <sgmltag>url</sgmltag> attribute may |
---|
376 | contain the string <constant>{value}</constant> which will be replaced by the |
---|
377 | actual value when the link is generated. |
---|
378 | </para> |
---|
379 | |
---|
380 | <note> |
---|
381 | <para> |
---|
382 | If the link contains the character <constant>&</constant> it must be |
---|
383 | escaped as <constant>&amp;</constant>. For example, to link to a UniGene |
---|
384 | entry: |
---|
385 | </para> |
---|
386 | <programlisting> |
---|
387 | <link |
---|
388 | regexp="\w+\.\d+" |
---|
389 | url="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=unigene&amp;term={value}[ClusterID]" |
---|
390 | /> |
---|
391 | </programlisting> |
---|
392 | </note> |
---|
393 | |
---|
394 | |
---|
395 | </appendix> |
---|
396 | |
---|