Ignore:
Timestamp:
Jun 9, 2010, 12:54:12 PM (11 years ago)
Author:
tabma
Message:
  • fixed Advanced Import Wizard (preferredIdentifier issues)
File:
1 edited

Legend:

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

    r534 r545  
    8383        def mc = attrs['mappingcolumn']
    8484        def allfieldtypes = attrs['allfieldtypes']
     85        def domainfields = mc.entity.giveDomainFields().findAll { it.type == mc.templatefieldtype }
     86            domainfields = domainfields.findAll { it.preferredIdentifier != mc.identifier}
    8587
    8688        //def templatefields = (allfieldtypes=="true") ? t.fields : t.fields.findAll { it.type == mc.templatefieldtype }
    8789        def templatefields = (allfieldtypes=="true") ?
    8890            t.fields + mc.entity.giveDomainFields() :
    89             t.fields.findAll { it.type == mc.templatefieldtype } + mc.entity.giveDomainFields()
     91            t.fields.findAll { it.type == mc.templatefieldtype } + domainfields
    9092
    91         (mc.identifier) ? out << "<select style=\"font-size:10px\" name=\"\" disabled><option>Identifier</option></select>":
     93        // map identifier to preferred column
     94        def prefcolumn = mc.entity.giveDomainFields().findAll { it.preferredIdentifier == true }
     95
     96        (mc.identifier) ? out << createPropertySelect(attrs['name'], prefcolumn, mc.index) :
    9297            out << createPropertySelect(attrs['name'], templatefields, mc.index)
    9398    }
Note: See TracChangeset for help on using the changeset viewer.