source: trunk/doc/src/docbook/appendix/extended_properties.xml @ 6428

Last change on this file since 6428 was 6428, checked in by Nicklas Nordborg, 8 years ago

References #1599: Convert authentication plug-in system to an extension point

Added a boolean flag to extended-properties.xml file to make it possible to mark some properties as editable by an administrator only.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 13.4 KB
Line 
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 6428 2014-03-03 14:53:29Z 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>&lt;basedir&gt;/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>&lt;basedir&gt;/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>&lt;basedir&gt;/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>&lt;basedir&gt;/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&lt;?xml version="1.0" ?&gt;
154&lt;!DOCTYPE extended-properties SYSTEM "extended-properties.dtd"&gt;
155&lt;extended-properties&gt;
156   &lt;class name="ReporterData"&gt;
157      &lt;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         restricted-edit="false"
168         description="An extra property for all reporters"
169      &gt;
170      &lt;link
171         regexp=".*"
172         url="http://www.myexternaldb.com/find?{value}"
173      /&gt;
174      &lt;/property&gt;
175   &lt;/class&gt;
176&lt;/extended-properties&gt;
177</programlisting>
178 
179  <para>
180    Each table that can be customized is represented by a <sgmltag class="starttag">class</sgmltag> 
181    tag. The value of the <sgmltag>name</sgmltag> attribute is the name of the Java class
182    that handles the information in that table. In the case of reporters
183    the class name is <constant>ReporterData</constant>.
184  </para>
185 
186  <para>
187    Each <sgmltag class="starttag">class</sgmltag> tag may contain one or more
188    <sgmltag class="starttag">property</sgmltag> tags, each one describing a single
189    column in the table. The possible attributes of the <sgmltag class="starttag">property</sgmltag>
190    tag are:
191  </para>
192 
193    <table frame="all" id="appendix.extendedproperties.property">
194    <title>Attributes for the <sgmltag class="starttag">property</sgmltag> tag</title>
195    <tgroup cols="3" align="left">
196      <colspec colname="attribute" align="left" />
197      <colspec colname="required" />
198      <colspec colname="comment" />
199      <thead>
200        <row>
201          <entry>Attribute</entry>
202          <entry>Required</entry>
203          <entry>Comment</entry>
204        </row>
205      </thead>
206      <tbody>
207        <row>
208          <entry>name</entry>
209          <entry>yes</entry>
210          <entry>
211            A unique name (within the class) of the extra property.
212            The name must only contain letters, numbers and underscores but the first character
213            can't be a number. The name is used to identify the extra column in the Java code
214            and in the Query API.
215          </entry>
216        </row>
217        <row>
218          <entry>column</entry>
219          <entry>yes</entry>
220          <entry>
221            The name of the database column. This value must be unique within the
222            class. Valid names depends on the database, but it should be safe
223            to follow the same rules as for the <sgmltag>name</sgmltag> attribute.
224            In most cases, it makes sense to use the same value for both the
225            <sgmltag>name</sgmltag> and <sgmltag>column</sgmltag> attributes.
226          </entry>
227        </row>
228        <row>
229          <entry>title</entry>
230          <entry>no</entry>
231          <entry>
232            The title of the extra property as it is displayed in client applications.
233            If not specified the value of the <sgmltag>name</sgmltag> attribute is used.
234          </entry>
235        </row>
236        <row>
237          <entry>description</entry>
238          <entry>no</entry>
239          <entry>
240            A longer (but still short!) description of the extra property which can be
241            used in client applications to provide help.
242          </entry>
243        </row>
244        <row>
245          <entry>type</entry>
246          <entry>yes</entry>
247          <entry>
248            The data type of the column. Allowed values are:
249            <itemizedlist>
250            <listitem>
251              <simpara>int</simpara>
252            </listitem>
253            <listitem>
254              <simpara>long</simpara>
255            </listitem>
256            <listitem>
257              <simpara>float</simpara>
258            </listitem>
259            <listitem>
260              <simpara>double</simpara>
261            </listitem>
262            <listitem>
263              <simpara>boolean</simpara>
264            </listitem>
265            <listitem>
266              <simpara>string</simpara>
267            </listitem>
268            <listitem>
269              <simpara>date</simpara>
270            </listitem>
271            <listitem>
272              <simpara>timestamp</simpara>
273            </listitem>
274            </itemizedlist>
275           
276            <para>
277              Note that the given types are converted into the most appropriate database
278              column type by Hibernate.
279            </para>
280          </entry>
281        </row>
282        <row>
283          <entry>length</entry>
284          <entry>no</entry>
285          <entry>
286            If the column is a string type, this is the maximum length that can
287            be stored in the database. If no value is given, 255 is assumed.
288          </entry>
289        </row>
290        <row>
291          <entry>null</entry>
292          <entry>no</entry>
293          <entry>
294            If the column should allow <constant>null</constant> values or not.
295            Allowed values are <constant>true</constant> (default) and
296            <constant>false</constant>.
297          </entry>
298        </row>
299        <row>
300          <entry>insert</entry>
301          <entry>no</entry>
302          <entry>
303            If values for this property should be inserted into the database or not.
304            Allowed values are <constant>true</constant> (default) and
305            <constant>false</constant>.
306          </entry>
307        </row>
308        <row>
309          <entry>update</entry>
310          <entry>no</entry>
311          <entry>
312            If values for this property should be updated in the database or not.
313            Allowed values are <constant>true</constant> (default) and
314            <constant>false</constant>.
315          </entry>
316        </row>
317        <row>
318          <entry>restricted-edit</entry>
319          <entry>no</entry>
320          <entry>
321            Allowed values are <constant>false</constant> (default) and
322            <constant>true</constant>. If set, there is some restriction
323            on who may change the values. This is currently only implemented
324            for users. If the property is restricted only an administrator is allowed
325            to change the value, not the user itself.
326          </entry>
327        </row>
328        <row>
329          <entry>averagemethod</entry>
330          <entry>no</entry>
331          <entry>
332            The method to use when calculating the average of a set of values.
333            This attribute replaces the <sgmltag>averagable</sgmltag> attribute.
334            The following values can be used:
335             
336            <itemizedlist>
337            <listitem>
338              <simpara>
339              <constant>none</constant>: average values are not supported
340              (default for non-numerical columns)
341              </simpara>
342            </listitem> 
343            <listitem>
344              <simpara>
345              <constant>arithmetic_mean</constant>: calculate the arithmetic mean
346              (default for numerical columns; not supported for non-numerical columns)
347              </simpara>
348            </listitem> 
349            <listitem>
350              <simpara>
351              <constant>geometric_mean</constant>: calculate the geometric mean
352              (not supported for non-numerical columns)
353              </simpara>
354            </listitem> 
355            <listitem>
356              <simpara>
357              <constant>quadratic_mean</constant>: calculate the quadtratic mean
358              (not supported for non-numerical columns)
359              </simpara>
360            </listitem> 
361            <listitem>
362              <simpara>
363              <constant>min</constant>: use the minimum value of the values in the set
364              </simpara>
365            </listitem> 
366            <listitem>
367              <simpara>
368              <constant>max</constant>: use the maximum value of the values in the set
369              </simpara>
370            </listitem> 
371            </itemizedlist>
372             
373          </entry>
374        </row>
375      </tbody>
376    </tgroup>
377    </table>
378 
379  <para>
380    Each <sgmltag class="starttag">property</sgmltag> tag may contain zero or more
381    <sgmltag class="starttag">link</sgmltag> tags that can be used by client
382    application to provide clickable links to other databases. Each
383    <sgmltag class="starttag">link</sgmltag> has a <sgmltag>regexp</sgmltag>
384    and an <sgmltag>url</sgmltag> attribute. If the regular expression matches
385    the value a link will be created, otherwise not. The order of the
386    <sgmltag class="starttag">link</sgmltag> tags are important, since only
387    the first one that matches is used. The <sgmltag>url</sgmltag> attribute may
388    contain the string <constant>{value}</constant> which will be replaced by the
389    actual value when the link is generated.
390  </para>
391 
392  <note>
393    <para>
394    If the link contains the character <constant>&amp;</constant> it must be
395    escaped as <constant>&amp;amp;</constant>. For example, to link to a UniGene
396    entry:
397    </para>
398    <programlisting>
399&lt;link
400   regexp="\w+\.\d+"
401   url="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=unigene&amp;amp;term={value}[ClusterID]"
402/&gt;
403</programlisting>
404  </note>
405
406 
407</appendix>
408
Note: See TracBrowser for help on using the repository browser.