Ignore:
Timestamp:
Mar 8, 2010, 5:53:30 PM (11 years ago)
Author:
tabma
Message:
  • columnmapping added
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/taglib/dbnp/importer/ImporterTagLib.groovy

    r231 r245  
    1919class ImporterTagLib {
    2020    static namespace = 'importer'
    21     def standardentities = [[type:0, name:"Study"], [type:1, name:"Subject"], [type:2, name:"Event"],
     21    def standardentities = [[type:-1, name:"Don't import"], [type:0, name:"Study"], [type:1, name:"Subject"], [type:2, name:"Event"],
    2222                        [type:3, name:"Protocol"], [type:4, name:"Sample"]]
    2323
     
    4343
    4444    /**
    45      * @param entities array of entity:columnindex values
     45     * @param entities array in the format of columnindex:entitytype format
    4646     */
    4747    def properties = { attrs ->
     
    5151        attrs['entities'].each { se ->
    5252            def temp = se.split(":")
    53             def entity = [type:temp[0],columnindex:temp[1]]
     53            def entity = [type:temp[1],columnindex:temp[0]]
    5454            selectedentities.add(entity)
    5555        }
     
    6262
    6363        options.each { e ->
    64             res += "<option value=\"${e.type}:${customvalue}\""
     64            res += "<option value=\"${customvalue}:${e.type}\""
    6565            res += (e.type.toInteger() == selected) ? " selected" : ""
    6666            res += ">${e.name}</option>"
     
    8484
    8585        switch (attrs['entitytype']) {
    86             case 0  : createSelect(-1, "property", t.fields, "1")
    87                      break
     86            case 0  : createPropertySelect(attrs['name'], t.fields, columnindex)
     87                      break
    8888            case 1  : break
    8989            case 2  : break
    9090            case 3  : break
    91             default : out << createPropertySelect("property", t.fields, columnindex)
     91            default : out << createPropertySelect(attrs['name'], t.fields, columnindex)
    9292                     break
    9393        }
Note: See TracChangeset for help on using the changeset viewer.