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