Changeset 2992


Ignore:
Timestamp:
Dec 1, 2006, 3:00:14 PM (16 years ago)
Author:
Johan Enell
Message:

Merged log:branches/2.1#2846:2990 trunk.

Location:
trunk
Files:
53 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/config/dist/mysql-migration-queries.sql

    r2959 r2992  
    11/*
    2    $Id: mysql-migration-queries.sql 2693 2006-10-03 11:44:54Z nicklas $
     2   $Id: mysql-migration-queries.sql 2973 2006-11-29 09:24:26Z nicklas $
    33
    44  Copyright (C) Authors contributing to this file.
     
    971971  `flags`
    972972FROM  `RawBioAssayData`
    973 WHERE   `rawBioAssay` = ?
    974 ORDER BY `position`
    975 LIMIT   ?,?;
     973WHERE   `rawBioAssay` = ?;
    976974
    977975
     
    979977SELECT `element`, `reporter`, `block`, `numCol`, `numRow`, `x`, `y`
    980978FROM  `RawBioAssayData`
    981 WHERE   `rawBioAssay` = ?
    982 ORDER BY `position`
    983 LIMIT   ?,?;
     979WHERE   `rawBioAssay` = ?;
    984980
    985981
     
    10371033LIMIT   ?, ?;
    10381034
     1035/* getCh1SampleForRawBioAssay */
     1036SELECT s.`id` FROM `Sample` s
     1037INNER JOIN `Extract` e ON e.`sample` = s.`id`
     1038INNER JOIN `LabeledExtract` le ON le.`extract` = e.`id`
     1039INNER JOIN `HybridizedLabeled` hl ON hl.`labeled` = le.`id` AND hl.`channel` = 1
     1040INNER JOIN `ImageAcquisition` ia ON ia.`hybridization` =  hl.`hybridization`
     1041INNER JOIN `RawBioAssay` rba ON rba.`imageAcquisition` = ia.`id`
     1042WHERE rba.`id` = ?;
    10391043
    10401044/* selectRawBioAssaysWithSpotData */
  • trunk/data/plugin_configfile.xml

    r2975 r2992  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <!DOCTYPE configfile SYSTEM "plugin-configuration-file.dtd"><configfile>
     2<!DOCTYPE configfile SYSTEM "plugin-configuration-file.dtd">
     3<!--
     4  $Id:
     5  Copyright (C) Authors contributing to this file.
     6
     7  This file is part of BASE - BioArray Software Environment.
     8  Available at http://base.thep.lu.se/
     9
     10  BASE is free software; you can redistribute it and/or
     11  modify it under the terms of the GNU General Public License
     12  as published by the Free Software Foundation; either version 2
     13  of the License, or (at your option) any later version.
     14
     15  BASE is distributed in the hope that it will be useful,
     16  but WITHOUT ANY WARRANTY; without even the implied warranty of
     17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     18  GNU General Public License for more details.
     19
     20  You should have received a copy of the GNU General Public License
     21  along with this program; if not, write to the Free Software
     22  Foundation, Inc., 59 Temple Place - Suite 330,
     23  Boston, MA  02111-1307, USA.
     24-->
     25<configfile>
    326  <configuration pluginClassName="net.sf.basedb.plugins.PlateFlatFileImporter">
    427    <configname>384_wells plate import</configname>
    528    <description>This configuration is for the Plate importer plugin when to import 384-well plates.</description>
    629    <parameter>
    7       <name>maxDataColumns</name>
    8       <label>Max data columns</label>
    9       <description>The maximum number of columns for a line to be counted as a data line, or 0 to allow any number of columns.</description>
    10       <class />
    11       <value />
     30      <name>nameColumnMapping</name>
     31      <label>nameColumnMapping</label>
     32      <class>java.lang.String</class>
     33      <value>\384_number\</value>
    1234    </parameter>
    1335    <parameter>
    1436      <name>reporterColumnMapping</name>
    15       <label>Reporter ID</label>
    16       <description>Mapping that picks the well's reporter id from the data columns. For example: \ID\</description>
     37      <label>reporterColumnMapping</label>
    1738      <class>java.lang.String</class>
    1839      <value>\oligo_id\</value>
     
    2041    <parameter>
    2142      <name>dataHeaderRegexp</name>
    22       <label>Data header</label>
    23       <description>A regular expression that matches the header line just before the data begins. For example: Block\tRow\tColumn.*</description>
     43      <label>dataHeaderRegexp</label>
    2444      <class>java.lang.String</class>
    2545      <value>384_number\t384_column\t384_row\t384_position\toligo_id.*</value>
    2646    </parameter>
    2747    <parameter>
    28       <name>barcodeColumnMapping</name>
    29       <label>Plate barcode</label>
    30       <description>Mapping that picks the plate barcode from the data columns. For example: \Barcode\</description>
    31       <class />
    32       <value />
    33     </parameter>
    34     <parameter>
    35       <name>trimQuotes</name>
    36       <label>Remove quotes</label>
    37       <description>If true quotes (" or ') around data value will be removed.</description>
    38       <class>java.lang.Boolean</class>
    39       <value>true</value>
    40     </parameter>
    41     <parameter>
    4248      <name>dataSplitterRegexp</name>
    43       <label>Data splitter</label>
    44       <description>A regular expression that splits each data line into individual columns. For example, split on tabs: \t</description>
     49      <label>dataSplitterRegexp</label>
    4550      <class>java.lang.String</class>
    4651      <value>\t</value>
    4752    </parameter>
    4853    <parameter>
    49       <name>charset</name>
    50       <label>Character set</label>
    51       <description>The character set used in the file, if not specified the default character set is used (ISO-8859-1).</description>
    52       <class>java.lang.String</class>
    53       <value>ISO-8859-1</value>
    54     </parameter>
    55     <parameter>
    5654      <name>columnColumnMapping</name>
    57       <label>Column</label>
    58       <description>Mapping that picks the well's column in the plate from the data columns. For example: \Column\</description>
     55      <label>columnColumnMapping</label>
    5956      <class>java.lang.String</class>
    6057      <value>\384_column\</value>
    6158    </parameter>
    6259    <parameter>
    63       <name>nameColumnMapping</name>
    64       <label>Plate number/name</label>
    65       <description>Mapping that picks the plate name from the data columns. For example: \Plate\</description>
    66       <class>java.lang.String</class>
    67       <value>\384_number\</value>
    68     </parameter>
    69     <parameter>
    70       <name>minDataColumns</name>
    71       <label>Min data columns</label>
    72       <description>The minimum number of columns for a line to be counted as a data line.</description>
    73       <class />
    74       <value />
    75     </parameter>
    76     <parameter>
    77       <name>ignoreRegexp</name>
    78       <label>Ignore</label>
    79       <description>A regular expression that matches any line that should be ignored. For example, ignore lines starting with #: ^#.*</description>
    80       <class />
    81       <value />
    82     </parameter>
    83     <parameter>
    84       <name>dataFooterRegexp</name>
    85       <label>Data footer</label>
    86       <description>A regular expression that matches the first line of non-data after the data lines. For example: __END_OF_DATA__</description>
    87       <class />
    88       <value />
    89     </parameter>
    90     <parameter>
    91       <name>headerRegexp</name>
    92       <label>Header</label>
    93       <description>A regular expression that matches a header line and extracts the name and a value parts. For example, split on equal symbol: (.+)=(.*)</description>
    94       <class />
    95       <value />
    96     </parameter>
    97     <parameter>
    9860      <name>rowColumnMapping</name>
    99       <label>Row</label>
    100       <description>Mapping that picks the well's row in the plate from the data columns. For example: \Row\</description>
     61      <label>rowColumnMapping</label>
    10162      <class>java.lang.String</class>
    10263      <value>\384_row\</value>
     
    10768    <description>This configuration is for importing reporters from the same text file as 384well plates are imported from.</description>
    10869    <parameter>
    109       <name>maxDataColumns</name>
    110       <label>Max data columns</label>
    111       <description>The maximum number of columns for a line to be counted as a data line, or 0 to allow any number of columns.</description>
    112       <class />
    113       <value />
    114     </parameter>
    115     <parameter>
    116       <name>extendedColumnMapping.locusLink</name>
    117       <label>LocusLink</label>
    118       <description />
    119       <class />
    120       <value />
    121     </parameter>
    122     <parameter>
    123       <name>trimQuotes</name>
    124       <label>Remove quotes</label>
    125       <description>If true quotes (" or ') around data value will be removed.</description>
    126       <class>java.lang.Boolean</class>
    127       <value>true</value>
    128     </parameter>
    129     <parameter>
    130       <name>charset</name>
    131       <label>Character set</label>
    132       <description>The character set used in the file, if not specified the default character set is used (ISO-8859-1).</description>
    133       <class>java.lang.String</class>
    134       <value>ISO-8859-1</value>
    135     </parameter>
    136     <parameter>
    137       <name>scoreColumnMapping</name>
    138       <label>Score</label>
    139       <description>Mapping that picks the reporter's score in some context. This mapping is only used when importing to a reporter list.</description>
    140       <class />
    141       <value />
    142     </parameter>
    143     <parameter>
    14470      <name>nameColumnMapping</name>
    145       <label>Name</label>
    146       <description>Mapping that picks the reporter's name from the data columns. For example: \Name\</description>
     71      <label>nameColumnMapping</label>
    14772      <class>java.lang.String</class>
    14873      <value>\oligo_id\</value>
    14974    </parameter>
    15075    <parameter>
    151       <name>extendedColumnMapping.markers</name>
    152       <label>Markers</label>
    153       <description />
    154       <class />
    155       <value />
    156     </parameter>
    157     <parameter>
    158       <name>extendedColumnMapping.vector</name>
    159       <label>Vector</label>
    160       <description>The vector from which the reporter is derived</description>
    161       <class />
    162       <value />
    163     </parameter>
    164     <parameter>
    165       <name>extendedColumnMapping.nid</name>
    166       <label>NID</label>
    167       <description />
    168       <class />
    169       <value />
     76      <name>dataHeaderRegexp</name>
     77      <label>dataHeaderRegexp</label>
     78      <class>java.lang.String</class>
     79      <value>384_number\t384_column\t384_row\t384_position\toligo_id.*</value>
     80    </parameter>
     81    <parameter>
     82      <name>dataSplitterRegexp</name>
     83      <label>dataSplitterRegexp</label>
     84      <class>java.lang.String</class>
     85      <value>\t</value>
    17086    </parameter>
    17187    <parameter>
    17288      <name>descriptionColumnMapping</name>
    173       <label>Description</label>
    174       <description>Mapping that picks the reporter's description from the data columns. For example: \Description\</description>
     89      <label>descriptionColumnMapping</label>
    17590      <class>java.lang.String</class>
    17691      <value>\description_Ensembl*\</value>
    17792    </parameter>
    17893    <parameter>
    179       <name>headerRegexp</name>
    180       <label>Header</label>
    181       <description>A regular expression that matches a header line and extracts the name and a value parts. For example, split on equal symbol: (.+)=(.*)</description>
    182       <class />
    183       <value />
     94      <name>symbolColumnMapping</name>
     95      <label>symbolColumnMapping</label>
     96      <class>java.lang.String</class>
     97      <value>\gene_symbol_Ensembl*\</value>
    18498    </parameter>
    18599    <parameter>
    186100      <name>reporterIdColumnMapping</name>
    187       <label>Reporter ID</label>
    188       <description>Mapping that picks the reporter's ID from the data columns. For example: \ID\</description>
     101      <label>reporterIdColumnMapping</label>
    189102      <class>java.lang.String</class>
    190103      <value>\oligo_id\</value>
    191104    </parameter>
    192105    <parameter>
    193       <name>symbolColumnMapping</name>
    194       <label>Gene symbol</label>
    195       <description>Mapping that picks the reporter's gene symbol from the data columns. For example: \Gene symbol\</description>
    196       <class>java.lang.String</class>
    197       <value>\gene_symbol_Ensembl*\</value>
    198     </parameter>
    199     <parameter>
    200       <name>extendedColumnMapping.antibiotics</name>
    201       <label>Antibiotics</label>
    202       <description />
    203       <class />
    204       <value />
    205     </parameter>
    206     <parameter>
    207       <name>extendedColumnMapping.omim</name>
    208       <label>OMIM</label>
    209       <description />
    210       <class />
    211       <value />
    212     </parameter>
    213     <parameter>
    214       <name>extendedColumnMapping.chromosome</name>
    215       <label>Chromosome</label>
    216       <description>The chromosome from which the reporter is derived</description>
    217       <class />
    218       <value />
    219     </parameter>
    220     <parameter>
    221       <name>reporterType</name>
    222       <label>Reporter type</label>
    223       <description>The reporter type assigned to the imported reporters</description>
    224       <class />
    225       <value />
    226     </parameter>
    227     <parameter>
    228       <name>dataHeaderRegexp</name>
    229       <label>Data header</label>
    230       <description>A regular expression that matches the header line just before the data begins. For example: Block\tRow\tColumn.*</description>
    231       <class>java.lang.String</class>
    232       <value>384_number\t384_column\t384_row\t384_position\toligo_id.*</value>
    233     </parameter>
    234     <parameter>
    235       <name>dataSplitterRegexp</name>
    236       <label>Data splitter</label>
    237       <description>A regular expression that splits each data line into individual columns. For example, split on tabs: \t</description>
    238       <class>java.lang.String</class>
    239       <value>\t</value>
    240     </parameter>
    241     <parameter>
    242       <name>extendedColumnMapping.length</name>
    243       <label>Length</label>
    244       <description>The length of the sequence</description>
    245       <class />
    246       <value />
    247     </parameter>
    248     <parameter>
    249       <name>extendedColumnMapping.tissue</name>
    250       <label>Tissue</label>
    251       <description>The tissue from which the reporter is derived</description>
    252       <class />
    253       <value />
    254     </parameter>
    255     <parameter>
    256       <name>extendedColumnMapping.accession</name>
    257       <label>Accession</label>
    258       <description />
    259       <class />
    260       <value />
    261     </parameter>
    262     <parameter>
    263       <name>minDataColumns</name>
    264       <label>Min data columns</label>
    265       <description>The minimum number of columns for a line to be counted as a data line.</description>
    266       <class />
    267       <value />
    268     </parameter>
    269     <parameter>
    270       <name>ignoreRegexp</name>
    271       <label>Ignore</label>
    272       <description>A regular expression that matches any line that should be ignored. For example, ignore lines starting with #: ^#.*</description>
    273       <class />
    274       <value />
    275     </parameter>
    276     <parameter>
    277       <name>reporterTypeColumnMapping</name>
    278       <label>Reporter type</label>
    279       <description>Mapping that pick the reporter's type from the data columns. This will overide the reporter type parameter. For example: \Reporter type\</description>
    280       <class />
    281       <value />
    282     </parameter>
    283     <parameter>
    284       <name>extendedColumnMapping.library</name>
    285       <label>Library</label>
    286       <description>The library from which the reporter is derived</description>
    287       <class />
    288       <value />
    289     </parameter>
    290     <parameter>
    291       <name>extendedColumnMapping.clusterId</name>
    292       <label>Cluster ID</label>
    293       <description>A unique identifier for a Unigene entry</description>
    294       <class />
    295       <value />
    296     </parameter>
    297     <parameter>
    298       <name>dataFooterRegexp</name>
    299       <label>Data footer</label>
    300       <description>A regular expression that matches the first line of non-data after the data lines. For example: __END_OF_DATA__</description>
    301       <class />
    302       <value />
    303     </parameter>
    304     <parameter>
    305       <name>extendedColumnMapping.cytoband</name>
    306       <label>Cytoband</label>
    307       <description>The cytoband from which the reporter is derived</description>
    308       <class />
    309       <value />
    310     </parameter>
    311     <parameter>
    312106      <name>extendedColumnMapping.sequence</name>
    313       <label>Sequence</label>
    314       <description>The nucleotide sequence of the reporter</description>
     107      <label>extendedColumnMapping.sequence</label>
    315108      <class>java.lang.String</class>
    316109      <value>\oligo_sequence\</value>
    317     </parameter>
    318     <parameter>
    319       <name>extendedColumnMapping.species</name>
    320       <label>Species</label>
    321       <description>The organism from which the reporter is derived</description>
    322       <class />
    323       <value />
    324110    </parameter>
    325111  </configuration>
     
    330116      <name>maxDataColumns</name>
    331117      <label>Max data columns</label>
    332       <description>The maximum number of columns for a line to be counted as a data line, or 0 to allow any number of columns.</description>
    333118      <class />
    334119      <value />
     
    337122      <name>extendedColumnMapping.locusLink</name>
    338123      <label>LocusLink</label>
    339       <description />
    340124      <class />
    341125      <value />
     
    344128      <name>trimQuotes</name>
    345129      <label>Remove quotes</label>
    346       <description>If true quotes (" or ') around data value will be removed.</description>
    347130      <class>java.lang.Boolean</class>
    348131      <value>true</value>
    349132    </parameter>
    350133    <parameter>
    351       <name>charset</name>
    352       <label>Character set</label>
    353       <description>The character set used in the file, if not specified the default character set is used (ISO-8859-1).</description>
    354       <class>java.lang.String</class>
    355       <value>ISO-8859-1</value>
    356     </parameter>
    357     <parameter>
    358134      <name>scoreColumnMapping</name>
    359135      <label>Score</label>
    360       <description>Mapping that picks the reporter's score in some context. This mapping is only used when importing to a reporter list.</description>
    361136      <class />
    362137      <value />
     
    365140      <name>nameColumnMapping</name>
    366141      <label>Name</label>
    367       <description>Mapping that picks the reporter's name from the data columns. For example: \Name\</description>
    368142      <class>java.lang.String</class>
    369143      <value>\Name\</value>
     
    372146      <name>extendedColumnMapping.markers</name>
    373147      <label>Markers</label>
    374       <description />
    375148      <class />
    376149      <value />
     
    379152      <name>extendedColumnMapping.vector</name>
    380153      <label>Vector</label>
    381       <description>The vector from which the reporter is derived</description>
    382154      <class />
    383155      <value />
     
    386158      <name>extendedColumnMapping.nid</name>
    387159      <label>NID</label>
    388       <description />
    389160      <class />
    390161      <value />
     
    393164      <name>descriptionColumnMapping</name>
    394165      <label>Description</label>
    395       <description>Mapping that picks the reporter's description from the data columns. For example: \Description\</description>
    396166      <class />
    397167      <value />
     
    400170      <name>headerRegexp</name>
    401171      <label>Header</label>
    402       <description>A regular expression that matches a header line and extracts the name and a value parts. For example, split on equal symbol: (.+)=(.*)</description>
    403172      <class />
    404173      <value />
     
    407176      <name>reporterIdColumnMapping</name>
    408177      <label>Reporter ID</label>
    409       <description>Mapping that picks the reporter's ID from the data columns. For example: \ID\</description>
    410178      <class>java.lang.String</class>
    411179      <value>\ID\</value>
     
    414182      <name>symbolColumnMapping</name>
    415183      <label>Gene symbol</label>
    416       <description>Mapping that picks the reporter's gene symbol from the data columns. For example: \Gene symbol\</description>
    417184      <class />
    418185      <value />
     
    421188      <name>extendedColumnMapping.antibiotics</name>
    422189      <label>Antibiotics</label>
    423       <description />
     190      <class />
     191      <value />
     192    </parameter>
     193    <parameter>
     194      <name>extendedColumnMapping.chromosome</name>
     195      <label>Chromosome</label>
     196      <class />
     197      <value />
     198    </parameter>
     199    <parameter>
     200      <name>reporterType</name>
     201      <label>Reporter type</label>
    424202      <class />
    425203      <value />
     
    428206      <name>extendedColumnMapping.omim</name>
    429207      <label>OMIM</label>
    430       <description />
    431       <class />
    432       <value />
    433     </parameter>
    434     <parameter>
    435       <name>extendedColumnMapping.chromosome</name>
    436       <label>Chromosome</label>
    437       <description>The chromosome from which the reporter is derived</description>
    438       <class />
    439       <value />
    440     </parameter>
    441     <parameter>
    442       <name>reporterType</name>
    443       <label>Reporter type</label>
    444       <description>The reporter type assigned to the imported reporters</description>
    445208      <class />
    446209      <value />
     
    449212      <name>dataHeaderRegexp</name>
    450213      <label>Data header</label>
    451       <description>A regular expression that matches the header line just before the data begins. For example: Block\tRow\tColumn.*</description>
    452214      <class>java.lang.String</class>
    453215      <value>"Block"\t"Column"\t"Row"\t"Name"\t"ID".*</value>
     
    456218      <name>dataSplitterRegexp</name>
    457219      <label>Data splitter</label>
    458       <description>A regular expression that splits each data line into individual columns. For example, split on tabs: \t</description>
    459220      <class>java.lang.String</class>
    460221      <value>\t</value>
     
    463224      <name>extendedColumnMapping.length</name>
    464225      <label>Length</label>
    465       <description>The length of the sequence</description>
    466226      <class />
    467227      <value />
     
    470230      <name>extendedColumnMapping.tissue</name>
    471231      <label>Tissue</label>
    472       <description>The tissue from which the reporter is derived</description>
    473232      <class />
    474233      <value />
     
    477236      <name>extendedColumnMapping.accession</name>
    478237      <label>Accession</label>
    479       <description />
    480238      <class />
    481239      <value />
     
    484242      <name>minDataColumns</name>
    485243      <label>Min data columns</label>
    486       <description>The minimum number of columns for a line to be counted as a data line.</description>
    487244      <class />
    488245      <value />
     
    491248      <name>ignoreRegexp</name>
    492249      <label>Ignore</label>
    493       <description>A regular expression that matches any line that should be ignored. For example, ignore lines starting with #: ^#.*</description>
    494       <class />
    495       <value />
    496     </parameter>
    497     <parameter>
    498       <name>reporterTypeColumnMapping</name>
    499       <label>Reporter type</label>
    500       <description>Mapping that pick the reporter's type from the data columns. This will overide the reporter type parameter. For example: \Reporter type\</description>
    501250      <class />
    502251      <value />
     
    505254      <name>extendedColumnMapping.library</name>
    506255      <label>Library</label>
    507       <description>The library from which the reporter is derived</description>
    508256      <class />
    509257      <value />
     
    512260      <name>extendedColumnMapping.clusterId</name>
    513261      <label>Cluster ID</label>
    514       <description>A unique identifier for a Unigene entry</description>
    515262      <class />
    516263      <value />
     
    519266      <name>dataFooterRegexp</name>
    520267      <label>Data footer</label>
    521       <description>A regular expression that matches the first line of non-data after the data lines. For example: __END_OF_DATA__</description>
     268      <class />
     269      <value />
     270    </parameter>
     271    <parameter>
     272      <name>extendedColumnMapping.sequence</name>
     273      <label>Sequence</label>
     274      <class />
     275      <value />
     276    </parameter>
     277    <parameter>
     278      <name>extendedColumnMapping.species</name>
     279      <label>Species</label>
    522280      <class />
    523281      <value />
     
    526284      <name>extendedColumnMapping.cytoband</name>
    527285      <label>Cytoband</label>
    528       <description>The cytoband from which the reporter is derived</description>
    529       <class />
    530       <value />
    531     </parameter>
    532     <parameter>
    533       <name>extendedColumnMapping.sequence</name>
    534       <label>Sequence</label>
    535       <description>The nucleotide sequence of the reporter</description>
    536       <class />
    537       <value />
    538     </parameter>
    539     <parameter>
    540       <name>extendedColumnMapping.species</name>
    541       <label>Species</label>
    542       <description>The organism from which the reporter is derived</description>
    543286      <class />
    544287      <value />
     
    550293Block mapping is used in this configuration.</description>
    551294    <parameter>
    552       <name>maxDataColumns</name>
    553       <label>Max data columns</label>
    554       <description>The maximum number of columns for a line to be counted as a data line, or 0 to allow any number of columns.</description>
    555       <class />
    556       <value />
    557     </parameter>
    558     <parameter>
    559295      <name>dataHeaderRegexp</name>
    560       <label>Data header</label>
    561       <description>A regular expression that matches the header line just before the data begins. For example: Block\tRow\tColumn.*</description>
     296      <label>dataHeaderRegexp</label>
    562297      <class>java.lang.String</class>
    563298      <value>"Block"\t"Column"\t"Row"\t"Name"\t"ID".*</value>
    564299    </parameter>
    565300    <parameter>
    566       <name>trimQuotes</name>
    567       <label>Remove quotes</label>
    568       <description>If true quotes (" or ') around data value will be removed.</description>
    569       <class>java.lang.Boolean</class>
    570       <value>true</value>
    571     </parameter>
    572     <parameter>
    573301      <name>dataSplitterRegexp</name>
    574       <label>Data splitter</label>
    575       <description>A regular expression that splits each data line into individual columns. For example, split on tabs: \t</description>
     302      <label>dataSplitterRegexp</label>
    576303      <class>java.lang.String</class>
    577304      <value>\t</value>
    578305    </parameter>
    579306    <parameter>
    580       <name>charset</name>
    581       <label>Character set</label>
    582       <description>The character set used in the file, if not specified the default character set is used (ISO-8859-1).</description>
    583       <class>java.lang.String</class>
    584       <value>ISO-8859-1</value>
    585     </parameter>
    586     <parameter>
    587307      <name>columnColumnMapping</name>
    588       <label>Column</label>
    589       <description>Mapping that picks the feature's column position in a block from the data columns. For example: \Column\</description>
     308      <label>columnColumnMapping</label>
    590309      <class>java.lang.String</class>
    591310      <value>\Column\</value>
    592311    </parameter>
    593312    <parameter>
    594       <name>metaGridXColumnMapping</name>
    595       <label>Meta grid X</label>
    596       <description>Mapping that picks the feature's meta grid X coordinate from the data columns. Required if you don't specify a block mapping. Example: \Meta grid X\</description>
    597       <class />
    598       <value />
    599     </parameter>
    600     <parameter>
    601       <name>metaGridYColumnMapping</name>
    602       <label>Meta grid Y</label>
    603       <description>Mapping that picks the feature's meta grid Y coordinate from the data columns. Required if you don't specify a block mapping. Example: \Meta grid Y\</description>
    604       <class />
    605       <value />
    606     </parameter>
    607     <parameter>
    608       <name>minDataColumns</name>
    609       <label>Min data columns</label>
    610       <description>The minimum number of columns for a line to be counted as a data line.</description>
    611       <class />
    612       <value />
    613     </parameter>
    614     <parameter>
    615       <name>ignoreRegexp</name>
    616       <label>Ignore</label>
    617       <description>A regular expression that matches any line that should be ignored. For example, ignore lines starting with #: ^#.*</description>
    618       <class />
    619       <value />
    620     </parameter>
    621     <parameter>
    622       <name>dataFooterRegexp</name>
    623       <label>Data footer</label>
    624       <description>A regular expression that matches the first line of non-data after the data lines. For example: __END_OF_DATA__</description>
    625       <class />
    626       <value />
    627     </parameter>
    628     <parameter>
    629313      <name>reporterIdColumnMapping</name>
    630       <label>Reporter ID</label>
    631       <description>Mapping that picks the reporter's ID from the data columns. For example: \ID\</description>
     314      <label>reporterIdColumnMapping</label>
    632315      <class>java.lang.String</class>
    633316      <value>\ID\</value>
    634317    </parameter>
    635318    <parameter>
    636       <name>headerRegexp</name>
    637       <label>Header</label>
    638       <description>A regular expression that matches a header line and extracts the name and a value parts. For example, split on equal symbol: (.+)=(.*)</description>
    639       <class />
    640       <value />
    641     </parameter>
    642     <parameter>
    643319      <name>blockColumnMapping</name>
    644       <label>Block</label>
    645       <description>Mapping that picks the feature's block number from the data columns. You must specify either this mapping or mappings for the meta coordinates. Example: \Block\</description>
     320      <label>blockColumnMapping</label>
    646321      <class>java.lang.String</class>
    647322      <value>\Block\</value>
     
    649324    <parameter>
    650325      <name>rowColumnMapping</name>
    651       <label>Row</label>
    652       <description>Mapping that picks the feature's row position in a block from the data columns. For example: \Row\</description>
     326      <label>rowColumnMapping</label>
    653327      <class>java.lang.String</class>
    654328      <value>\Row\</value>
     
    662336      <name>yColumnMapping</name>
    663337      <label>Y</label>
    664       <description>Mapping that picks the spot's physical Y coordinate from the data columns. For example: \Y\</description>
    665338      <class>java.lang.String</class>
    666339      <value>\Y\</value>
    667340    </parameter>
    668341    <parameter>
    669       <name>maxDataColumns</name>
    670       <label>Max data columns</label>
    671       <description>The maximum number of columns for a line to be counted as a data line, or 0 to allow any number of columns.</description>
    672       <class />
    673       <value />
     342      <name>propertyMapping.ch2BgMean</name>
     343      <label>Channel 2 background mean</label>
     344      <class>java.lang.String</class>
     345      <value>\B532 Mean\</value>
    674346    </parameter>
    675347    <parameter>
    676348      <name>propertyMapping.flags</name>
    677349      <label>Flags</label>
    678       <description>Flags</description>
    679350      <class>java.lang.String</class>
    680351      <value>\Flags\</value>
    681     </parameter>
    682     <parameter>
    683       <name>propertyMapping.ch2BgMean</name>
    684       <label>Channel 2 background mean</label>
    685       <description>The mean of the background intensity in channel 2</description>
    686       <class>java.lang.String</class>
    687       <value>\B532 Mean\</value>
    688352    </parameter>
    689353    <parameter>
    690354      <name>propertyMapping.mValue</name>
    691355      <label>M value</label>
    692       <description>M value</description>
    693       <class>java.lang.String</class>
    694       <value>\Log Ratio (635/532)\</value>
     356      <class>java.lang.String</class>
     357      <value>\Log Ratio (532/635)\</value>
    695358    </parameter>
    696359    <parameter>
    697360      <name>trimQuotes</name>
    698361      <label>Remove quotes</label>
    699       <description>If true quotes (" or ') around data value will be removed.</description>
    700362      <class>java.lang.Boolean</class>
    701363      <value>true</value>
    702364    </parameter>
    703365    <parameter>
    704       <name>charset</name>
    705       <label>Character set</label>
    706       <description>The character set used in the file, if not specified the default character set is used (ISO-8859-1).</description>
    707       <class>java.lang.String</class>
    708       <value>ISO-8859-1</value>
    709     </parameter>
    710     <parameter>
    711366      <name>propertyMapping.diameter</name>
    712367      <label>Spot diameter</label>
    713       <description>The diameter of the spot in pixels</description>
    714368      <class>java.lang.String</class>
    715369      <value>\Dia.\</value>
     
    718372      <name>propertyMapping.ch2PercSat</name>
    719373      <label>Percent saturated pixels</label>
    720       <description>Percentage of saturated pixels in channel 2</description>
    721374      <class>java.lang.String</class>
    722375      <value>\F532 % Sat.\</value>
     
    725378      <name>propertyMapping.ch1FgSd</name>
    726379      <label>Channel 1 foreground standard deviation</label>
    727       <description>The standard deviation of the foreground intensity in channel 1</description>
    728380      <class>java.lang.String</class>
    729381      <value>\F635 SD\</value>
     
    732384      <name>propertyMapping.ch2PercSd1</name>
    733385      <label>Percent pixels within 1 standard deviation</label>
    734       <description>Percentage of pixels within 1 standard deviation in channel 2</description>
    735386      <class>java.lang.String</class>
    736387      <value>\% &gt; B532+1SD\</value>
     
    739390      <name>propertyMapping.fgPixels</name>
    740391      <label>Foreground pixels</label>
    741       <description>Number of foreground pixels</description>
    742392      <class>java.lang.String</class>
    743393      <value>\F Pixels\</value>
     
    746396      <name>propertyMapping.ch2FgSd</name>
    747397      <label>Channel 2 foreground standard deviation</label>
    748       <description>The standard deviation of the foreground intensity in channel 2</description>
    749398      <class>java.lang.String</class>
    750399      <value>\F532 SD\</value>
     
    753402      <name>propertyMapping.ch2BgSd</name>
    754403      <label>Channel 2 background standard deviation</label>
    755       <description>The standard deviation of the background intensity in channel 2</description>
    756404      <class>java.lang.String</class>
    757405      <value>\B532 SD\</value>
     406    </parameter>
     407    <parameter>
     408      <name>headerRegexp</name>
     409      <label>Header</label>
     410      <class>java.lang.String</class>
     411      <value>"(.+)=(.*)"</value>
    758412    </parameter>
    759413    <parameter>
    760414      <name>reporterIdColumnMapping</name>
    761415      <label>Reporter ID</label>
    762       <description>Mapping that picks the spot's reporter from the data columns. For example: \ID\</description>
    763416      <class>java.lang.String</class>
    764417      <value>\ID\</value>
    765     </parameter>
    766     <parameter>
    767       <name>headerRegexp</name>
    768       <label>Header</label>
    769       <description>A regular expression that matches a header line and extracts the name and a value parts. For example, split on equal symbol: (.+)=(.*)</description>
    770       <class>java.lang.String</class>
    771       <value>"(.+)=(.*)"</value>
    772418    </parameter>
    773419    <parameter>
    774420      <name>propertyMapping.ch1FgMedian</name>
    775421      <label>Channel 1 foreground median</label>
    776       <description>The median of the foreground intensity in channel 1</description>
    777422      <class>java.lang.String</class>
    778423      <value>\F635 Median\</value>
     
    781426      <name>propertyMapping.ch1BgMean</name>
    782427      <label>Channel 1 background mean</label>
    783       <description>The mean of the background intensity in channel 1</description>
    784428      <class>java.lang.String</class>
    785429      <value>\B635 Mean\</value>
     430    </parameter>
     431    <parameter>
     432      <name>propertyMapping.ch2BgMedian</name>
     433      <label>Channel 2 background median</label>
     434      <class>java.lang.String</class>
     435      <value>\B532 Median\</value>
    786436    </parameter>
    787437    <parameter>
    788438      <name>rowColumnMapping</name>
    789439      <label>Row</label>
    790       <description>Mapping that picks the spot's row in the block from the data columns. For example: \Row\</description>
    791440      <class>java.lang.String</class>
    792441      <value>\Row\</value>
    793     </parameter>
    794     <parameter>
    795       <name>propertyMapping.ch2BgMedian</name>
    796       <label>Channel 2 background median</label>
    797       <description>The median of the background intensity in channel 2</description>
    798       <class>java.lang.String</class>
    799       <value>\B532 Median\</value>
    800442    </parameter>
    801443    <parameter>
    802444      <name>propertyMapping.ch1BgMedian</name>
    803445      <label>Channel 1 background median</label>
    804       <description>The median of the background intensity in channel 1</description>
    805446      <class>java.lang.String</class>
    806447      <value>\B635 Median\</value>
     
    809450      <name>propertyMapping.ch2FgMean</name>
    810451      <label>Channel 2 foreground mean</label>
    811       <description>The mean of the foreground intensity in channel 2</description>
    812452      <class>java.lang.String</class>
    813453      <value>\F532 Mean\</value>
     
    816456      <name>propertyMapping.rgnR2</name>
    817457      <label>Rgn R2</label>
    818       <description>Rgn R2</description>
    819458      <class>java.lang.String</class>
    820459      <value>\Rgn R² (635/532)\</value>
     
    823462      <name>dataHeaderRegexp</name>
    824463      <label>Data header</label>
    825       <description>A regular expression that matches the header line just before the data begins. For example: Block\tRow\tColumn.*</description>
    826       <class>java.lang.String</class>
    827       <value>"Block"\t"Column"\t"Row"\t"Name"\t"ID".*"Ratio of Medians \(635\/532\)".*</value>
     464      <class>java.lang.String</class>
     465      <value>"Block"\t"Column"\t"Row"\t"Name"\t"ID".*"Ratio of Medians \(532\/635\)".*</value>
     466    </parameter>
     467    <parameter>
     468      <name>propertyMapping.ratiosSd</name>
     469      <label>Standard deviation of ratios</label>
     470      <class>java.lang.String</class>
     471      <value>\Ratios SD (532/635)\</value>
    828472    </parameter>
    829473    <parameter>
    830474      <name>propertyMapping.ch2FgMedian</name>
    831475      <label>Channel 2 foreground median</label>
    832       <description>The median of the foreground intensity in channel 2</description>
    833476      <class>java.lang.String</class>
    834477      <value>\F532 Median\</value>
    835     </parameter>
    836     <parameter>
    837       <name>propertyMapping.ratiosSd</name>
    838       <label>Standard deviation of ratios</label>
    839       <description>Standard deviation of the intensity ratios for all pixels</description>
    840       <class>java.lang.String</class>
    841       <value>\Ratios SD (635/532)\</value>
    842478    </parameter>
    843479    <parameter>
    844480      <name>propertyMapping.ch1PercSat</name>
    845481      <label>Percent saturated pixels</label>
    846       <description>Percentage of saturated pixels in channel 1</description>
    847482      <class>java.lang.String</class>
    848483      <value>\F635 % Sat.\</value>
     
    851486      <name>dataSplitterRegexp</name>
    852487      <label>Data splitter</label>
    853       <description>A regular expression that splits each data line into individual columns. For example, split on tabs: \t</description>
    854488      <class>java.lang.String</class>
    855489      <value>\t</value>
     
    858492      <name>columnColumnMapping</name>
    859493      <label>Column</label>
    860       <description>Mapping that picks the spot's column in the block from the data columns. For example: \Column\</description>
    861494      <class>java.lang.String</class>
    862495      <value>\Column\</value>
     
    865498      <name>propertyMapping.bgPixels</name>
    866499      <label>Background pixels</label>
    867       <description>Number of background pixels</description>
    868500      <class>java.lang.String</class>
    869501      <value>\B Pixels\</value>
     
    872504      <name>propertyMapping.ch1PercSd2</name>
    873505      <label>Percent pixels within 2 standard deviations</label>
    874       <description>Percentage of pixels within 2 standard deviations in channel 1</description>
    875506      <class>java.lang.String</class>
    876507      <value>\% &gt; B635+2SD\</value>
    877     </parameter>
    878     <parameter>
    879       <name>metaGridXColumnMapping</name>
    880       <label>MetaGridX</label>
    881       <description>Mapping that picks the spot's meta-Grid X-axis from the data columns. For example: \Meta grid X\</description>
    882       <class />
    883       <value />
    884508    </parameter>
    885509    <parameter>
    886510      <name>propertyMapping.ch1FgMean</name>
    887511      <label>Channel 1 foreground mean</label>
    888       <description>The mean of the foreground intensity in channel 1</description>
    889512      <class>java.lang.String</class>
    890513      <value>\F635 Mean\</value>
     
    893516      <name>xColumnMapping</name>
    894517      <label>X</label>
    895       <description>Mapping that picks the spot's physical X coordinate from the data columns. For example: \X\</description>
    896518      <class>java.lang.String</class>
    897519      <value>\X\</value>
    898     </parameter>
    899     <parameter>
    900       <name>metaGridYColumnMapping</name>
    901       <label>MetaGridY</label>
    902       <description>Mapping that picks the spot's meta-Grid Y-axis from the data columns. For example: \Meta grid Y\</description>
    903       <class />
    904       <value />
    905520    </parameter>
    906521    <parameter>
    907522      <name>propertyMapping.ch1BgSd</name>
    908523      <label>Channel 1 background standard deviation</label>
    909       <description>The standard deviation of the background intensity in channel 1</description>
    910524      <class>java.lang.String</class>
    911525      <value>\B635 SD\</value>
    912     </parameter>
    913     <parameter>
    914       <name>minDataColumns</name>
    915       <label>Min data columns</label>
    916       <description>The minimum number of columns for a line to be counted as a data line.</description>
    917       <class />
    918       <value />
    919526    </parameter>
    920527    <parameter>
    921528      <name>propertyMapping.rgnRatio</name>
    922529      <label>Rgn ratio</label>
    923       <description>Rgn ratio</description>
    924530      <class>java.lang.String</class>
    925531      <value>\Rgn Ratio (635/532)\</value>
    926     </parameter>
    927     <parameter>
    928       <name>ignoreRegexp</name>
    929       <label>Ignore</label>
    930       <description>A regular expression that matches any line that should be ignored. For example, ignore lines starting with #: ^#.*</description>
    931       <class />
    932       <value />
    933     </parameter>
    934     <parameter>
    935       <name>propertyMapping.CV</name>
    936       <label>CV</label>
    937       <description>CV</description>
    938       <class />
    939       <value />
    940532    </parameter>
    941533    <parameter>
    942534      <name>propertyMapping.ch1PercSd1</name>
    943535      <label>Percent pixels within 1 standard deviation</label>
    944       <description>Percentage of pixels within 1 standard deviation in channel 1</description>
    945536      <class>java.lang.String</class>
    946537      <value>\% &gt; B635+1SD\</value>
     
    949540      <name>rawDataType</name>
    950541      <label>Raw data type</label>
    951       <description>The type of raw data that this importer will import.</description>
    952542      <class>java.lang.String</class>
    953543      <value>genepix</value>
    954     </parameter>
    955     <parameter>
    956       <name>dataFooterRegexp</name>
    957       <label>Data footer</label>
    958       <description>A regular expression that matches the first line of non-data after the data lines. For example: __END_OF_DATA__</description>
    959       <class />
    960       <value />
    961544    </parameter>
    962545    <parameter>
    963546      <name>propertyMapping.ch2PercSd2</name>
    964547      <label>Percent pixels within 2 standard deviations</label>
    965       <description>Percentage of pixels within 2 standard deviations in channel 2</description>
    966548      <class>java.lang.String</class>
    967549      <value>\% &gt; B532+2SD\</value>
     
    970552      <name>blockColumnMapping</name>
    971553      <label>Block</label>
    972       <description>Mapping that picks the spot's block from the data columns. For example: \Block\</description>
    973554      <class>java.lang.String</class>
    974555      <value>\Block\</value>
     
    982563      <name>yColumnMapping</name>
    983564      <label>Y</label>
    984       <description>Mapping that picks the spot's physical Y coordinate from the data columns. For example: \Y\</description>
    985565      <class>java.lang.String</class>
    986566      <value>\Y\</value>
    987     </parameter>
    988     <parameter>
    989       <name>maxDataColumns</name>
    990       <label>Max data columns</label>
    991       <description>The maximum number of columns for a line to be counted as a data line, or 0 to allow any number of columns.</description>
    992       <class />
    993       <value />
    994567    </parameter>
    995568    <parameter>
    996569      <name>propertyMapping.ch2BgMean</name>
    997570      <label>Channel 2 background mean</label>
    998       <description>The mean of the background intensity in channel 2</description>
    999571      <class>java.lang.String</class>
    1000572      <value>\B635 Mean\</value>
     
    1003575      <name>propertyMapping.flags</name>
    1004576      <label>Flags</label>
    1005       <description>Flags</description>
    1006577      <class>java.lang.String</class>
    1007578      <value>\Flags\</value>
     
    1010581      <name>propertyMapping.mValue</name>
    1011582      <label>M value</label>
    1012       <description>M value</description>
    1013583      <class>java.lang.String</class>
    1014584      <value>\Log Ratio (532/635)\</value>
     
    1017587      <name>trimQuotes</name>
    1018588      <label>Remove quotes</label>
    1019       <description>If true quotes (" or ') around data value will be removed.</description>
    1020589      <class>java.lang.Boolean</class>
    1021590      <value>true</value>
    1022591    </parameter>
    1023592    <parameter>
    1024       <name>charset</name>
    1025       <label>Character set</label>
    1026       <description>The character set used in the file, if not specified the default character set is used (ISO-8859-1).</description>
    1027       <class>java.lang.String</class>
    1028       <value>ISO-8859-1</value>
    1029     </parameter>
    1030     <parameter>
    1031593      <name>propertyMapping.diameter</name>
    1032594      <label>Spot diameter</label>
    1033       <description>The diameter of the spot in pixels</description>
    1034595      <class>java.lang.String</class>
    1035596      <value>\Dia.\</value>
     
    1038599      <name>propertyMapping.ch2PercSat</name>
    1039600      <label>Percent saturated pixels</label>
    1040       <description>Percentage of saturated pixels in channel 2</description>
    1041601      <class>java.lang.String</class>
    1042602      <value>\F635 % Sat.\</value>
     
    1045605      <name>propertyMapping.ch1FgSd</name>
    1046606      <label>Channel 1 foreground standard deviation</label>
    1047       <description>The standard deviation of the foreground intensity in channel 1</description>
    1048607      <class>java.lang.String</class>
    1049608      <value>\F532 SD\</value>
     
    1052611      <name>propertyMapping.ch2PercSd1</name>
    1053612      <label>Percent pixels within 1 standard deviation</label>
    1054       <description>Percentage of pixels within 1 standard deviation in channel 2</description>
    1055613      <class>java.lang.String</class>
    1056614      <value>\% &gt; B635+1SD\</value>
     
    1059617      <name>propertyMapping.fgPixels</name>
    1060618      <label>Foreground pixels</label>
    1061       <description>Number of foreground pixels</description>
    1062619      <class>java.lang.String</class>
    1063620      <value>\F Pixels\</value>
     
    1066623      <name>propertyMapping.ch2FgSd</name>
    1067624      <label>Channel 2 foreground standard deviation</label>
    1068       <description>The standard deviation of the foreground intensity in channel 2</description>
    1069625      <class>java.lang.String</class>
    1070626      <value>\F635 SD\</value>
     
    1073629      <name>propertyMapping.ch2BgSd</name>
    1074630      <label>Channel 2 background standard deviation</label>
    1075       <description>The standard deviation of the background intensity in channel 2</description>
    1076631      <class>java.lang.String</class>
    1077632      <value>\B635 SD\</value>
     633    </parameter>
     634    <parameter>
     635      <name>headerRegexp</name>
     636      <label>Header</label>
     637      <class>java.lang.String</class>
     638      <value>"(.+)=(.*)"</value>
    1078639    </parameter>
    1079640    <parameter>
    1080641      <name>reporterIdColumnMapping</name>
    1081642      <label>Reporter ID</label>
    1082       <description>Mapping that picks the spot's reporter from the data columns. For example: \ID\</description>
    1083643      <class>java.lang.String</class>
    1084644      <value>\ID\</value>
    1085     </parameter>
    1086     <parameter>
    1087       <name>headerRegexp</name>
    1088       <label>Header</label>
    1089       <description>A regular expression that matches a header line and extracts the name and a value parts. For example, split on equal symbol: (.+)=(.*)</description>
    1090       <class>java.lang.String</class>
    1091       <value>"(.+)=(.*)"</value>
    1092645    </parameter>
    1093646    <parameter>
    1094647      <name>propertyMapping.ch1FgMedian</name>
    1095648      <label>Channel 1 foreground median</label>
    1096       <description>The median of the foreground intensity in channel 1</description>
    1097649      <class>java.lang.String</class>
    1098650      <value>\F532 Median\</value>
     
    1101653      <name>propertyMapping.ch1BgMean</name>
    1102654      <label>Channel 1 background mean</label>
    1103       <description>The mean of the background intensity in channel 1</description>
    1104655      <class>java.lang.String</class>
    1105656      <value>\B532 Mean\</value>
     
    1108659      <name>propertyMapping.ch2BgMedian</name>
    1109660      <label>Channel 2 background median</label>
    1110       <description>The median of the background intensity in channel 2</description>
    1111661      <class>java.lang.String</class>
    1112662      <value>\B635 Median\</value>
     
    1115665      <name>rowColumnMapping</name>
    1116666      <label>Row</label>
    1117       <description>Mapping that picks the spot's row in the block from the data columns. For example: \Row\</description>
    1118667      <class>java.lang.String</class>
    1119668      <value>\Row\</value>
     
    1122671      <name>propertyMapping.ch1BgMedian</name>
    1123672      <label>Channel 1 background median</label>
    1124       <description>The median of the background intensity in channel 1</description>
    1125673      <class>java.lang.String</class>
    1126674      <value>\B532 Median\</value>
     
    1129677      <name>propertyMapping.ch2FgMean</name>
    1130678      <label>Channel 2 foreground mean</label>
    1131       <description>The mean of the foreground intensity in channel 2</description>
    1132679      <class>java.lang.String</class>
    1133680      <value>\F635 Mean\</value>
     
    1136683      <name>propertyMapping.rgnR2</name>
    1137684      <label>Rgn R2</label>
    1138       <description>Rgn R2</description>
    1139685      <class>java.lang.String</class>
    1140686      <value>\Rgn R² (532/635)\</value>
     687    </parameter>
     688    <parameter>
     689      <name>dataHeaderRegexp</name>
     690      <label>Data header</label>
     691      <class>java.lang.String</class>
     692      <value>"Block"\t"Column"\t"Row"\t"Name"\t"ID".*"Ratio of Medians \(635\/532\)".*</value>
     693    </parameter>
     694    <parameter>
     695      <name>propertyMapping.ratiosSd</name>
     696      <label>Standard deviation of ratios</label>
     697      <class>java.lang.String</class>
     698      <value>\Ratios SD (532/635)\</value>
    1141699    </parameter>
    1142700    <parameter>
    1143701      <name>propertyMapping.ch2FgMedian</name>
    1144702      <label>Channel 2 foreground median</label>
    1145       <description>The median of the foreground intensity in channel 2</description>
    1146703      <class>java.lang.String</class>
    1147704      <value>\F635 Median\</value>
    1148     </parameter>
    1149     <parameter>
    1150       <name>dataHeaderRegexp</name>
    1151       <label>Data header</label>
    1152       <description>A regular expression that matches the header line just before the data begins. For example: Block\tRow\tColumn.*</description>
    1153       <class>java.lang.String</class>
    1154       <value>"Block"\t"Column"\t"Row"\t"Name"\t"ID".*"Ratio of Medians \(532\/635\)".*</value>
    1155     </parameter>
    1156     <parameter>
    1157       <name>propertyMapping.ratiosSd</name>
    1158       <label>Standard deviation of ratios</label>
    1159       <description>Standard deviation of the intensity ratios for all pixels</description>
    1160       <class>java.lang.String</class>
    1161       <value>\Ratios SD (532/635)\</value>
    1162705    </parameter>
    1163706    <parameter>
    1164707      <name>propertyMapping.ch1PercSat</name>
    1165708      <label>Percent saturated pixels</label>
    1166       <description>Percentage of saturated pixels in channel 1</description>
    1167709      <class>java.lang.String</class>
    1168710      <value>\F532 % Sat.\</value>
     
    1171713      <name>dataSplitterRegexp</name>
    1172714      <label>Data splitter</label>
    1173       <description>A regular expression that splits each data line into individual columns. For example, split on tabs: \t</description>
    1174715      <class>java.lang.String</class>
    1175716      <value>\t</value>
     
    1178719      <name>columnColumnMapping</name>
    1179720      <label>Column</label>
    1180       <description>Mapping that picks the spot's column in the block from the data columns. For example: \Column\</description>
    1181721      <class>java.lang.String</class>
    1182722      <value>\Column\</value>
     
    1185725      <name>propertyMapping.bgPixels</name>
    1186726      <label>Background pixels</label>
    1187       <description>Number of background pixels</description>
    1188727      <class>java.lang.String</class>
    1189728      <value>\B Pixels\</value>
     
    1192731      <name>propertyMapping.ch1PercSd2</name>
    1193732      <label>Percent pixels within 2 standard deviations</label>
    1194       <description>Percentage of pixels within 2 standard deviations in channel 1</description>
    1195733      <class>java.lang.String</class>
    1196734      <value>\% &gt; B532+2SD\</value>
    1197     </parameter>
    1198     <parameter>
    1199       <name>metaGridXColumnMapping</name>
    1200       <label>MetaGridX</label>
    1201       <description>Mapping that picks the spot's meta-Grid X-axis from the data columns. For example: \Meta grid X\</description>
    1202       <class />
    1203       <value />
    1204735    </parameter>
    1205736    <parameter>
    1206737      <name>propertyMapping.ch1FgMean</name>
    1207738      <label>Channel 1 foreground mean</label>
    1208       <description>The mean of the foreground intensity in channel 1</description>
    1209739      <class>java.lang.String</class>
    1210740      <value>\F532 Mean\</value>
     
    1213743      <name>xColumnMapping</name>
    1214744      <label>X</label>
    1215       <description>Mapping that picks the spot's physical X coordinate from the data columns. For example: \X\</description>
    1216745      <class>java.lang.String</class>
    1217746      <value>\X\</value>
    1218     </parameter>
    1219     <parameter>
    1220       <name>metaGridYColumnMapping</name>
    1221       <label>MetaGridY</label>
    1222       <description>Mapping that picks the spot's meta-Grid Y-axis from the data columns. For example: \Meta grid Y\</description>
    1223       <class />
    1224       <value />
    1225747    </parameter>
    1226748    <parameter>
    1227749      <name>propertyMapping.ch1BgSd</name>
    1228750      <label>Channel 1 background standard deviation</label>
    1229       <description>The standard deviation of the background intensity in channel 1</description>
    1230751      <class>java.lang.String</class>
    1231752      <value>\B532 SD\</value>
    1232     </parameter>
    1233     <parameter>
    1234       <name>minDataColumns</name>
    1235       <label>Min data columns</label>
    1236       <description>The minimum number of columns for a line to be counted as a data line.</description>
    1237       <class />
    1238       <value />
    1239753    </parameter>
    1240754    <parameter>
    1241755      <name>propertyMapping.rgnRatio</name>
    1242756      <label>Rgn ratio</label>
    1243       <description>Rgn ratio</description>
    1244757      <class>java.lang.String</class>
    1245758      <value>\Rgn Ratio (532/635)\</value>
    1246     </parameter>
    1247     <parameter>
    1248       <name>ignoreRegexp</name>
    1249       <label>Ignore</label>
    1250       <description>A regular expression that matches any line that should be ignored. For example, ignore lines starting with #: ^#.*</description>
    1251       <class />
    1252       <value />
    1253759    </parameter>
    1254760    <parameter>
    1255761      <name>propertyMapping.ch1PercSd1</name>
    1256762      <label>Percent pixels within 1 standard deviation</label>
    1257       <description>Percentage of pixels within 1 standard deviation in channel 1</description>
    1258763      <class>java.lang.String</class>
    1259764      <value>\% &gt; B532+1SD\</value>
    1260     </parameter>
    1261     <parameter>
    1262       <name>propertyMapping.CV</name>
    1263       <label>CV</label>
    1264       <description>CV</description>
    1265       <class />
    1266       <value />
    1267765    </parameter>
    1268766    <parameter>
    1269767      <name>rawDataType</name>
    1270768      <label>Raw data type</label>
    1271       <description>The type of raw data that this importer will import.</description>
    1272769      <class>java.lang.String</class>
    1273770      <value>genepix</value>
    1274     </parameter>
    1275     <parameter>
    1276       <name>dataFooterRegexp</name>
    1277       <label>Data footer</label>
    1278       <description>A regular expression that matches the first line of non-data after the data lines. For example: __END_OF_DATA__</description>
    1279       <class />
    1280       <value />
    1281771    </parameter>
    1282772    <parameter>
    1283773      <name>propertyMapping.ch2PercSd2</name>
    1284774      <label>Percent pixels within 2 standard deviations</label>
    1285       <description>Percentage of pixels within 2 standard deviations in channel 2</description>
    1286775      <class>java.lang.String</class>
    1287776      <value>\% &gt; B635+2SD\</value>
     
    1290779      <name>blockColumnMapping</name>
    1291780      <label>Block</label>
    1292       <description>Mapping that picks the spot's block from the data columns. For example: \Block\</description>
    1293781      <class>java.lang.String</class>
    1294782      <value>\Block\</value>
     
    1299787    <description>This configuration is for the Plate importer plugin when to import 96-well plates.</description>
    1300788    <parameter>
    1301       <name>maxDataColumns</name>
    1302       <label>Max data columns</label>
    1303       <description>The maximum number of columns for a line to be counted as a data line, or 0 to allow any number of columns.</description>
    1304       <class />
    1305       <value />
     789      <name>nameColumnMapping</name>
     790      <label>Plate number/name</label>
     791      <class>java.lang.String</class>
     792      <value>\96_number\</value>
    1306793    </parameter>
    1307794    <parameter>
    1308795      <name>reporterColumnMapping</name>
    1309796      <label>Reporter ID</label>
    1310       <description>Mapping that picks the well's reporter id from the data columns. For example: \ID\</description>
    1311797      <class>java.lang.String</class>
    1312798      <value>\oligo_id\</value>
     
    1315801      <name>dataHeaderRegexp</name>
    1316802      <label>Data header</label>
    1317       <description>A regular expression that matches the header line just before the data begins. For example: Block\tRow\tColumn.*</description>
    1318803      <class>java.lang.String</class>
    1319804      <value>96_number\t96_column\t96_row\t96_position\toligo_id.*</value>
    1320     </parameter>
    1321     <parameter>
    1322       <name>barcodeColumnMapping</name>
    1323       <label>Plate barcode</label>
    1324       <description>Mapping that picks the plate barcode from the data columns. For example: \Barcode\</description>
    1325       <class />
    1326       <value />
    1327805    </parameter>
    1328806    <parameter>
    1329807      <name>trimQuotes</name>
    1330808      <label>Remove quotes</label>
    1331       <description>If true quotes (" or ') around data value will be removed.</description>
    1332809      <class>java.lang.Boolean</class>
    1333810      <value>true</value>
     
    1336813      <name>dataSplitterRegexp</name>
    1337814      <label>Data splitter</label>
    1338       <description>A regular expression that splits each data line into individual columns. For example, split on tabs: \t</description>
    1339815      <class>java.lang.String</class>
    1340816      <value>\t</value>
    1341     </parameter>
    1342     <parameter>
    1343       <name>charset</name>
    1344       <label>Character set</label>
    1345       <description>The character set used in the file, if not specified the default character set is used (ISO-8859-1).</description>
    1346       <class>java.lang.String</class>
    1347       <value>ISO-8859-1</value>
    1348817    </parameter>
    1349818    <parameter>
    1350819      <name>columnColumnMapping</name>
    1351820      <label>Column</label>
    1352       <description>Mapping that picks the well's column in the plate from the data columns. For example: \Column\</description>
    1353821      <class>java.lang.String</class>
    1354822      <value>\96_column\</value>
    1355     </parameter>
    1356     <parameter>
    1357       <name>nameColumnMapping</name>
    1358       <label>Plate number/name</label>
    1359       <description>Mapping that picks the plate name from the data columns. For example: \Plate\</description>
    1360       <class>java.lang.String</class>
    1361       <value>\96_number\</value>
    1362     </parameter>
    1363     <parameter>
    1364       <name>minDataColumns</name>
    1365       <label>Min data columns</label>
    1366       <description>The minimum number of columns for a line to be counted as a data line.</description>
    1367       <class />
    1368       <value />
    1369     </parameter>
    1370     <parameter>
    1371       <name>ignoreRegexp</name>
    1372       <label>Ignore</label>
    1373       <description>A regular expression that matches any line that should be ignored. For example, ignore lines starting with #: ^#.*</description>
    1374       <class />
    1375       <value />
    1376     </parameter>
    1377     <parameter>
    1378       <name>dataFooterRegexp</name>
    1379       <label>Data footer</label>
    1380       <description>A regular expression that matches the first line of non-data after the data lines. For example: __END_OF_DATA__</description>
    1381       <class />
    1382       <value />
    1383     </parameter>
    1384     <parameter>
    1385       <name>headerRegexp</name>
    1386       <label>Header</label>
    1387       <description>A regular expression that matches a header line and extracts the name and a value parts. For example, split on equal symbol: (.+)=(.*)</description>
    1388       <class />
    1389       <value />
    1390823    </parameter>
    1391824    <parameter>
    1392825      <name>rowColumnMapping</name>
    1393826      <label>Row</label>
    1394       <description>Mapping that picks the well's row in the plate from the data columns. For example: \Row\</description>
    1395827      <class>java.lang.String</class>
    1396828      <value>\96_row\</value>
     
    1401833    <description>This configuration is for importing reporters from the same text file as 96well plates are imported from.</description>
    1402834    <parameter>
    1403       <name>maxDataColumns</name>
    1404       <label>Max data columns</label>
    1405       <description>The maximum number of columns for a line to be counted as a data line, or 0 to allow any number of columns.</description>
    1406       <class />
    1407       <value />
    1408     </parameter>
    1409     <parameter>
    1410       <name>extendedColumnMapping.locusLink</name>
    1411       <label>LocusLink</label>
    1412       <description />
    1413       <class />
    1414       <value />
     835      <name>nameColumnMapping</name>
     836      <label>Name</label>
     837      <class>java.lang.String</class>
     838      <value>\oligo_id\</value>
     839    </parameter>
     840    <parameter>
     841      <name>dataHeaderRegexp</name>
     842      <label>Data header</label>
     843      <class>java.lang.String</class>
     844      <value>96_number\t96_column\t96_row\t96_position\toligo_id.*</value>
    1415845    </parameter>
    1416846    <parameter>
    1417847      <name>trimQuotes</name>
    1418848      <label>Remove quotes</label>
    1419       <description>If true quotes (" or ') around data value will be removed.</description>
    1420849      <class>java.lang.Boolean</class>
    1421850      <value>true</value>
    1422851    </parameter>
    1423852    <parameter>
    1424       <name>charset</name>
    1425       <label>Character set</label>
    1426       <description>The character set used in the file, if not specified the default character set is used (ISO-8859-1).</description>
    1427       <class>java.lang.String</class>
    1428       <value>ISO-8859-1</value>
    1429     </parameter>
    1430     <parameter>
    1431       <name>scoreColumnMapping</name>
    1432       <label>Score</label>
    1433       <description>Mapping that picks the reporter's score in some context. This mapping is only used when importing to a reporter list.</description>
    1434       <class />
    1435       <value />
    1436     </parameter>
    1437     <parameter>
    1438       <name>nameColumnMapping</name>
    1439       <label>Name</label>
    1440       <description>Mapping that picks the reporter's name from the data columns. For example: \Name\</description>
    1441       <class>java.lang.String</class>
    1442       <value>\oligo_id\</value>
    1443     </parameter>
    1444     <parameter>
    1445       <name>extendedColumnMapping.markers</name>
    1446       <label>Markers</label>
    1447       <description />
    1448       <class />
    1449       <value />
    1450     </parameter>
    1451     <parameter>
    1452       <name>extendedColumnMapping.vector</name>
    1453       <label>Vector</label>
    1454       <description>The vector from which the reporter is derived</description>
    1455       <class />
    1456       <value />
    1457     </parameter>
    1458     <parameter>
    1459       <name>extendedColumnMapping.nid</name>
    1460       <label>NID</label>
    1461       <description />
    1462       <class />
    1463       <value />
     853      <name>dataSplitterRegexp</name>
     854      <label>Data splitter</label>
     855      <class>java.lang.String</class>
     856      <value>\t</value>
    1464857    </parameter>
    1465858    <parameter>
    1466859      <name>descriptionColumnMapping</name>
    1467860      <label>Description</label>
    1468       <description>Mapping that picks the reporter's description from the data columns. For example: \Description\</description>
    1469861      <class>java.lang.String</class>
    1470862      <value>\description_Ensembl*\</value>
    1471863    </parameter>
    1472864    <parameter>
    1473       <name>headerRegexp</name>
    1474       <label>Header</label>
    1475       <description>A regular expression that matches a header line and extracts the name and a value parts. For example, split on equal symbol: (.+)=(.*)</description>
    1476       <class />
    1477       <value />
     865      <name>symbolColumnMapping</name>
     866      <label>Gene symbol</label>
     867      <class>java.lang.String</class>
     868      <value>\gene_symbol_Ensembl*\</value>
    1478869    </parameter>
    1479870    <parameter>
    1480871      <name>reporterIdColumnMapping</name>
    1481872      <label>Reporter ID</label>
    1482       <description>Mapping that picks the reporter's ID from the data columns. For example: \ID\</description>
    1483873      <class>java.lang.String</class>
    1484874      <value>\oligo_id\</value>
    1485     </parameter>
    1486     <parameter>
    1487       <name>symbolColumnMapping</name>
    1488       <label>Gene symbol</label>
    1489       <description>Mapping that picks the reporter's gene symbol from the data columns. For example: \Gene symbol\</description>
    1490       <class>java.lang.String</class>
    1491       <value>\gene_symbol_Ensembl*\</value>
    1492     </parameter>
    1493     <parameter>
    1494       <name>extendedColumnMapping.antibiotics</name>
    1495       <label>Antibiotics</label>
    1496       <description />
    1497       <class />
    1498       <value />
    1499     </parameter>
    1500     <parameter>
    1501       <name>extendedColumnMapping.omim</name>
    1502       <label>OMIM</label>
    1503       <description />
    1504       <class />
    1505       <value />
    1506     </parameter>
    1507     <parameter>
    1508       <name>extendedColumnMapping.chromosome</name>
    1509       <label>Chromosome</label>
    1510       <description>The chromosome from which the reporter is derived</description>
    1511       <class />
    1512       <value />
    1513     </parameter>
    1514     <parameter>
    1515       <name>reporterType</name>
    1516       <label>Reporter type</label>
    1517       <description>The reporter type assigned to the imported reporters</description>
    1518       <class />
    1519       <value />
    1520     </parameter>
    1521     <parameter>
    1522       <name>dataHeaderRegexp</name>
    1523       <label>Data header</label>
    1524       <description>A regular expression that matches the header line just before the data begins. For example: Block\tRow\tColumn.*</description>
    1525       <class>java.lang.String</class>
    1526       <value>96_number\t96_column\t96_row\t96_position\toligo_id.*</value>
    1527     </parameter>
    1528     <parameter>
    1529       <name>dataSplitterRegexp</name>
    1530       <label>Data splitter</label>
    1531       <description>A regular expression that splits each data line into individual columns. For example, split on tabs: \t</description>
    1532       <class>java.lang.String</class>
    1533       <value>\t</value>
    1534     </parameter>
    1535     <parameter>
    1536       <name>extendedColumnMapping.length</name>
    1537       <label>Length</label>
    1538       <description>The length of the sequence</description>
    1539       <class />
    1540       <value />
    1541     </parameter>
    1542     <parameter>
    1543       <name>extendedColumnMapping.tissue</name>
    1544       <label>Tissue</label>
    1545       <description>The tissue from which the reporter is derived</description>
    1546       <class />
    1547       <value />
    1548     </parameter>
    1549     <parameter>
    1550       <name>extendedColumnMapping.accession</name>
    1551       <label>Accession</label>
    1552       <description />
    1553       <class />
    1554       <value />
    1555     </parameter>
    1556     <parameter>
    1557       <name>minDataColumns</name>
    1558       <label>Min data columns</label>
    1559       <description>The minimum number of columns for a line to be counted as a data line.</description>
    1560       <class />
    1561       <value />
    1562     </parameter>
    1563     <parameter>
    1564       <name>ignoreRegexp</name>
    1565       <label>Ignore</label>
    1566       <description>A regular expression that matches any line that should be ignored. For example, ignore lines starting with #: ^#.*</description>
    1567       <class />
    1568       <value />
    1569     </parameter>
    1570     <parameter>
    1571       <name>reporterTypeColumnMapping</name>
    1572       <label>Reporter type</label>
    1573       <description>Mapping that pick the reporter's type from the data columns. This will overide the reporter type parameter. For example: \Reporter type\</description>
    1574       <class />
    1575       <value />
    1576     </parameter>
    1577     <parameter>
    1578       <name>extendedColumnMapping.library</name>
    1579       <label>Library</label>
    1580       <description>The library from which the reporter is derived</description>
    1581       <class />
    1582       <value />
    1583     </parameter>
    1584     <parameter>
    1585       <name>extendedColumnMapping.clusterId</name>
    1586       <label>Cluster ID</label>
    1587       <description>A unique identifier for a Unigene entry</description>
    1588       <class />
    1589       <value />
    1590     </parameter>
    1591     <parameter>
    1592       <name>dataFooterRegexp</name>
    1593       <label>Data footer</label>
    1594       <description>A regular expression that matches the first line of non-data after the data lines. For example: __END_OF_DATA__</description>
    1595       <class />
    1596       <value />
    1597     </parameter>
    1598     <parameter>
    1599       <name>extendedColumnMapping.cytoband</name>
    1600       <label>Cytoband</label>
    1601       <description>The cytoband from which the reporter is derived</description>
    1602       <class />
    1603       <value />
    1604875    </parameter>
    1605876    <parameter>
    1606877      <name>extendedColumnMapping.sequence</name>
    1607878      <label>Sequence</label>
    1608       <description>The nucleotide sequence of the reporter</description>
    1609879      <class>java.lang.String</class>
    1610880      <value>\oligo_sequence\</value>
    1611     </parameter>
    1612     <parameter>
    1613       <name>extendedColumnMapping.species</name>
    1614       <label>Species</label>
    1615       <description>The organism from which the reporter is derived</description>
    1616       <class />
    1617       <value />
    1618881    </parameter>
    1619882  </configuration>
  • trunk/doc/installation.html

    r2970 r2992  
    2828
    2929<head>
    30 <title>BASE 2.0 installation instructions</title>
     30<title>BASE 2 installation instructions</title>
    3131<link rel=stylesheet type="text/css" href="styles.css">
    3232</head>
     
    401401</ol>
    402402
    403 <h2><a name=upgrade>Upgrade of running BASE 2.0 installation</a></h2>
     403<h2><a name=upgrade>Upgrade of running BASE 2 installation</a></h2>
    404404
    405405<p>
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/AnnotationTypeTransfer.java

    r2614 r2992  
    8989    {
    9090      case 'i':
     91      {
    9192        annotationType = AnnotationType.getNew(b2c, Type.INT);
    92         annotationType.setWidth(rs.getInt(10));
     93        int width = rs.getInt(10);
     94        if (width > 0) annotationType.setWidth(width);
    9395        break;
     96      }
    9497      case 'f':
     98      {
    9599        annotationType = AnnotationType.getNew(b2c, Type.FLOAT);
    96         annotationType.setWidth(rs.getInt(10));
     100        int width = rs.getInt(10);
     101        if (width > 0) annotationType.setWidth(width);
    97102        break;
     103      }
    98104      case 't':
     105      {
    99106        annotationType = AnnotationType.getNew(b2c, Type.TEXT);
    100         annotationType.setWidth(rs.getInt(10));
     107        int width = rs.getInt(10);
     108        if (width > 0) annotationType.setWidth(width);
    101109        break;
     110      }
    102111      case 'e':
     112      {
    103113        annotationType = AnnotationType.getNew(b2c, Type.STRING);
    104114        annotationType.setEnumeration(true);
     
    107117        annotationType.setDisplayAsList(true);
    108118        break;
     119      }
    109120      default:
    110121        stop("start", "Unknown AnnotationType");
    111122    }
    112123    setCommonItemData(b2c, (CommonItem) annotationType, rs);
    113     annotationType.setDefaultValue(rs.getString(11));
     124    String defaultValue = rs.getString(11);
     125    if (defaultValue != null && defaultValue.length() > AnnotationType.MAX_DEFAULT_VALUE_LENGTH)
     126    {
     127      defaultValue = defaultValue.substring(0, AnnotationType.MAX_DEFAULT_VALUE_LENGTH);
     128    }
     129    annotationType.setDefaultValue(defaultValue);
    114130    annotationType.enableForItem(Item.SAMPLE);
    115131    return annotationType;
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ArrayBlockTransfer.java

    r2981 r2992  
    8383  {
    8484    startProgress(getInt("countFeatures"));
    85     DbControl dc = newDbControl();
     85    DbControl dc = null;
    8686    for (Map.Entry<Integer, Integer> entry : arrayTypeT.getIdMap().entrySet())
    8787    {
    8888      cleanUpMemory();
     89      dc = newDbControl();
    8990      Integer base2Id = entry.getValue();
    9091      Integer base1Id = entry.getKey();
     
    118119        log("start", "arrayDesignId is " + base2Id);
    119120      }
    120     }
    121     commit(dc);
     121      commit(dc);
     122    }
    122123    done();
    123124  }
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/Migrater.java

    r2870 r2992  
    169169      startTransfer(imageFT, "Image");
    170170      RawBioAssayTransfer rawBioAssayT = new RawBioAssayTransfer(userT,
    171           groupT, scanT, arrayTypeT, uploadFT, softwareT);
     171          groupT, scanT, arrayTypeT, uploadFT, softwareT, sampleT);
    172172      startTransfer(rawBioAssayT, "RawBioAssay");
    173173      RawBioAssayDataTransfer rawBioAssayDataT = new RawBioAssayDataTransfer(
     
    238238    String user = getProperty("db1.user");
    239239    String password = getProperty("db1.password");
    240     String url = getProperty("db1.url");
     240    String url = getProperty("db1.url") + "&autoReconnect=true";
    241241    String driver = getProperty("db1.driver");
    242242    try
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/RawBioAssayDataTransfer.java

    r2863 r2992  
    138138     */
    139139    cleanUpMemory();
    140     PreparedStatement ps = QUICK_TRANSFER ? prepareStatementFromFile("selectMinimumRawBioAssayData")
    141         : prepareStatementFromFile("selectRawBioAssayData");
    142     try
    143     {
    144       ps.setInt(1, rawBioAssayId);
     140
    145141      RawDataBatcher batcher = rawBioAssay.getRawDataBatcher();
    146142      batcher.setBatchSize(getBatchSize());
    147       runRawBioAssay(ps, 0, getBatchSize(), batcher, hasArrayDesign);
     143      runRawBioAssay(rawBioAssay, batcher, hasArrayDesign, rawBioAssayId);
    148144      batcher.flush();
    149145      batcher.close();
    150     }
    151     catch (SQLException e)
    152     {
    153       stop("transferRawBioAssayData", e);
    154     }
    155146  }
    156147
     
    159150  values from and size.
    160151 
    161   @param ps <code>PreparedStatement</code> which includes a "LIMIT ?,?"
    162          at the end.
    163   @param from <code>int</code> indicating start position of the
    164          ResultSet.
    165   @param size <code>int</code> indicating number of rows to include.
     152  @param ps <code>PreparedStatement</code>
    166153  @param batcher RawDataBatcher used in this transfer.
    167154  @param hasArrayDesign (Currently not used)
    168155  @see Transfer#prepareStatementFromFile(String)
    169156   */
    170   protected void runRawBioAssay(PreparedStatement ps, int from, int size,
    171       RawDataBatcher batcher, boolean hasArrayDesign)
     157  protected void runRawBioAssay(RawBioAssay rawBioAssay, 
     158      RawDataBatcher batcher, boolean hasArrayDesign, int base1RawBioAssayId)
    172159  {
    173160    try
    174161    {
    175162      int rowCount = 0;
    176       ps.setInt(2, from);
    177       ps.setInt(3, size);
    178       ResultSet rs = ps.executeQuery();
     163      ResultSet rs = null;
     164      Throwable t = null;
     165      int numTries = 0;
     166      // Fix for unstable BASE 1 server that is randomly losing the connection
     167      // For this to work the connection must be created with autoReconnect=true
     168      while (rs == null && numTries < 2)
     169      {
     170        numTries++;
     171        try
     172        {
     173          PreparedStatement ps = QUICK_TRANSFER ? prepareStatementFromFile("selectMinimumRawBioAssayData")
     174            : prepareStatementFromFile("selectRawBioAssayData");
     175          ps.setInt(1, base1RawBioAssayId);
     176          rs = ps.executeQuery();
     177          t = null;
     178        }
     179        catch (Throwable t2)
     180        {
     181          t = t2;
     182          log("Exception when loading BASE 1 data for raw bioassay: " + rawBioAssay, t2);
     183          try
     184          {
     185            Thread.sleep(2000);
     186          }
     187          catch (InterruptedException ex)
     188          {}
     189        }
     190      }
     191      if (rs == null || t != null) throw new BaseException(t);
    179192      DbControl dc = batcher.getDbControl();
    180193      while (rs.next())
     
    183196        RawData rd = batcher.newRawData();
    184197        rd.setReporter(reporterT.getReporterById(dc, rs.getInt(2)));
    185         // This is not verified, do block, row and col numbers start at
    186         // 0 or 1?
    187198        rd.setBlock(rs.getInt(3));
    188199        rd.setColumn(rs.getInt(4));
    189200        rd.setRow(rs.getInt(5));
     201        rd.setX(rs.getFloat(6));
     202        rd.setY(rs.getFloat(7));
    190203        if (!QUICK_TRANSFER)
    191204        {
     
    213226        progress.increase();
    214227      }
    215       if (rowCount == size)
    216       {
    217         // Fetch next batch
    218         runRawBioAssay(ps, from + size, size, batcher, hasArrayDesign);
    219       }
    220228    }
    221229    catch (SQLException e)
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/RawBioAssayTransfer.java

    r2690 r2992  
    2929import net.sf.basedb.core.RawBioAssay;
    3030import net.sf.basedb.core.RawDataTypes;
     31import net.sf.basedb.core.Sample;
    3132import net.sf.basedb.core.Scan;
     33
     34import java.sql.PreparedStatement;
    3235import java.sql.ResultSet;
    3336import java.sql.SQLException;
     
    4750  private UploadFileTransfer uploadFT = null;
    4851  private SoftwareTransfer softwareT = null;
     52  private SampleTransfer sampleT = null;
    4953
    5054  /**
     
    5660  RawBioAssayTransfer(UserTransfer userT, GroupTransfer groupT,
    5761      ScanTransfer scanT, ArrayTypeTransfer arrayTypeT,
    58       UploadFileTransfer uploadFT, SoftwareTransfer softwareT)
     62      UploadFileTransfer uploadFT, SoftwareTransfer softwareT, SampleTransfer sampleT)
    5963  {
    6064    super(userT, groupT);
     
    6670      this.arrayTypeT = arrayTypeT;
    6771      this.softwareT = softwareT;
     72      this.sampleT = sampleT;
    6873    }
    6974    else
     
    120125      parseFileHeader(rawBioAssay, fileHeader);
    121126    }
     127   
     128    // Inherit annotations from sample
     129    if (sampleT.isDone())
     130    {
     131      PreparedStatement ps = prepareStatementFromFile("getCh1SampleForRawBioAssay");
     132      ps.setInt(1, rs.getInt(1));
     133      ResultSet ss = ps.executeQuery();
     134      if (ss.next())
     135      {
     136        int base1SampleId = ss.getInt(1);
     137        if (base1SampleId != 0)
     138        {
     139          Sample s = sampleT.getSampleById(dc, base1SampleId);
     140          if (s.isAnnotated())
     141          {
     142            rawBioAssay.getAnnotationSet().inheritAnnotationSet(s.getAnnotationSet());
     143          }
     144        }
     145      }
     146      ss.close();
     147    }
     148   
    122149    return rawBioAssay;
    123150  }
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/UploadFileTransfer.java

    r2693 r2992  
    9999    imageFileMap = new HashMap<Integer, Integer>();
    100100    rawBioAssayFileMap = new HashMap<Integer, Integer>();
     101    if (!new java.io.File(path).exists())
     102    {
     103      String message = "Path for BASE 1 user files not found: " + path;
     104      if (!QUICK_TRANSFER)
     105      {
     106        log(message);
     107      }
     108      else
     109      {
     110        stop("UploadFileTransefer", message);
     111      }
     112    }
    101113  }
    102114
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Page.java

    r2304 r2992  
    2424package net.sf.basedb.clients.web.taglib;
    2525
     26import net.sf.basedb.core.Application;
    2627import net.sf.basedb.core.SessionControl;
    2728import net.sf.basedb.clients.web.Base;
     
    146147  */
    147148  private static String SERVER_NAME = null;
    148  
     149
    149150  /**
    150151    The path to the root directory of this webserver.
     
    155156    The version of BASE.
    156157  */
    157   private static final String BASE_VERSION = "BASE 2.0";
    158  
     158  private static String BASE_VERSION = null;
     159
    159160  /**
    160161    The SessionControl object in use for this request.
     
    217218  public String getServerName()
    218219  {
     220    if (SERVER_NAME == null) SERVER_NAME = Application.getHostName();
    219221    return SERVER_NAME;
    220222  }
    221223  public String getBaseVersion()
    222224  {
     225    if (BASE_VERSION == null)
     226    {
     227      BASE_VERSION = "BASE " + Application.getMajorVersion() + "." +
     228        Application.getMinorVersion() + "." +
     229        Application.getMaintenanceVersion();
     230    }
    223231    return BASE_VERSION;
    224232  }
     
    232240  {
    233241    super.setPageContext(pageContext);
    234     if (SERVER_NAME == null) SERVER_NAME = pageContext.getRequest().getServerName();
    235242    if (ROOT == null) ROOT = ((HttpServletRequest)pageContext.getRequest()).getContextPath()+"/";
    236243    try
  • trunk/src/core/net/sf/basedb/core/Annotation.java

    r2942 r2992  
    161161    super.initPermissions(granted, denied);
    162162  }
     163  PluginPermission getPluginPermissions()
     164  {
     165    return PluginPermission.NO_PLUGIN;
     166  }
    163167  // -------------------------------------------
    164168
  • trunk/src/core/net/sf/basedb/core/AnnotationSet.java

    r2967 r2992  
    200200    }
    201201    super.initPermissions(granted, denied);
     202  }
     203  PluginPermission getPluginPermissions()
     204  {
     205    return PluginPermission.NO_PLUGIN;
    202206  }
    203207  // -------------------------------------------
  • trunk/src/core/net/sf/basedb/core/Application.java

    r2960 r2992  
    164164    return Version.getMinor();
    165165  }
    166   /**
    167     Get the maintentance version.
     166
     167 
     168  /**
     169    Get the BASE version string. It is created by combining
     170    the major, minor, maintenance, build and schema versions.
    168171  */
    169172  public static String getMaintenanceVersion()
  • trunk/src/core/net/sf/basedb/core/BooleanParameterType.java

    r2304 r2992  
    2525
    2626import net.sf.basedb.core.data.BooleanParameterValueData;
     27import net.sf.basedb.util.Enumeration;
    2728
    2829/**
     
    5152  {
    5253    super(Boolean.class, defaultValue, notNull);
     54  }
     55
     56  public BooleanParameterType(Boolean defaultValue, boolean notNull, int multiplicity, Enumeration<Boolean, String> items)
     57  {
     58    super(Boolean.class, defaultValue, notNull, multiplicity, 0, 0, items);
    5359  }
    5460
  • trunk/src/core/net/sf/basedb/core/Config.java

    r2782 r2992  
    169169      ) ? false : true;
    170170  }
     171 
     172  /**
     173    Get the default character set to use when no other has been
     174    specified. It reads the setting from the <code>defaultCharset</code>
     175    setting and uses <code>ISO-8859-1</code> if not specified.
     176    @return The name of the default charset to use
     177    @since 2.1.1
     178  */
     179  public static String getCharset()
     180  {
     181    return config.getProperty("defaultCharset", "ISO-8859-1");
     182  }
     183
    171184
    172185}
  • trunk/src/core/net/sf/basedb/core/PluginParameter.java

    r2673 r2992  
    6161
    6262  /**
    63     A defaule value that overrides the default set by
     63    A default value that overrides the default set by
    6464    the parameter type.
    6565  */
  • trunk/src/core/net/sf/basedb/core/dbengine/TableInfo.java

    r2209 r2992  
    9595    while (sqlColumns.next())
    9696    {
    97       String name = sqlColumns.getString("COLUMN_NAME");
     97      String name = makeSafe(sqlColumns.getString("COLUMN_NAME"));
    9898      String type = sqlColumns.getString("TYPE_NAME");
    9999      int size = sqlColumns.getInt("COLUMN_SIZE");
     
    108108    while (sqlPK.next())
    109109    {
    110       if (pkName == null) pkName = sqlPK.getString("PK_NAME");
    111       pkColumns.add(sqlPK.getString("COLUMN_NAME"));
     110      if (pkName == null) pkName = makeSafe(sqlPK.getString("PK_NAME"));
     111      pkColumns.add(makeSafe(sqlPK.getString("COLUMN_NAME")));
    112112    }
    113113    pkInfo = new PrimaryKeyInfo(pkName, pkColumns);
     
    118118    while (sqlFK.next())
    119119    {
    120       String fkName = sqlFK.getString("FK_NAME");
    121       String fkColumn = sqlFK.getString("FKCOLUMN_NAME");
    122       String ref = sqlFK.getString("PKTABLE_NAME");
    123       String refColumn = sqlFK.getString("PKCOLUMN_NAME");
     120      String fkName = makeSafe(sqlFK.getString("FK_NAME"));
     121      String fkColumn = makeSafe(sqlFK.getString("FKCOLUMN_NAME"));
     122      String ref = makeSafe(sqlFK.getString("PKTABLE_NAME"));
     123      String refColumn = makeSafe(sqlFK.getString("PKCOLUMN_NAME"));
    124124     
    125125      ForeignKeyInfo fk = fkInfo.get(fkName);
     
    139139    while (sqlIndexes.next())
    140140    {
    141       String indexName = sqlIndexes.getString("INDEX_NAME");
    142       String column = sqlIndexes.getString("COLUMN_NAME");
     141      String indexName = makeSafe(sqlIndexes.getString("INDEX_NAME"));
     142      String column = makeSafe(sqlIndexes.getString("COLUMN_NAME"));
    143143      boolean isUnique = !sqlIndexes.getBoolean("NON_UNIQUE");
    144144     
     
    256256    }
    257257
     258  }
     259 
     260  /**
     261    Sometime the database put quotes around names. This method strips all
     262    extra characters.
     263    @param name The name to make safe, or null
     264    @return The safe name or null
     265    @since 2.1.1
     266  */
     267  private String makeSafe(String name)
     268  {
     269    if (name == null) return null;
     270    return name.replaceAll("\\W", "");
    258271  }
    259272 
  • trunk/src/core/net/sf/basedb/core/dtd/plugin-configuration-file.dtd

    r2828 r2992  
    3232<!ELEMENT configname (#PCDATA)>
    3333<!ELEMENT description (#PCDATA)>
    34 <!ELEMENT parameter (name, label, class, value*)>
     34<!ELEMENT parameter (name, label, description?, class, value*)>
    3535
    3636<!ELEMENT name (#PCDATA)>
  • trunk/src/core/net/sf/basedb/util/BioAssaySetUtil.java

    r2981 r2992  
    4343import net.sf.basedb.util.jep.Jep;
    4444import net.sf.basedb.util.jep.NotInReporterListFunction;
     45import net.sf.basedb.util.jep.PositionFunction;
    4546import net.sf.basedb.util.jep.RawFunction;
    4647import net.sf.basedb.util.jep.ReporterFunction;
     
    168169    <li>raw(property): The value of the specified raw data property
    169170    <li>rep(property): The value of the specified reporter property
     171    <li>pos: The position of a spot. Note that this is not the same as raw(position)
    170172    <li>ch(n): The intensity in channel n
    171173    <li>score(list): The score of the {@link net.sf.basedb.core.data.ReporterData} in the
     
    183185    RawFunction raw = new RawFunction();
    184186    ChannelFunction ch = new ChannelFunction();
     187    PositionFunction pos = new PositionFunction();
    185188    ReporterFunction reporter = new ReporterFunction();
    186189    ScoreFunction score = new ScoreFunction(dc);
    187190    ExtraValueFunction xtra = new ExtraValueFunction(dc, bioAssaySet);
    188     return Jep.formulaToExpression(formula, raw, ch, reporter, score, xtra);
     191    return Jep.formulaToExpression(formula, raw, ch, pos, reporter, score, xtra);
    189192  }
    190193 
  • trunk/src/core/net/sf/basedb/util/Enumeration.java

    r2304 r2992  
    2424package net.sf.basedb.util;
    2525
     26import java.util.Collections;
     27import java.util.Comparator;
    2628import java.util.List;
    2729import java.util.LinkedList;
     
    8991  }
    9092 
     93  /**
     94   * This method will sort the enumration on the keys using
     95   * {@link Collections#sort(List, Comparator<Entry<K, V>>)}.
     96   * The comparator will try to use the keys 'compareTo' method
     97   * if it implements the Comparable interface
     98   * otherwilse it will treat the key as a String.
     99   */
     100  public void sortKeys()
     101  {
     102    Collections.sort(entries, new Comparator<Entry<K, V>>()
     103    {
     104      @SuppressWarnings("unchecked")
     105      public int compare(Entry<K, V> o1, Entry<K, V> o2)
     106      {
     107        K key1 = o1.getKey();
     108        K key2 = o2.getKey();
     109        if (key1 instanceof Comparable)
     110        {
     111          return ((Comparable<K>) key1).compareTo(key2);
     112        }
     113        else
     114        {
     115          return key1.toString().compareTo(key2.toString());
     116        }
     117      }
     118    });
     119  }
     120 
     121  /**
     122   * This method will sort the enumration on the values using
     123   * {@link Collections#sort(List, Comparator<Entry<K, V>>)}.
     124   * The comparator will try to use the values 'compareTo' method
     125   * if it implements the Comparable interface
     126   * otherwilse it will treat the value as a String.
     127   */
     128  public void sortValues()
     129  {
     130    Collections.sort(entries, new Comparator<Entry<K, V>>()
     131    {
     132      @SuppressWarnings("unchecked")
     133      public int compare(Entry<K, V> o1, Entry<K, V> o2)
     134      {
     135        V value1 = o1.getValue();
     136        V value2 = o2.getValue();
     137        if (value1 instanceof Comparable)
     138        {
     139          return ((Comparable<V>) value1).compareTo(value2);
     140        }
     141        else
     142        {
     143          return value1.toString().compareTo(value2.toString());
     144        }
     145      }
     146    });
     147  }
    91148  public static class Entry<K, V>
    92149  {
  • trunk/src/core/net/sf/basedb/util/parser/FlatFileParser.java

    r2655 r2992  
    2828import java.io.BufferedReader;
    2929import java.io.IOException;
     30import java.nio.charset.Charset;
    3031
    3132import java.util.regex.Pattern;
     
    4142
    4243import net.sf.basedb.core.BaseException;
     44import net.sf.basedb.core.Config;
    4345
    4446/**
     
    8789  used to match the data/headers.
    8890  <p>
    89   Use the {@link #setInputStream(InputStream)}
     91  Use the {@link #setInputStream(InputStream, String)}
    9092  method to specify a file to parse, and {@link #parseHeaders()} to start the
    9193  parsing. Note! Even if you know that
     
    108110ffp.setMinDataColumns(5);
    109111ffp.setMaxDataColumns(5);
    110 ffp.setInputStream(FileUtil.getInputStream(path_to_file));
     112ffp.setInputStream(FileUtil.getInputStream(path_to_file), Config.getCharset());
    111113ffp.parseHeaders();
    112114for (int i = 0; i < ffp.getLineCount(); i++)
     
    482484 
    483485  /**
     486    @deprecated Use {@link #setInputStream(InputStream, String)} instead
     487  */
     488  public void setInputStream(InputStream in)
     489  {
     490    setInputStream(in, Config.getCharset());
     491  }
     492 
     493  /**
    484494    Set the input stream that will be parsed.
    485495    @param in The <code>InputStream</code>
    486   */
    487   public void setInputStream(InputStream in)
    488   {
    489     this.reader = new BufferedReader(new InputStreamReader(in));
     496    @param charsetName The name of the character set to use when parsing
     497      the file, or null to use the default charset specified by
     498      {@link Config#getCharset()}
     499    @since 2.1.1
     500  */
     501  public void setInputStream(InputStream in, String charsetName)
     502  {
     503    Charset cs = Charset.forName(charsetName == null ? Config.getCharset() : charsetName);
     504    this.reader = new BufferedReader(new InputStreamReader(in, cs));
    490505  }
    491506
  • trunk/src/plugins/core/net/sf/basedb/plugins/AbstractFlatFileImporter.java

    r2981 r2992  
    2525
    2626import net.sf.basedb.core.BooleanParameterType;
     27import net.sf.basedb.core.Config;
    2728import net.sf.basedb.core.InvalidUseOfNullException;
    2829import net.sf.basedb.core.Location;
     
    5758import net.sf.basedb.util.parser.Mapper;
    5859
     60import java.util.ArrayList;
    5961import java.util.Arrays;
    6062import java.util.regex.Pattern;
    6163import java.io.IOException;
    6264import java.io.InputStream;
     65import java.nio.charset.Charset;
    6366
    6467
     
    262265  );
    263266
     267  /**
     268    Enumerates all available character sets.
     269    @see #getCharsetParameter(String, String, String)
     270  */
     271  protected static final StringParameterType charsetType =
     272    new StringParameterType(255, Config.getCharset(), false, 1, 0, 0,
     273    new ArrayList<String>(Charset.availableCharsets().keySet()));
     274 
    264275  /**
    265276    Parameter definition that asks for the file that should be imported.
     
    452463  {
    453464    FlatFileParser ffp = getInitializedFlatFileParser();
    454     ffp.setInputStream(in);
     465    ffp.setInputStream(in, getCharset());
    455466    try
    456467    {
     
    470481    FlatFileParser ffp = getInitializedFlatFileParser();
    471482    FlatFileParser.Data dataline = null;
    472     ffp.setInputStream(in);
     483    ffp.setInputStream(in, getCharset());
    473484    boolean isSuccess = false; // false until we have finished parsing
    474485    try
     
    508519        FlatFileParser.LineType result = ffp.parseHeaders();
    509520        if (result == FlatFileParser.LineType.UNKNOWN) return;
    510        
    511521        FlatFileParser.Line line = null;
    512522        try
     
    685695  }
    686696 
     697  /**
     698    Get the character set the file uses. This method first checks the job
     699    parameters for a value, then the configuration parameters. If not
     700    found the {@link Config#getCharset()} is returned.
     701    @return The name of the charset to use
     702  */
     703  protected String getCharset()
     704  {
     705    String charset = null;
     706    if (job != null) charset = (String)job.getValue(CHARSET);
     707    if (charset == null && configuration != null)
     708    {
     709      charset = (String)configuration.getValue(CHARSET);
     710    }
     711    if (charset == null) charset = Config.getCharset();
     712    return charset;
     713  }
     714 
     715  /**
     716    The name of the parameter that asks for the character set.
     717    @see #getCharsetParameter(String, String, String)
     718  */
     719  protected static final String CHARSET = "charset";
     720 
     721  /**
     722    Parameter definition that asks for the character encoding used in the
     723    file that is imported. This can be both a job parameter and a configuration
     724    parameter. The implementation first checks in the job parameter and
     725    if not found in the configuration parameter. If still not found the
     726    default charset is used as specified by {@link Config#getCharset()}.
     727    @param label The label to use for the parameter or null to use the default label
     728      (Character set)
     729    @param description The description to use for the parameter or null to use the
     730      default description
     731    @param defaultValue The default value for the character set or null to use
     732      the system default
     733  */
     734  protected PluginParameter<String> getCharsetParameter(String label, String description, String defaultValue)
     735  {
     736    if (label == null) label = "Character set";
     737    if (description == null) description = "The character set used in the file, if not specified the default character set is used " +
     738      "(" + Config.getCharset() + ").";
     739    if (defaultValue == null) defaultValue = Config.getCharset();
     740    return new PluginParameter<String>(
     741      CHARSET, label, description, defaultValue, charsetType
     742    );
     743  }
     744 
    687745  private Pattern getPattern(String name)
    688746    throws BaseException
     
    756814  {
    757815    ErrorHandler defaultErrorHandler = new SimpleErrorHandler("skip".equals(job.getValue("defaultError")));
    758     errorHandler = new ClassMapErrorHandler(errorHandler);
     816    errorHandler = new ClassMapErrorHandler(defaultErrorHandler);
    759817    addErrorHandler(StringTooLongException.class,
    760818        getErrorHandler((String)job.getValue("stringTooLongError"), defaultErrorHandler));
  • trunk/src/plugins/core/net/sf/basedb/plugins/Base1PluginExecuter.java

    r2942 r2992  
    3131import net.sf.basedb.core.BioAssaySet;
    3232import net.sf.basedb.core.BooleanParameterType;
     33import net.sf.basedb.core.Config;
    3334import net.sf.basedb.core.DbControl;
    3435import net.sf.basedb.core.Directory;
     
    433434    ffp.setDataSplitterRegexp(Pattern.compile("\\t"));
    434435
    435     ffp.setInputStream(stream);
     436    ffp.setInputStream(stream, Config.getCharset());
    436437    return ffp;
    437438  }
     
    14331434          File newFile = File.getNew(dc, d);
    14341435          newFile.setName(f.getName());
     1436          newFile.setMimeTypeAuto(null, null);
    14351437          dc.saveItem(newFile);
    14361438          try
  • trunk/src/plugins/core/net/sf/basedb/plugins/BioAssaySetExporter.java

    r2872 r2992  
    2525package net.sf.basedb.plugins;
    2626
     27import net.sf.basedb.core.AnnotationType;
    2728import net.sf.basedb.core.BaseException;
    2829import net.sf.basedb.core.BioAssay;
     
    3233import net.sf.basedb.core.DynamicResultIterator;
    3334import net.sf.basedb.core.DynamicSpotQuery;
     35import net.sf.basedb.core.ExtendedProperties;
     36import net.sf.basedb.core.ExtendedProperty;
     37import net.sf.basedb.core.ExtraValue;
     38import net.sf.basedb.core.ExtraValueType;
    3439import net.sf.basedb.core.File;
     40import net.sf.basedb.core.Formula;
     41import net.sf.basedb.core.Include;
    3542import net.sf.basedb.core.Item;
    36 import net.sf.basedb.core.ItemAlreadyExistsException;
    3743import net.sf.basedb.core.ItemParameterType;
     44import net.sf.basedb.core.ItemQuery;
    3845import net.sf.basedb.core.Job;
    3946import net.sf.basedb.core.Path;
     
    4249import net.sf.basedb.core.PluginParameter;
    4350import net.sf.basedb.core.ProgressReporter;
     51import net.sf.basedb.core.RawDataProperty;
    4452import net.sf.basedb.core.RequestInformation;
     53import net.sf.basedb.core.StringParameterType;
    4554import net.sf.basedb.core.User;
    4655import net.sf.basedb.core.VirtualColumn;
     56import net.sf.basedb.core.data.ReporterData;
    4757import net.sf.basedb.core.plugin.About;
    4858import net.sf.basedb.core.plugin.AboutImpl;
     
    5565import net.sf.basedb.core.plugin.Response;
    5666import net.sf.basedb.core.query.Dynamic;
     67import net.sf.basedb.core.query.Hql;
    5768import net.sf.basedb.core.query.JoinType;
    5869import net.sf.basedb.core.query.Orders;
     70import net.sf.basedb.core.query.Selects;
    5971import net.sf.basedb.core.query.SqlResult;
     72import net.sf.basedb.util.BioAssaySetUtil;
     73import net.sf.basedb.util.Enumeration;
    6074
    6175import java.io.IOException;
    62 import java.io.OutputStreamWriter;
    63 import java.io.Writer;
     76import java.io.PrintWriter;
    6477import java.sql.SQLException;
    6578import java.util.ArrayList;
     
    6780import java.util.Collection;
    6881import java.util.Collections;
     82import java.util.Comparator;
    6983import java.util.EnumSet;
     84import java.util.HashMap;
    7085import java.util.HashSet;
    7186import java.util.List;
     87import java.util.Map;
    7288import java.util.Set;
    7389
     
    8197     use in MeV (available from http://www.tm4.org).
    8298
    83    @author jari
    84    @version 2.0
     99   @author jari, enell
     100   @version 2.1
    85101   @base.modified $Date$
    86102*/
     
    111127          return;
    112128        }
     129
     130        // checking that we are allowed to overwrite a possibly
     131        // existing file
     132        DbControl dc = sc.newDbControl();
     133        String p = (String)request.getParameterValue(saveAsParameter.getName());
     134        if (p.startsWith("~/"))
     135        {
     136          User user = User.getById(dc, sc.getLoggedInUserId());
     137          p = "~" + user.getLogin() + p.substring(1);
     138        }
     139        Path path = new Path(p, Path.Type.FILE);
     140        File file = File.getByPath(dc, path, true);
     141        if (!(Boolean)request.getParameterValue(overwriteParameter.getName()) &&
     142            file.isInDatabase() && !file.isRemoved())
     143        {
     144          response.setError("File exists: " + p, null);
     145          dc.close();
     146          return;
     147        }
     148        dc.close();
     149
    113150        storeValue(job, request, bioAssaySetParameter);
    114151        storeValue(job, request, saveAsParameter);
    115152        storeValue(job, request, overwriteParameter);
     153        storeValue(job, request, formatParameter);
     154       
     155        if (request.getParameterValue(formatParameter.getName()).equals(FORMAT_BASEFILE))
     156        {
     157          response.setContinue(COMMAND_CONFIGURE_BASEFILE);
     158        }
     159        else
     160        {
     161          response.setDone("Job configuration complete", Job.ExecutionTime.SHORT);
     162        }
     163      }
     164      else if (command.equals(COMMAND_CONFIGURE_BASEFILE))
     165      {
     166        List<Throwable> errors = validateRequestParameters
     167          (getConfigureBasefileParameters(context).getParameters(), request);
     168        if (errors != null)
     169        {
     170          response.setError(errors.size()+" invalid parameter(s) were found " +
     171                            "in the request", errors);
     172          return;
     173        }
     174       
     175        storeValue(job, request, geneAveragesParameter);
     176        storeValue(job, request, serialFormatParameter);
     177        storeValues(job, request, usedFieldsParameter);
     178        storeValues(job, request, usedColumnsParameter);
     179
    116180        response.setDone("Job configuration complete", Job.ExecutionTime.SHORT);
    117181      }
     
    123187  }
    124188
    125 
    126   private void exportMeV(BioAssaySet bioassayset, File file)
     189 
     190  private void exportBASE(BioAssaySet bas, File file, Map<String, String> parameters,
     191    List<String> reporterFields, List<String> spotFields, Boolean serialFormat, Boolean mergeReporters)
    127192    throws IOException, SQLException
    128193  {
     194    DbControl dc = bas.getDbControl();
     195    PrintWriter out = new PrintWriter(file.getUploadStream(false));
     196
     197    // header and parameter section
     198    out.println("BASEfile");
     199    if (!parameters.isEmpty())
     200    {
     201      for (String key : parameters.keySet())
     202      {
     203        out.println(key+"\t"+parameters.get(key));
     204      }
     205      out.println("%");
     206      out.println();
     207    }
     208   
     209    // assay section   
     210    out.println("section\tassays");
     211    out.println("count\t" + bas.getBioAssays().count(dc));
     212    String annotationString = "";
     213    for (AnnotationType at : getExperimentalFactors(dc, bas))
     214    {
     215      annotationString += "\t" + at.getName();
     216    }
     217    out.println("columns\tid\tname" + annotationString);
     218    out.println("annotationColumns" + annotationString);
     219    out.println("%");
     220    for (BioAssay ba : bas.getBioAssays().list(dc))
     221    {
     222      out.print(ba.getId() + "\t" + ba.getName());
     223      for (AnnotationType at : getExperimentalFactors(dc, bas))
     224      {
     225        out.print("\t");
     226        Set<?> values = BioAssaySetUtil.getAnnotationValues(dc, ba, at);
     227        if (!values.isEmpty()) out.print(values.iterator().next());
     228      }
     229      out.println();
     230    }
     231    out.println();
     232   
     233    // spot section(s)
     234    String fieldString = spotFields.toString().substring(1, spotFields.toString().length() - 1).replace(", ", "\t");
     235    String columnString = reporterFields.toString().substring(1, reporterFields.toString().length() - 1).replace(", ", "\t") + "\tassayData";
     236
     237    if (serialFormat)
     238    {
     239      for (BioAssay ba : bas.getBioAssays().list(dc))
     240      {
     241        out.println("section\tspots");
     242        out.println("channels\t" + bas.getRawDataType().getChannels());
     243        out.println("assayFields\t" + fieldString);
     244        out.println("columns\t" + columnString);
     245        out.println("assays\t" + ba.getId());
     246        out.println("count\t" + ba.getNumSpots());
     247        out.println("%");
     248       
     249        Integer aliasIndex = 0;
     250        Map<String, String> aliases = new HashMap<String, String>();
     251        DynamicSpotQuery query = ba.getSpotData();
     252        for (String field : reporterFields)
     253        {
     254          ++aliasIndex;
     255          query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, field), aliasIndex.toString()));
     256          aliases.put(field, aliasIndex.toString());
     257        }
     258        for (String field : spotFields)
     259        {
     260          ++aliasIndex;
     261          query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, field),
     262            aliasIndex.toString()));
     263          aliases.put(field, aliasIndex.toString());
     264        }
     265        if (mergeReporters)
     266        {
     267          // not implemented
     268        }
     269        DynamicResultIterator result = query.iterate(dc);
     270       
     271        List<Integer> reporterIndex = new ArrayList<Integer>(reporterFields.size());
     272        List<Integer> spotIndex = new ArrayList<Integer>(spotFields.size());
     273        for (String column : reporterFields)
     274        {
     275          reporterIndex.add(result.getIndex(aliases.get(column)));
     276        }
     277        for (String field : spotFields)
     278        {
     279          spotIndex.add(result.getIndex(aliases.get(field)));
     280        }
     281
     282        while (result.hasNext())
     283        {
     284          SqlResult r = result.next();
     285          boolean del = false;
     286          for (Integer column : reporterIndex)
     287          {
     288            if (del)
     289            {
     290              out.print("\t");
     291            }
     292            out.print(r.getString(column) != null ? r.getString(column) : "");
     293            del = true;
     294          }
     295          for (Integer field : spotIndex)
     296          {
     297            out.print("\t");
     298            out.print(r.getString(field) != null ? r.getString(field) : "");
     299          }
     300          out.println();
     301        }
     302        out.println();
     303      }
     304    }
     305    else
     306    {
     307      // matrix format
     308    }
     309   
     310  }
     311 
     312
     313  private void exportMeV(BioAssaySet bioassayset, File file,
     314                         ProgressReporter progress)
     315    throws IOException, SQLException
     316  {
    129317    DbControl dc=bioassayset.getDbControl();
    130     Writer out = new OutputStreamWriter(file.getUploadStream(false));
     318    PrintWriter out = new PrintWriter(file.getUploadStream(false));
    131319
    132320    // comment header
     
    139327    */
    140328
    141     // data header
    142     out.write("UID\tID");
     329    List<ExtendedProperty> reporterProperties =
     330      ExtendedProperties.getProperties("ReporterData");
     331
     332    // Data header
     333    // Reporter headers
     334    out.write("reporterInternalId\treporterID\tlastUpdate\tgeneSymbol");
     335    for (ExtendedProperty ep : reporterProperties)
     336      out.write("\t"+ep.getName());
     337    // Number 3 in below statement comes from using three reporter
     338    // entries from ReporterData. Below there is dependencies on this
     339    // '3' such as the selectReporter("") in below query.select()
     340    // statements (and more).
     341    int nof_reporter_columns=3+reporterProperties.size();
     342    // Bioassay headers
     343    out.write("\texperimentalFactor");
    143344    short nof_bioassays=0;
    144345    for (BioAssay bioassay : bioassayset.getBioAssays().list(dc))
     
    148349    }
    149350
    150     // data
     351    // Experimental factors
     352    for (AnnotationType at : getExperimentalFactors(dc, bioassayset))
     353    {
     354      out.write("\n");
     355      for (int i=0; i<nof_reporter_columns; ++i) out.write("\t");
     356      out.write("\t"+at.getName());
     357      for (BioAssay bioassay : bioassayset.getBioAssays().list(dc))
     358      {
     359        Set<?> values=BioAssaySetUtil.getAnnotationValues(dc,bioassay,at);
     360        out.print("\t");
     361        out.print( !values.isEmpty() ? values.iterator().next() : "N/A" );
     362      }
     363    }
     364
     365    progress.display(0, "Exporting ... performing database query");
     366    // Reporter annotations and expression levels
    151367    int nofchannels=bioassayset.getRawDataType().getChannels();
    152368    DynamicSpotQuery query=bioassayset.getSpotData();
     
    155371    query.select(Dynamic.select(VirtualColumn.COLUMN));
    156372    query.select(Dynamic.selectReporter("externalId"));
     373    query.select(Dynamic.selectReporter("lastUpdate"));
     374    query.select(Dynamic.selectReporter("symbol"));
     375    for (ExtendedProperty ep : reporterProperties)
     376    {
     377      query.select(Dynamic.selectReporter(ep.getName()));
     378    }
    157379    for (int i=1; i<=nofchannels; ++i)
    158380    {
     
    164386    int column_position=spotData.getIndex(VirtualColumn.POSITION.getName());
    165387    int column_column=spotData.getIndex(VirtualColumn.COLUMN.getName());
    166     int column_reporter=spotData.getIndex("externalId");
     388    int[] column_reporter= new int[nof_reporter_columns];
     389    column_reporter[0]=spotData.getIndex("externalId");
     390    column_reporter[1]=spotData.getIndex("lastUpdate");
     391    column_reporter[2]=spotData.getIndex("symbol");
     392    int idx=3;
     393    for (ExtendedProperty ep : reporterProperties)
     394    {
     395      column_reporter[idx++]=spotData.getIndex(ep.getName());
     396    }
    167397    int[] column_channel = new int[nofchannels];
    168398    for (int i=1; i<=nofchannels; ++i)
     
    173403    short column=nof_bioassays;
    174404    double log2=Math.log(2.0);
     405    int nof_reporters=bioassayset.getNumReporters();
     406    int progress_report_interval=nof_reporters/10;
     407    int nof_processed_reporters=0;
    175408    while (spotData.hasNext())
    176409    {
     410      if (nof_processed_reporters%progress_report_interval == 0)
     411      {
     412        progress.display(100 * nof_processed_reporters / nof_reporters,
     413                         "Exporting ... " + nof_processed_reporters + " of " +
     414                         nof_reporters + " done.");
     415      }
     416
    177417      SqlResult item = spotData.next();
    178418      int thisposition=item.getInt(column_position);
     
    181421      if (position!=thisposition) // new reporter
    182422      {
     423        ++nof_processed_reporters;
    183424        // fill missing values before next spot
    184425        while (nof_bioassays>column++) out.write("\t");
    185426        column=0;
    186427        position=thisposition;
    187         out.write("\npos:" + position + "\t" + item.getString(column_reporter));
     428        out.write("\n" + position);
     429        for (int i=0; i<nof_reporter_columns; ++i)
     430        {
     431          String str=item.getString(column_reporter[i]);
     432          out.write("\t" + (str!=null ? str : ""));
     433        }
     434        out.write("\t"); // experimentalFactor is always empty for reporters
    188435      }
    189436      // fill missing values up to next available column (bioassay)
     
    245492          "to be imported to MeV.",
    246493          new PathParameterType(Path.Type.FILE, null, true) );
     494      Enumeration<String, String> formats = new Enumeration<String, String>();
     495      formats.add(FORMAT_MEV, "MultiExperiment Viewer (MeV)");
     496      formats.add(FORMAT_BASEFILE, "BASEfile");
     497      formatParameter = new PluginParameter<String>
     498        ( "fileformat",
     499          "Fileformat",
     500          "Please specify what format to export.",
     501          new StringParameterType(255, null, true, 1, 0, 0, formats) );
     502
    247503      parameters.add(bioAssaySetParameter);
    248504      parameters.add(overwriteParameter);
    249505      parameters.add(saveAsParameter);
     506      parameters.add(formatParameter);
    250507
    251508      configureJob = new RequestInformation
     
    258515    return configureJob;
    259516  }
     517 
     518 
     519  private RequestInformation getConfigureBasefileParameters(GuiContext context)
     520  {
     521    if (configureJobBasefile == null)
     522    {
     523      DbControl dc = null;
     524      try
     525      {
     526        dc = sc.newDbControl();
     527        List<PluginParameter<?>> parameters = new ArrayList<PluginParameter<?>>();
     528        geneAveragesParameter = new PluginParameter<Boolean>
     529          ( "geneAverages",
     530            "Average on reporters",
     531            "Average on reporters within each assay.",
     532            new BooleanParameterType(false, true));
     533       
     534        Enumeration<Boolean, String> serialFormat = new Enumeration<Boolean, String>();
     535        serialFormat.add(false, "Normal BASEfile (one big matrix)");
     536        serialFormat.add(true, "Serial BASEfile (one section per assay)");
     537        serialFormatParameter = new PluginParameter<Boolean>
     538          ( "serialFormat",
     539            "Export as matrix or serial basefile.",
     540            "The data can be exported as a matrix with all data in the same section or in a " +
     541            "serial format where the data is separated for each assay.",
     542            new BooleanParameterType(false, true, 1, serialFormat));
     543       
     544        Enumeration<String, String> fields = new Enumeration<String, String>();
     545        List<String[]> enumList = new ArrayList<String[]>();
     546        BioAssaySet bas = (BioAssaySet) job.getValue(bioAssaySetParameter.getName());
     547        //Spotfields
     548        fields.add("pos()", "Position");
     549        int channels = bas.getRawDataType().getChannels();
     550        for (int channel = 1; channel <= channels; ++channel)
     551        {
     552          fields.add("ch("+channel+")", "Ch"+channel);
     553        }
     554        //Formulas
     555        ItemQuery<Formula> queryFormula = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION, bas.getRawDataType());
     556        queryFormula.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
     557        queryFormula.order(Orders.asc(Hql.property("name")));
     558        for (Formula f : queryFormula.list(dc))
     559        {
     560          fields.add(f.getFormula(0), "[Formula] "+f.getName());
     561        }
     562       
     563        //Extrefields
     564        ItemQuery<ExtraValue> query = bas.getExtraValues();
     565        query.order(Orders.asc(Hql.property("extraValueType.name")));
     566        for (ExtraValue ev : query.list(dc))
     567        {
     568          ExtraValueType evt = ev.getExtraValueType();
     569          fields.add("xtra('" + evt.getExternalId() + "')", "[Extra] "+evt.getName());
     570        }
     571       
     572        //Rawdata fields
     573        enumList.clear();
     574        enumList.add(new String[] {"raw('position')", "[Raw] Position"});
     575        enumList.add(new String[] {"raw('block')", "[Raw] Block"});
     576        enumList.add(new String[] {"raw('metaGridX')", "[Raw] Meta grid X"});
     577        enumList.add(new String[] {"raw('metaGridY')", "[Raw] Meta grid Y"});
     578        enumList.add(new String[] {"raw('row')", "[Raw] Row"});
     579        enumList.add(new String[] {"raw('column')", "[Raw] Column"});
     580        enumList.add(new String[] {"raw('x')", "[Raw] X"});
     581        enumList.add(new String[] {"raw('y')", "[Raw] Y"});
     582        List<RawDataProperty> rdpList = new ArrayList<RawDataProperty>(bas.getRawDataType().getProperties());
     583        for (RawDataProperty rdp : rdpList)
     584        {
     585          enumList.add(new String[] {"raw('"+rdp.getName()+"')", "[Raw] "+rdp.getTitle()});
     586        }
     587        Collections.sort(enumList, new Comparator<String[]>()
     588        {
     589          public int compare(String[] e1, String[] e2)
     590          {
     591            return e1[1].compareTo(e2[1]);
     592          }
     593        });
     594        for (String[] e : enumList)
     595        {
     596          fields.add(e[0], e[1]);
     597        }
     598       
     599        fields.sortValues();
     600        //Limsfields???
     601       
     602        usedFieldsParameter = new PluginParameter<String>(
     603          "usedFields",
     604          "Fields",
     605          "The spot information that is exporter. The position is allways exported when avarage on reporter is false.",
     606          new StringParameterType(null, null, true, 0, 0, 0, fields));
     607       
     608        List<ExtendedProperty> eps = ExtendedProperties.getProperties(ReporterData.class.toString());
     609        Collections.sort(eps, new Comparator<ExtendedProperty>()
     610        {
     611          public int compare(ExtendedProperty e1, ExtendedProperty e2)
     612          {
     613            return e1.getTitle().compareTo(e2.getTitle());
     614          }
     615        });
     616        Enumeration<String, String> columns = new Enumeration<String, String>();
     617        columns.add("rep('name')", "Reporter name");
     618        columns.add("rep('externalId')", "Reporter ID");
     619        columns.add("rep('symbol')", "Gene symbol");
     620        columns.add("rep('description')", "Description");
     621        columns.add("rep('lastUpdate')", "Last updated");
     622        for (ExtendedProperty ep : eps)
     623        {
     624          columns.add("rep('"+ep.getName()+"')", ep.getTitle());
     625        }
     626        columns.sortValues();
     627        usedColumnsParameter = new PluginParameter<String>(
     628          "usedColumns",
     629          "Reporter",
     630          "The reporter information that is exported. An internal reporter id is allways exported.",
     631          new StringParameterType(null, null, false, 0, 0, 0, columns));
     632       
     633        parameters.add(geneAveragesParameter);
     634        parameters.add(serialFormatParameter);
     635        parameters.add(usedFieldsParameter);
     636        parameters.add(usedColumnsParameter);
     637 
     638        configureJobBasefile = new RequestInformation
     639          ( COMMAND_CONFIGURE_BASEFILE,
     640            "Configure BASEfile export.",
     641            "Here you configure the parameter for the BASEfile format.",
     642            parameters );
     643      }
     644      finally
     645      {
     646        if (dc != null)
     647        {
     648          dc.close();
     649        }
     650      }
     651    }
     652    return configureJobBasefile;
     653  }
    260654
    261655
     
    265659  }
    266660
     661
     662  public List<AnnotationType> getExperimentalFactors(DbControl dc, BioAssaySet bas)
     663  {
     664    ItemQuery<AnnotationType> query = bas.getExperiment().getExperimentalFactors();
     665    query.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
     666    query.order(Orders.asc(Hql.property("name")));
     667    return query.list(dc);
     668  }
     669 
    267670
    268671  public Set<GuiContext> getGuiContexts()
     
    282685    Experiment:s and User:s.
    283686  */
     687  @Override
    284688  public Collection<Permissions> getPermissions()
    285689  {
    286690    if (permissions.size() == 0)
    287691    {
     692      permissions.add(new Permissions(Item.ANNOTATIONTYPE, null, EnumSet.of(Permission.READ)));
     693      permissions.add(new Permissions(Item.DIRECTORY, null, EnumSet.of(Permission.CREATE, Permission.WRITE)));
     694      permissions.add(new Permissions(Item.EXPERIMENT, null, EnumSet.of(Permission.READ)));
    288695      permissions.add(new Permissions(Item.FILE, null, EnumSet.of(Permission.CREATE, Permission.WRITE)));
    289       permissions.add(new Permissions(Item.DIRECTORY, null, EnumSet.of(Permission.CREATE, Permission.WRITE)));
     696      permissions.add(new Permissions(Item.RAWBIOASSAY, null, EnumSet.of(Permission.READ)));
    290697      permissions.add(new Permissions(Item.USER, null, EnumSet.of(Permission.READ)));
    291       permissions.add(new Permissions(Item.EXPERIMENT, null, EnumSet.of(Permission.READ)));
    292698    }
    293699    return permissions;
     
    303709      requestInformation = getConfigureJobParameters(context);
    304710    }
     711    else if (command.equals(COMMAND_CONFIGURE_BASEFILE))
     712    {
     713      requestInformation = getConfigureBasefileParameters(context);
     714    }
    305715    return requestInformation;
    306716  }
     
    322732
    323733
     734  @Override
    324735  public boolean requiresConfiguration()
    325736  {
     
    328739
    329740
     741  @SuppressWarnings("unchecked")
    330742  public void run(Request request, Response response, ProgressReporter progress)
    331743  {
     
    333745    try
    334746    {
     747      // Checks for file existence and file replacement is done in
     748      // configure(). Here we either replace an existing file or
     749      // create a new file.
    335750      String p = (String)job.getValue("path");
    336       if (p.startsWith("~/"))
    337       {
    338         User user = User.getById(dc, sc.getLoggedInUserId());
    339         p = "~" + user.getLogin() + p.substring(1);
    340       }
    341751      Path path = new Path(p, Path.Type.FILE);
    342 
    343       boolean overwrite = false;
    344       if ((Boolean)job.getValue("overwrite") != null)
    345       {
    346         overwrite = (Boolean)job.getValue("overwrite");
    347       }
    348 
    349       // Get file and set an error if the file already exist but
    350       // shouldn't be replaced
    351752      File file = File.getByPath(dc, path, true);
    352753      file.setMimeType("text/plain");
    353       if (file.isInDatabase() && !overwrite && !file.isRemoved())
    354       {
    355         throw new ItemAlreadyExistsException("File[path="+path+"]");
    356       }
    357       else if(!file.isInDatabase())
    358       {
    359         dc.saveItem(file);
    360       }
     754      if(!file.isInDatabase()) dc.saveItem(file);
    361755
    362756      BioAssaySet bioassayset=(BioAssaySet)job.getValue("bioAssaySet");
    363757      bioassayset = BioAssaySet.getById(dc, bioassayset.getId());
    364758
    365       progress.display(1, "Exporting ...");
     759      progress.display(0, "Exporting ...");
    366760
    367761      // Add other export formats here
    368       exportMeV(bioassayset,file);
    369 
     762      String format = (String) job.getValue("fileformat");
     763      if (format.equals(FORMAT_MEV)) exportMeV(bioassayset,file,progress);
     764      else if (format.equals(FORMAT_BASEFILE))
     765      {
     766        List<String> reporterFields = new ArrayList<String>((List<String>) job.getValues("usedColumns"));
     767        List<String> spotFields = new ArrayList<String>((List<String>) job.getValues("usedFields"));
     768       
     769        boolean serialFormat = (Boolean) job.getValue("serialFormat");
     770        boolean geneAverage = (Boolean) job.getValue("geneAverages");
     771       
     772        exportBASE(bioassayset, file, Collections.EMPTY_MAP, reporterFields, spotFields, serialFormat, geneAverage);
     773      }
     774      else
     775      {
     776        throw new BaseException("Unknown format. "+format);
     777      }
     778     
    370779      dc.commit();
    371780      response.setDone("Bioassay set '" + bioassayset.getName() +
     
    383792
    384793
     794  @Override
    385795  public boolean supportsConfigurations()
    386796  {
     
    403813    );
    404814  private RequestInformation configureJob;
     815  private RequestInformation configureJobBasefile;
    405816  private static final Set<GuiContext> guiContexts =
    406817    Collections.singleton(new GuiContext(Item.BIOASSAYSET,
     
    408819  private static final Set<Permissions> permissions =
    409820    new HashSet<Permissions>();
     821 
     822  //General parameters
    410823  private PluginParameter<BioAssaySet> bioAssaySetParameter;
    411824  private PluginParameter<Boolean> overwriteParameter;
    412   private PluginParameter<String> saveAsParameter;
     825  private PluginParameter<String> saveAsParameter;
     826  private PluginParameter<String> formatParameter;
     827 
     828  //BaseFile parameters
     829  private PluginParameter<Boolean> serialFormatParameter;
     830  private PluginParameter<Boolean> geneAveragesParameter;
     831  private PluginParameter<String> usedFieldsParameter;
     832  private PluginParameter<String> usedColumnsParameter;
     833 
     834  // Constants
     835  private static final String COMMAND_CONFIGURE_BASEFILE = "configure_basefile";
     836  private static final String FORMAT_BASEFILE = "BASEfile";
     837  private static final String FORMAT_MEV = "MeV";
    413838}
  • trunk/src/plugins/core/net/sf/basedb/plugins/PlateFlatFileImporter.java

    r2920 r2992  
    298298      if (command.equals(Request.COMMAND_CONFIGURE_PLUGIN))
    299299      {
    300         List<Throwable> errors = validateRequestParameters(
    301           getConfigurePluginParameters(context).getParameters(), request);
     300        RequestInformation ri = getConfigurePluginParameters(context);
     301        List<Throwable> errors = validateRequestParameters(ri.getParameters(), request);
    302302        if (errors != null)
    303303        {
     
    315315        storeValue(configuration, request, minDataColumnsParameter);
    316316        storeValue(configuration, request, maxDataColumnsParameter);
     317        storeValue(configuration, request, ri.getParameter(CHARSET));
    317318       
    318319        // Column mappings
     
    325326      else if (command.equals(Request.COMMAND_CONFIGURE_JOB))
    326327      {
    327         List<Throwable> errors = validateRequestParameters(
    328           getConfigureJobParameters(context).getParameters(), request);
     328        RequestInformation ri = getConfigureJobParameters(context);
     329        List<Throwable> errors = validateRequestParameters(ri.getParameters(), request);
    329330        if (errors != null)
    330331        {
     
    338339        storeValue(job, request, plateTypeParameter);
    339340        storeValue(job, request, fileParameter);
     341        storeValue(job, request, ri.getParameter(CHARSET));
    340342       
    341343        // Error handling parameters
     
    516518      parameters.add(minDataColumnsParameter);
    517519      parameters.add(maxDataColumnsParameter);
     520      parameters.add(getCharsetParameter(null, null, null));
    518521     
    519522      // Column mappings
     
    557560      parameters.add(plateTypeParameter);
    558561      parameters.add(fileParameter);
     562      parameters.add(getCharsetParameter(null, null, (String)configuration.getValue(CHARSET)));
    559563      parameters.add(plateNamePrefixParameter);
    560564      parameters.add(reporterPrefixParameter);
  • trunk/src/plugins/core/net/sf/basedb/plugins/PluginConfigurationExporter.java

    r2942 r2992  
    304304          labelElement.setText(parameterInfo.getLabel());
    305305          newParameterElement.addContent(labelElement);
     306          Element parameterDescription = new Element("description");
     307          parameterDescription.setText(parameterInfo.getDescription());
     308          newParameterElement.addContent(parameterDescription);
    306309          List<?> values = parameterInfo.getValues();
    307310          Element classElement = new Element("class");       
     
    322325              valueElement.setText(o.toString());           
    323326              newParameterElement.addContent(valueElement);
     327
    324328            }
    325329          }       
  • trunk/src/plugins/core/net/sf/basedb/plugins/PluginConfigurationImporter.java

    r2866 r2992  
    8888  extends AbstractPlugin
    8989    implements InteractivePlugin, AutoDetectingImporter
    90 {
    91  
     90{
    9291  private static final About about = new AboutImpl
    9392  (
     
    116115 
    117116  private RequestInformation configureJob;
    118  
    119   // Counting variables for the job
    120   private int numImportedConfigurations;
    121   private int numNotImportedConfigurations;
    122117 
    123118  // Variables to store the job parameters in.
     
    232227        is.close();
    233228       
    234         response.setDone(getSuccessMessage());
     229        response.setDone("The configurations were imported successfully!");
    235230       
    236231      }
     
    300295    throws BaseException
    301296  {           
    302     DbControl dc = null;   
    303     numNotImportedConfigurations = 0;
     297    DbControl dc = null;
     298   
    304299    try
    305300    {
     
    319314        String pluginClassName = configuration.getAttributeValue("pluginClassName");
    320315       
    321         try
    322         {
    323           PluginDefinition pluginDefinition = PluginDefinition.getByClassName(dc, pluginClassName);
    324          
    325           PluginConfiguration pluginConfig = PluginConfiguration.getNew(dc, pluginDefinition);         
    326           dc.saveItem(pluginConfig);
    327           pluginConfig.setName(name);
    328           pluginConfig.setDescription(description);
    329          
    330           List parameters = configuration.getChildren("parameter");
    331           setPluginConf(parameters, pluginConfig);         
    332           numImportedConfigurations++;       
    333         }
    334         catch(Throwable ex)
    335         {
    336           numNotImportedConfigurations++;         
    337         }
     316     
     317        PluginDefinition pluginDefinition = PluginDefinition.getByClassName(dc, pluginClassName);
     318       
     319        PluginConfiguration pluginConfig = PluginConfiguration.getNew(dc, pluginDefinition);         
     320        dc.saveItem(pluginConfig);
     321        pluginConfig.setName(name);
     322        pluginConfig.setDescription(description);
     323       
     324        List parameters = configuration.getChildren("parameter");
     325        setPluginConf(parameters, pluginConfig);         
    338326      }       
    339327      dc.commit();
     
    355343      -----------------------------------------------------
    356344  */ 
    357   /**
    358     Gets the message of how many parameters that were handled/imported of the parameters in the xml-file
    359   */
    360   private String getSuccessMessage()
    361   {
    362     StringBuilder message = new StringBuilder();   
    363     message.append(numImportedConfigurations + " configurations were imported.\n");
    364     if (numNotImportedConfigurations > 0)
    365     {
    366       message.append(numNotImportedConfigurations + " configurations were not imported.\n");
    367     }
    368     return message.toString();
    369   }
    370345 
    371346  private RequestInformation getConfiguredJobParameters()
     
    413388      Returns null if this importer doesn't support the class.
    414389  */
    415   private ParameterType getParameterType(Class parameterClass)
     390  private ParameterType getParameterType(Class parameterClass, List<?> values)
    416391  {
    417392    if (parameterClass.equals(Boolean.class)) return new BooleanParameterType();
     
    421396    else if (parameterClass.equals(Integer.class)) return new IntegerParameterType();   
    422397    else if (parameterClass.equals(Long.class)) return new LongParameterType();
    423     else if (parameterClass.equals(String.class)) return new StringParameterType();
     398    else if (parameterClass.equals(String.class))
     399    {
     400      StringParameterType stp = null;
     401      if (values != null && !values.isEmpty())
     402      {
     403        int maxLength = 0;
     404        for (Object obj : values)
     405        {
     406          if (obj instanceof String)
     407          {
     408            String str = obj.toString();
     409            maxLength = maxLength < str.length() ? str.length() : maxLength;           
     410          }
     411        }
     412        stp = new StringParameterType(maxLength, null, false);
     413      }
     414      else
     415      {
     416        stp = new StringParameterType();
     417      }
     418      return stp;
     419     
     420    }
    424421    else return null;
    425422  }
     
    440437      String name = parameter.getChildText("name");               
    441438      String cl = parameter.getChildText("class");
    442       String label = parameter.getChildText("label").length() > 0 ? parameter.getChildText("label") : name;         
     439      String label = parameter.getChildText("label");
     440      if (label == null || label.length() == 0) label = name;   
     441      String description = parameter.getChildText("description");
    443442      Class clazz = null;
    444443      List<?> values = null;
     
    448447        clazz = Class.forName(cl);
    449448        values = getValueList(parameter, clazz);
    450         plc.setParameterValues(name,label, "", getParameterType(clazz), values);
     449        ParameterType pType = getParameterType(clazz, values);
     450        plc.setParameterValues(name,label, description, pType, values);
    451451      }
    452452    }
  • trunk/src/plugins/core/net/sf/basedb/plugins/PrintMapFlatFileImporter.java

    r2872 r2992  
    236236      if (command.equals(Request.COMMAND_CONFIGURE_JOB))
    237237      {
    238         List<Throwable> errors =
    239           validateRequestParameters(getConfigureJobParameters(context).getParameters(), request);
     238        RequestInformation ri = getConfigureJobParameters(context);
     239        List<Throwable> errors = validateRequestParameters(ri.getParameters(), request);
    240240        if (errors != null)
    241241        {
     
    244244        }
    245245        storeValue(job, request, fileParameter);
     246        storeValue(job, request, ri.getParameter(CHARSET));
    246247        storeValue(job, request, arrayDesignParameter);
    247248
     
    480481      // Parameters for CONFIGURE_JOB
    481482      List<PluginParameter<?>> parameters = new ArrayList<PluginParameter<?>>();
     483      parameters.add(arrayDesignParameter);
    482484      parameters.add(fileParameter);
    483       parameters.add(arrayDesignParameter);
     485      parameters.add(getCharsetParameter(null, null, null));
    484486     
    485487      // Error handling parameters
  • trunk/src/plugins/core/net/sf/basedb/plugins/RawDataFlatFileImporter.java

    r2751 r2992  
    356356      {
    357357        RawDataType rdt = RawDataTypes.getRawDataType((String)configuration.getValue("rawDataType"));
    358         List<Throwable> errors = validateRequestParameters(getConfigureParserParameters(rdt).getParameters(), request);
     358        RequestInformation ri = getConfigureParserParameters(rdt);
     359        List<Throwable> errors = validateRequestParameters(ri.getParameters(), request);
    359360        if (errors != null)
    360361        {
     
    372373        storeValue(configuration, request, minDataColumnsParameter);
    373374        storeValue(configuration, request, maxDataColumnsParameter);
     375        storeValue(configuration, request, ri.getParameter(CHARSET));
    374376       
    375377        // Column mappings
     
    383385      else if (command.equals(Request.COMMAND_CONFIGURE_JOB))
    384386      {
    385         List<Throwable> errors = validateRequestParameters(getConfigureJobParameters(context).getParameters(), request);
     387        RequestInformation ri = getConfigureJobParameters(context);
     388        List<Throwable> errors = validateRequestParameters(ri.getParameters(), request);
    386389        if (errors != null)
    387390        {
     
    390393        }
    391394       
     395        storeValue(job, request, rawBioAssayParameter);
    392396        storeValue(job, request, fileParameter);
    393         storeValue(job, request, rawBioAssayParameter);
     397        storeValue(job, request, ri.getParameter(CHARSET));
    394398       
    395399        // Error handling parameters
     
    608612      parameters.add(rawBioAssayParameter);
    609613      parameters.add(fileParameter);
     614      parameters.add(getCharsetParameter(null, null, (String)configuration.getValue(CHARSET)));
    610615     
    611616      // Error handling parameters
     
    706711      parameters.add(minDataColumnsParameter);
    707712      parameters.add(maxDataColumnsParameter);
     713      parameters.add(getCharsetParameter(null, null, null));
    708714
    709715      // Column mappings
  • trunk/src/plugins/core/net/sf/basedb/plugins/ReporterFlatFileImporter.java

    r2843 r2992  
    287287      if (command.equals(Request.COMMAND_CONFIGURE_PLUGIN))
    288288      {
    289         List<Throwable> errors = validateRequestParameters(getConfigurePluginParameters(context).getParameters(), request);
     289        RequestInformation ri = getConfigurePluginParameters(context);
     290        List<Throwable> errors = validateRequestParameters(ri.getParameters(), request);
    290291        if (errors != null)
    291292        {
     
    303304        storeValue(configuration, request, minDataColumnsParameter);
    304305        storeValue(configuration, request, maxDataColumnsParameter);
     306        storeValue(configuration, request, ri.getParameter(CHARSET));
    305307       
    306308        // Column mappings
     
    316318      else if (command.equals(Request.COMMAND_CONFIGURE_JOB))
    317319      {
    318         List<Throwable> errors = validateRequestParameters(getConfigureJobParameters(context).getParameters(), request);
     320        RequestInformation ri = getConfigureJobParameters(context);
     321        List<Throwable> errors = validateRequestParameters(ri.getParameters(), request);
    319322        if (errors != null)
    320323        {
     
    328331        }
    329332        storeValue(job, request, fileParameter);
     333        storeValue(job, request, ri.getParameter(CHARSET));
    330334        storeValue(job, request, updateExistingParameter);
    331335       
     
    616620      }
    617621      parameters.add(fileParameter);
     622      parameters.add(getCharsetParameter(null, null, (String)configuration.getValue(CHARSET)));
    618623      parameters.add(updateExistingParameter);
    619624     
     
    671676      parameters.add(minDataColumnsParameter);
    672677      parameters.add(maxDataColumnsParameter);
     678      parameters.add(getCharsetParameter(null, null, null));
    673679
    674680      // Column mappings
  • trunk/src/plugins/core/net/sf/basedb/plugins/ReporterMapFlatFileImporter.java

    r2751 r2992  
    304304      if (command.equals(Request.COMMAND_CONFIGURE_PLUGIN))
    305305      {
    306 
    307         List<Throwable> errors =
    308           validateRequestParameters(getConfigurePluginParameters(context).getParameters(), request);
     306        RequestInformation ri = getConfigurePluginParameters(context);
     307        List<Throwable> errors = validateRequestParameters(ri.getParameters(), request);
    309308        if (errors != null)
    310309        {
     
    332331        storeValue(configuration, request, minDataColumnsParameter);
    333332        storeValue(configuration, request, maxDataColumnsParameter);
     333        storeValue(configuration, request, ri.getParameter(CHARSET));
    334334
    335335        // Column mappings
     
    343343      else if (command.equals(Request.COMMAND_CONFIGURE_JOB))
    344344      {
    345         List<Throwable> errors =
    346           validateRequestParameters(getConfigureJobParameters(context).getParameters(), request);
     345        RequestInformation ri = getConfigureJobParameters(context);
     346        List<Throwable> errors = validateRequestParameters(ri.getParameters(), request);
    347347        if (errors != null)
    348348        {
     
    350350          return;
    351351        }
     352        storeValue(job, request, arrayDesignParameter);
    352353        storeValue(job, request, fileParameter);
    353         storeValue(job, request, arrayDesignParameter);
    354        
     354        storeValue(job, request, ri.getParameter(CHARSET));
     355     
    355356        // Error handling parameters
    356357        storeValue(job, request, defaultErrorParameter);
     
    530531      parameters.add(arrayDesignParameter);
    531532      parameters.add(fileParameter);
     533      parameters.add(getCharsetParameter(null, null, (String)configuration.getValue(CHARSET)));
    532534     
    533535      // Error handling parameters
     
    566568      parameters.add(minDataColumnsParameter);
    567569      parameters.add(maxDataColumnsParameter);
     570      parameters.add(getCharsetParameter(null, null, null));
    568571     
    569572      // Column mappings
  • trunk/src/test/TestAnalyzePluginUtil.java

    r2751 r2992  
    6464        parser.setDataHeaderRegexp(Pattern.compile("\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*"));
    6565        parser.setDataSplitterRegexp(Pattern.compile("\\t"));
    66         parser.setInputStream(FileUtil.getInputStream(new java.io.File("test.rawdata.import.txt")));
     66        parser.setInputStream(FileUtil.getInputStream(new java.io.File("test.rawdata.import.txt")), "ISO-8859-1");
    6767        parser.parseHeaders();
    6868       
  • trunk/src/test/TestArrayDesign.java

    r2959 r2992  
    532532      parser.setDataHeaderRegexp(Pattern.compile(headerRegexp));
    533533      parser.setDataSplitterRegexp(Pattern.compile("\\t"));
    534       parser.setInputStream(FileUtil.getInputStream(new java.io.File(filename)));
     534      parser.setInputStream(FileUtil.getInputStream(new java.io.File(filename)), "ISO-8859-1");
    535535      parser.parseHeaders();
    536536     
  • trunk/src/test/TestFlatFileParser.java

    r2959 r2992  
    8989    {
    9090      InputStream in = FileUtil.getInputStream(new java.io.File(file));
    91       ffp.setInputStream(in);
     91      ffp.setInputStream(in, "ISO-8859-1");
    9292      FlatFileParser.LineType last_line_type = ffp.parseHeaders();
    9393      int i = 0;
     
    129129      Set<String> sections = new HashSet<String>(Arrays.asList("FileInformation", "Block1", "Block2", "Block3", "Block4", "mapping"));
    130130      InputStream in = FileUtil.getInputStream(new java.io.File(file));
    131       ffp.setInputStream(in);
     131      ffp.setInputStream(in, "ISO-8859-1");
    132132      FlatFileParser.Line section;
    133133      while (ffp.hasMoreSections())
  • trunk/src/test/TestParameterType.java

    r2304 r2992  
    108108  }
    109109 
     110  @SuppressWarnings("unchecked")
    110111  static void test_validation(List<ParameterType> parameters, int newsId, int newsId2)
    111112  {
  • trunk/src/test/TestPlate.java

    r2304 r2992  
    154154      ffp.setDataHeaderRegexp(Pattern.compile(headerRegexp));
    155155      ffp.setDataSplitterRegexp(Pattern.compile("\\t"));
    156       ffp.setInputStream(FileUtil.getInputStream(new java.io.File(filename)));
     156      ffp.setInputStream(FileUtil.getInputStream(new java.io.File(filename)), "ISO-8859-1");
    157157      ffp.parseHeaders();
    158158      PlateType pt = PlateType.getById(dc, plateTypeId);
  • trunk/src/test/TestRawBioAssay.java

    r2959 r2992  
    428428      parser.setDataHeaderRegexp(Pattern.compile("\"Block\"\\t\"Column\"\\t\"Row\"\\t\"Name\"\\t\"ID\".*"));
    429429      parser.setDataSplitterRegexp(Pattern.compile("\\t"));
    430       parser.setInputStream(FileUtil.getInputStream(new java.io.File(filename)));
     430      parser.setInputStream(FileUtil.getInputStream(new java.io.File(filename)), "ISO-8859-1");
    431431      parser.parseHeaders();
    432432     
  • trunk/src/test/TestReporter.java

    r2959 r2992  
    248248      ffp.setDataHeaderRegexp(Pattern.compile(headerRegexp));
    249249      ffp.setDataSplitterRegexp(Pattern.compile("\\t"));
    250       ffp.setInputStream(FileUtil.getInputStream(new java.io.File(filename)));
     250      ffp.setInputStream(FileUtil.getInputStream(new java.io.File(filename)), "ISO-8859-1");
    251251      ffp.parseHeaders();
    252252      ReporterBatcher rb = ReporterBatcher.getNew(dc);
  • trunk/www/admin/pluginconfigurations/index.jsp

    r2978 r2992  
    145145      int pluginDefinitionId = Values.getInt(request.getParameter("plugindefinition_id"), -1);
    146146      PluginDefinition plugin = PluginDefinition.getById(dc, pluginDefinitionId);
    147       if (configure && !plugin.supportsConfigurations())
     147      if (!plugin.supportsConfigurations())
    148148      {
    149149        throw new WebException("popup", "Configurations are not supported",
  • trunk/www/biomaterials/extracts/edit_extract.jsp

    r2978 r2992  
    378378      var frm = document.forms['extract'];
    379379      var usedQuantity = frm.used_quantity.value;
    380       usedQuantity = usedQuantity == '' ? '-' : usedQuantity+' µg';
     380      var displayQuantity = usedQuantity == '' ? '-' : usedQuantity+' µg';
    381381      for (var i = 0; i < frm.extracts.length; i++) // >
    382382      {
     
    385385        {
    386386          option.item.value = usedQuantity;
    387           var text = option.text.replace(/\[.*\]/, '['+usedQuantity+']');
     387          var text = option.text.replace(/\[.*\]/, '['+displayQuantity+']');
    388388          option.text = text;
    389389        }
  • trunk/www/biomaterials/extracts/view_extract.jsp

    r2978 r2992  
    314314        extractsQuery.order(Orders.asc(Hql.property("name")));
    315315        ItemResultList<Extract> extracts = extractsQuery.list(dc);
    316         String extractLink = "index.jsp?ID="+ID;
    317316        %>
    318317        <h4 class="docked">Pooled from extracts</h4>
     
    343342            %>
    344343            <tbl:row>
    345               <tbl:cell column="name"><%=Base.getEncodedName(item, false, extractLink)%></tbl:cell>
     344              <tbl:cell column="name"><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell>
    346345              <tbl:cell column="quantity"><%=Values.formatNumber(creationEvent.getUsedQuantity(item), 2)%></tbl:cell>
    347346              <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
     
    383382            title="Name"
    384383          />         
     384          <tbl:columndef
     385            id="quantity"
     386            title="Used quantity (µg)"
     387          />
    385388          <tbl:columndef
    386389            id="description"
     
    396399                <tbl:row>
    397400                  <tbl:cell column="name"><%=Base.getLinkedName(ID, lbe, false, true)%></tbl:cell>
     401                  <tbl:cell column="quantity"><%=Values.formatNumber(lbe.getCreationEvent().getUsedQuantity(extract), 2)%></tbl:cell>
    398402                  <tbl:cell column="description"><%=HTML.encodeTags(lbe.getDescription())%></tbl:cell>
    399403                </tbl:row>
  • trunk/www/biomaterials/labeledextracts/edit_labeledextract.jsp

    r2978 r2992  
    408408      var frm = document.forms['labeledextract'];
    409409      var usedQuantity = frm.used_quantity.value;
    410       usedQuantity = usedQuantity == '' ? '-' : usedQuantity+' µg';
     410      var displayQuantity = usedQuantity == '' ? '-' : usedQuantity+' µg';
    411411      for (var i = 0; i < frm.labeledextracts.length; i++)  // >
    412412      {
     
    415415        {
    416416          option.item.value = usedQuantity;
    417           var text = option.text.replace(/\[.*\]/, '['+usedQuantity+']');
     417          var text = option.text.replace(/\[.*\]/, '['+displayQuantity+']');
    418418          option.text = text;
    419419        }
  • trunk/www/biomaterials/labeledextracts/view_labeledextract.jsp

    r2978 r2992  
    345345            %>
    346346            <tbl:row>
    347               <tbl:cell column="name"><%=Base.getEncodedName(item, false, extractLink)%></tbl:cell>
     347              <tbl:cell column="name"><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell>
    348348              <tbl:cell column="quantity"><%=Values.formatNumber(creationEvent.getUsedQuantity(item), 2)%></tbl:cell>
    349349              <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
     
    382382            title="Name"
    383383          />         
     384          <tbl:columndef
     385            id="quantity"
     386            title="Used quantity (µg)"
     387          />
    384388          <tbl:columndef
    385389            id="description"
     
    395399                <tbl:row>
    396400                  <tbl:cell column="name"><%=Base.getLinkedName(ID, hyb, false, true)%></tbl:cell>
     401                  <tbl:cell column="quantity"><%=Values.formatNumber(hyb.getCreationEvent().getUsedQuantity(extract), 2)%></tbl:cell>
    397402                  <tbl:cell column="description"><%=HTML.encodeTags(hyb.getDescription())%></tbl:cell>
    398403                </tbl:row>
  • trunk/www/biomaterials/samples/edit_sample.jsp

    r2978 r2992  
    375375      var frm = document.forms['sample'];
    376376      var usedQuantity = frm.used_quantity.value;
    377       usedQuantity = usedQuantity == '' ? '-' : usedQuantity+' µg';
     377      var displayQuantity = usedQuantity == '' ? '-' : usedQuantity+' µg';
    378378      for (var i = 0; i < frm.samples.length; i++)  // >
    379379      {
     
    382382        {
    383383          option.item.value = usedQuantity;
    384           var text = option.text.replace(/\[.*\]/, '['+usedQuantity+']');
     384          var text = option.text.replace(/\[.*\]/, '['+displayQuantity+']');
    385385          option.text = text;
    386386        }
  • trunk/www/biomaterials/samples/view_sample.jsp

    r2978 r2992  
    299299        samplesQuery.order(Orders.asc(Hql.property("name")));
    300300        ItemResultList<Sample> samples = samplesQuery.list(dc);
    301         String sampleLink = "index.jsp?ID="+ID;
    302301        %>
    303302        <h4 class="docked">Pooled from samples</h4>
     
    328327            %>
    329328            <tbl:row>
    330               <tbl:cell column="name"><%=Base.getEncodedName(item, false, sampleLink)%></tbl:cell>
     329              <tbl:cell column="name"><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell>
    331330              <tbl:cell column="quantity"><%=Values.formatNumber(creationEvent.getUsedQuantity(item), 2)%></tbl:cell>
    332331              <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
     
    364363            id="name"
    365364            title="Name"
     365          />
     366          <tbl:columndef
     367            id="quantity"
     368            title="Used quantity (µg)"
    366369          />
    367370          <tbl:columndef
     
    378381                <tbl:row>
    379382                  <tbl:cell column="name"><%=Base.getLinkedName(ID, e, false, true)%></tbl:cell>
     383                  <tbl:cell column="quantity"><%=Values.formatNumber(e.getCreationEvent().getUsedQuantity(sample), 2)%></tbl:cell>
    380384                  <tbl:cell column="description"><%=HTML.encodeTags(e.getDescription())%></tbl:cell>
    381385                </tbl:row>
  • trunk/www/common/plugin/configure.jsp

    r2978 r2992  
    166166            }
    167167            // Finally, if the parameter has multiplicity=1, is requried and has a list of enumeration values
    168             if ((values == null || values.size() == 0) && pType.getNotNull() && pType.getMultiplicity() == 1 && pType.getItems() != null)
     168            if ((values == null || values.size() == 0) && pType.getNotNull() &&
     169              pType.getMultiplicity() == 1 && pType.getItems() != null && pType.getItems().size() > 0)
    169170            {
    170171              values = Collections.singletonList(pType.getItems().get(0)); 
     
    663664                for (Throwable t : errors)
    664665                {
     666                  t.printStackTrace();
    665667                  %>
    666668                  <li><%=t.getMessage()%><br>
     
    713715                  if (multiplicity == 0)
    714716                  {
    715                     select = "Select one or more";
     717                    if (pType.getNotNull())
     718                    {
     719                      select = "Select one or more";
     720                    }
     721                    else
     722                    {
     723                      select = "Select zero or more";
     724                    }
    716725                  }
    717726                  else if (multiplicity == 1)
     
    721730                  else
    722731                  {
    723                     select = "Select 1 -- "+multiplicity;
     732                    if (pType.getNotNull())
     733                    {
     734                      select = "Select 1 -- " + multiplicity;
     735                    }
     736                    else
     737                    {
     738                      select = "Select 0 -- " + multiplicity;
     739                    }
    724740                  }
    725741                  %>
  • trunk/www/common/plugin/index.jsp

    r2978 r2992  
    345345    List<Throwable> parseErrors = new LinkedList<Throwable>();
    346346    ItemContext currentContext = (ItemContext)sc.getSessionSetting("plugin.configure.currentContext");
     347    // Clear old errors
     348    sc.setSessionSetting("plugin.configure.errors.message", null);
     349    sc.setSessionSetting("plugin.configure.errors.list", null);
    347350    if (parameters != null && parameters.size() > 0)
    348351    {
     
    463466        sc.setSessionSetting("plugin.configure.plugin", null);
    464467        sc.setSessionSetting("plugin.configure.config", null);
    465         sc.setSessionSetting("plugin.configure.errors.message", null);
    466         sc.setSessionSetting("plugin.configure.errors.list", null);
    467468        sc.setSessionSetting("plugin.configure.currentContext", null);
    468469        message = "Plugin configured";
     
    520521    sc.setSessionSetting("plugin.configure.plugin", null);
    521522    sc.setSessionSetting("plugin.configure.config", null);
    522     sc.setSessionSetting("plugin.configure.errors.message", null);
    523     sc.setSessionSetting("plugin.configure.errors.list", null);
    524523    sc.setSessionSetting("plugin.configure.currentContext", null);
    525524    if (pluginResponse != null && pluginResponse.getStatus() == Response.Status.EXECUTE_IMMEDIATELY)
  • trunk/www/common/plugin/parse_file.jsp

    r2978 r2992  
    2626--%>
    2727<%@ page session="false"
     28  contentType="text/html; charset=UTF-8" 
    2829  import="net.sf.basedb.core.SessionControl"
    2930  import="net.sf.basedb.core.DbControl"
     31  import="net.sf.basedb.core.Config"
    3032  import="net.sf.basedb.core.Item"
    3133  import="net.sf.basedb.core.File"
     
    4749
    4850<%
     51request.setCharacterEncoding("UTF-8");
    4952final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
    5053final String ID = sc.getId();
     
    5558{
    5659  String path = request.getParameter("path");
     60  String charsetName = Values.getString(request.getParameter("charset"), Config.getCharset());
    5761  File file = null;
    5862  FlatFileParser parser = null;
     
    142146   
    143147    fileInputStream = file.getDownloadStream(0);
    144     parser.setInputStream(fileInputStream);
     148    parser.setInputStream(fileInputStream, charsetName);
    145149    lastLine = parser.parseHeaders();
    146150    dataIsFound = lastLine == FlatFileParser.LineType.DATA || lastLine == FlatFileParser.LineType.DATA_HEADER;
     
    155159    <script language="JavaScript">
    156160    var patterns = new Array();
     161    var columnHeaders = new Array();
    157162    function setPattern(list, patternIndex)
    158163    {
     
    171176      if (list)
    172177      {
    173         expression = list[list.selectedIndex].text;
    174178        var colIndex = list[list.selectedIndex].value;
     179        expression = columnHeaders[colIndex];
    175180        list.selectedIndex = 0;
    176181        var style = Forms.getCheckedRadio(frm.expressionStyle);
     
    208213  </base:head>
    209214  <base:body onload="window.parent.adjustIFrameSize()">
    210 
    211215  <t:tabcontrol id="parsedFile"
    212216    contentstyle="<%="height: "+(int)(scale*400)+"px;"%>" autoheight="false">
     
    371375          <%
    372376        }
     377        if (parser.getColumnHeaders() != null)
     378        {
     379          for (String columnHeader : parser.getColumnHeaders())
     380          {
     381            %>
     382            columnHeaders[columnHeaders.length] = '<%=HTML.javaScriptEncode(columnHeader)%>';
     383            <%
     384          }
     385        }
    373386        %>
    374387        </script>
  • trunk/www/common/plugin/test_with_file.jsp

    r2978 r2992  
    2626--%>
    2727<%@ page session="false"
     28  contentType="text/html; charset=UTF-8" 
    2829  import="net.sf.basedb.core.SessionControl"
    2930  import="net.sf.basedb.core.DbControl"
    3031  import="net.sf.basedb.core.Item"
     32  import="net.sf.basedb.core.Config"
    3133  import="net.sf.basedb.core.Location"
    3234  import="net.sf.basedb.util.parser.FlatFileParser"
     
    3436  import="net.sf.basedb.util.Values"
    3537  import="net.sf.basedb.clients.web.util.HTML"
     38  import="java.nio.charset.Charset"
    3639%>
    3740<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
     
    281284      <tr valign="top">
    282285        <td class="prompt">Lines to parse</td>
    283         <td colspan="3">
     286        <td>
    284287          <input type="text" class="text" name="maxLines" size="12" maxlength="10"
    285288            value="<%=FlatFileParser.DEFAULT_MAX_UNKNOWN_LINES%>"
    286289            onkeypress="return Numbers.integerOnly(event)">
     290        </td>
     291        <td class="prompt">Encoding</td>
     292        <td>
     293          <select name="charset">
     294          <%
     295          String defaultCharset = Config.getCharset();
     296          for (String charset : Charset.availableCharsets().keySet())
     297          {
     298            %>
     299            <option value="<%=charset%>"
     300              <%=defaultCharset.equalsIgnoreCase(charset) ? "selected" : ""%>><%=charset%>
     301            <%
     302          }
     303          %>
     304          </select>
    287305        </td>
    288306      </tr>
  • trunk/www/exception/exception.jsp

    r2978 r2992  
    136136    <table border="0" cellpadding="0" cellspacing="0" class="form">
    137137    <tr>
    138       <td class="prompt">Base version</td>
    139       <td class="info"><%=Application.getMajorVersion() + "." +Application.getMinorVersion() + " (build #" + Application.getBuild()+"; schema #" + Application.getSchemaVersion()+")"%></td>
     138      <td class="prompt">Version</td>
     139      <td class="info"><%=Application.getVersionString()%></td>
    140140    </tr>
    141141    <tr>
  • trunk/www/info/about.jsp

    r2978 r2992  
    7676    <b>Administrator:</b> <%=Values.getString(serverAdminName, "<i>- unknown -</i>")%><br>
    7777    <b>Email:</b> <%=serverAdminEmail == null ? "<i>- unknown -</i>": "<a href=\"mailto:"+serverAdminEmail+"\">"+serverAdminEmail+"</a>"%><br>
    78     <b>Version:</b> <%=Application.getMajorVersion() + "." +Application.getMinorVersion() + " (build #" + Application.getBuild()+"; schema #" + Application.getSchemaVersion()+")"%><br>
     78    <b>Version:</b> <%=Application.getVersionString()%><br>
    7979    <br>
    8080    <font size="-1">
     
    9090  <table border="0" cellpadding="0" cellspacing="0" class="form">
    9191  <tr>
    92     <td class="prompt">Base version</td>
    93     <td class="info"><%=Application.getMajorVersion() + "." +Application.getMinorVersion() + " (build #" + Application.getBuild()+"; schema #" + Application.getSchemaVersion()+")"%></td>
     92    <td class="prompt">Version</td>
     93    <td class="info"><%=Application.getVersionString()%></td>
    9494  </tr>
    9595  <tr>
  • trunk/www/lims/arrayslides/create_wizard.jsp

    r2978 r2992  
    109109        return false;
    110110      }
    111       if (frm.arraybatch_id && frm.arraybatch_id[frm.arraybatch_id.selectedIndex].value == 0)
     111      if (frm.arraybatch_id &&
     112        (frm.arraybatch_id.length == 0 || frm.arraybatch_id[frm.arraybatch_id.selectedIndex].value == 0))
    112113      {
    113114        alert("You must select an array batch");
     
    256257          <td class="prompt">Start at</td>
    257258          <td><input <%=clazz%> type="text" name="start_at" value="1"
    258             size="12" maxlength="3"
    259             onkeypress="return Numbers.integerOnly(event)"></td>
     259            size="12" maxlength="10"
     260            onkeypress="return Numbers.integerOnly(event)">
     261            <b>Pad size</b>
     262            <input <%=clazz%> type="text" name="pad_length" value=""
     263            size="12" maxlength="1"
     264            onkeypress="return Numbers.integerOnly(event)">
     265            <br>
     266            The index number will be padded with zeroes to this length
     267            (ie, 1 --&gt; Slide.001; 10 --&gt; Slide.010).<br>
     268            Leave empty for automatic selection.
     269          </td>
    260270        </tr>
    261271        <tr>
     
    303313          </tr>
    304314          <%
    305           int padLength = 1;
    306           int lastIndex = startAt + quantity - 1;
    307           if (lastIndex >= 10) padLength = 2;
    308           if (lastIndex >= 100) padLength = 3;
     315          int padLength = Values.getInt(request.getParameter("pad_length"));
     316          if (padLength == 0)
     317          {
     318            int lastIndex = startAt + quantity - 1;
     319            padLength = (int)Math.log10(lastIndex) + 1;
     320          }
    309321          for (int i = 0; i < quantity; i++)
    310322          {
  • trunk/www/views/hybridizations/edit_hybridization.jsp

    r2978 r2992  
    390390      var frm = document.forms['hybridization'];
    391391      var usedQuantity = frm.used_quantity.value;
    392       usedQuantity = usedQuantity == '' ? '-' : usedQuantity+' µg';
     392      var displayQuantity = usedQuantity == '' ? '-' : usedQuantity+' µg';
    393393      for (var i = 0; i < frm.labeled_extracts.length; i++) // >
    394394      {
     
    397397        {
    398398          option.item.value = usedQuantity;
    399           var text = option.text.replace(/\[.*\]/, '['+usedQuantity+']');
     399          var text = option.text.replace(/\[.*\]/, '['+displayQuantity+']');
    400400          option.text = text;
    401401        }
Note: See TracChangeset for help on using the changeset viewer.