Changeset 660
- Timestamp:
- Jul 19, 2010, 12:37:23 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy
r655 r660 211 211 def saveProperties = { 212 212 213 // Find actual Template object from the chosen template name 214 def template = Template.get(session.imported_template_id) 215 213 216 params.columnproperty.index.each { columnindex, property -> 214 def template = Template.get(session.imported_template_id) 215 217 218 // Create an actual class instance of the selected entity with the selected template 219 // This should be inside the closure because in some cases in the advanced importer, the fields can have different target entities 216 220 def entityClass = Class.forName(session.importer_header[columnindex.toInteger()].entity.getName(), true, this.getClass().getClassLoader()) 217 221 def entityObj = entityClass.newInstance(template:template) 218 222 223 // Store the selected property for this column into the column map for the ImporterService 219 224 session.importer_header[columnindex.toInteger()].property = property 220 221 //if it's an identifier set the mapping column true or false 225 // Look up the template field type of the target TemplateField and store it also in the map 226 session.importer_header[columnindex.toInteger()].templatefieldtype = entityObj.giveFields()[property].type 227 228 //if it's an identifier set the mapping column true or false 222 229 entityObj.giveFields().each { 223 230 (it.preferredIdentifier && (it.name==property)) ? session.importer_header[columnindex.toInteger()].identifier = true : false
Note: See TracChangeset
for help on using the changeset viewer.