Appendix D. extended-properties.xml reference

What is extended-properties.xml?

The extended-properties.xml file is a configuration file for customizing some of the tables in the BASE database. It is located in the <basedir>/www/WEB-INF/classes directory. Only a limited number of tables support this feature, the most important one is the table for storing reporter information.

The default extended-properties.xml that ships with BASE is biased towards the BASE version 1.2 setup for 2-spotted microarray data. If you want your BASE installation to be configured differently we recommend that you do it before the first initialisation of the database. It is possible to change the configuration of an existing BASE installation but it may require manual updates to the database. Follow this procedure:

  1. Shut down the BASE web server. If you have installed job agents you should shut down them as well.

  2. Modify the extended-properties.xml file. If you have installed job agents, make sure they all have the same version as the web server.

  3. Run the updatedb.sh script. New columns will automatically be created, but the script can't delete columns that have been removed, or modify columns that have changed data type. You will have to do these kind of changes by manually executing SQL against your database. Check your database documentation for information about SQL syntax.

    [Tip] Create a parallel installation

    You can always create a new temporary parallel installation to check what the table generated by installation script looks like. Compare the new table to the existing one and make sure they match.

  4. Start up the BASE web server and job agents, if any, again.

[Tip] Start with few columns

It is better to start with too few columns, since it is easier to add more columns than it is to remove columns that are not needed.

Sample extended properties setups

Multiple configuration files

Starting with BASE 2.6 it is possible to use multiple configuration files for extended properties. This is useful only if you want to add new columns. To remove or change existing columns you still have to modify the original extended properties file. It is rather simple to use this feature. Create a new directory with the name extended-properties in the same directory as the extended-properties.xml. In this directory you can put additional extended property files. They should have the same format as the default file.

[Tip] Tip
We recommend that you don't modify the default extended-properties.xml file at all (unless you want to remove some of the columns). This will make it easier when upgrading BASE since you don't have to worry about losing your own changes.

Format of the extended-properties.xml file

The extended-properties.xml is an XML file. The following example will serve as a description of the format:

<?xml version="1.0" ?>
<!DOCTYPE extended-properties SYSTEM "extended-properties.dtd">
<extended-properties>
   <class name="ReporterData">
      <property
         name="extra1"
         column="extra1"
         title="Extra property"
         type="string"
         length="255"
         null="true"
         update="true"
         insert="true"
         averagemethod="max"
         description="An extra property for all reporters"
      >
      <link
         regexp=".*"
         url="http://www.myexternaldb.com/find?{value}"
      />
      </property>
   </class>
</extended-properties>

Each table that can be customized is represented by a <class> tag. The value of the name attribute is the name of the Java class that handles the information in that table. In the case of reporters the class name is ReporterData.

Each <class> tag may contain one or more <property> tags, each one describing a single column in the table. The possible attributes of the <property> tag are:

Table D.1. Attributes for the <property> tag

Attribute Required Comment
name yes A unique name (within the class) of the extra property. The name must only contain letters, numbers and underscores but the first character can't be a number. The name is used to identify the extra column in the Java code and in the Query API.
column yes The name of the database column. This value must be unique within the class. Valid names depends on the database, but it should be safe to follow the same rules as for the name attribute. In most cases, it makes sense to use the same value for both the name and column attributes.
title no The title of the extra property as it is displayed in client applications. If not specified the value of the name attribute is used.
description no A longer (but still short!) description of the extra property which can be used in client applications to provide help.
type yes The data type of the column. Allowed values are:
  • int
  • long
  • float
  • double
  • boolean
  • string
  • date
  • timestamp

Note that the given types are converted into the most appropriate database column type by Hibernate.

length no If the column is a string type, this is the maximum length that can be stored in the database. If no value is given, 255 is assumed.
null no If the column should allow null values or not. Allowed values are true (default) and false.
insert no If values for this property should be inserted into the database or not. Allowed values are true (default) and false.
update no If values for this property should be updated in the database or not. Allowed values are true (default) and false.
averagable no This attribute has been deprecated and replaced by the averagemethod attribute!

If it makes sense to calculate the average of a set of values for this property or not. By default, all numerical columns are averagable. For non-numerical columns this attribute is ignored.

averagemethod no The method to use when calculating the average of a set of values. This attribute replaces the averagable attribute. The following values can be used:
  • none: average values are not supported (default for non-numerical columns)
  • arithmetic_mean: calculate the arithmetic mean (default for numerical columns; not supported for non-numerical columns)
  • geometric_mean: calculate the geometric mean (not supported for non-numerical columns)
  • min: use the minimum value of the values in the set
  • max: use the maximum value of the values in the set

Each <property> tag may contain zero or more <link> tags that can be used by client application to provide clickable links to other databases. Each <link> has a regexp and an url attribute. If the regular expression matches the value a link will be created, otherwise not. The order of the <link> tags are important, since only the first one that matches is used. The url attribute may contain the string {value} which will be replaced by the actual value when the link is generated.

[Note] Note

If the link contains the character & it must be escaped as &amp;. For example, to link to a UniGene entry:

<link
   regexp="\w+\.\d+"
   url="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=unigene&amp;term={value}[ClusterID]"
/>