Changeset 350 for trunk/grails-app/services
- Timestamp:
- Apr 19, 2010, 3:45:35 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/dbnp/importer/ImporterService.groovy
r334 r350 19 19 import org.apache.poi.poifs.filesystem.POIFSFileSystem 20 20 import org.apache.poi.ss.usermodel.DataFormatter 21 import org.apache.poi.hssf.usermodel.HSSFDateUtil 21 22 22 import dbnp.studycapturing.TemplateFieldType 23 23 import dbnp.studycapturing.Template … … 25 25 import dbnp.studycapturing.Subject 26 26 import dbnp.studycapturing.Event 27 import dbnp.studycapturing.Protocol 27 28 28 import dbnp.studycapturing.Sample 29 29 30 import dbnp.data.Ontology31 30 import dbnp.data.Term 32 31 … … 223 222 persistEntity(entity) 224 223 break 225 case Protocol: print "Persisting Protocol `" + entity.name + "`: "226 persistEntity(entity)227 break228 224 case Sample : print "Persisting Sample `" + entity.name +"`: " 229 225 persistEntity(entity) … … 264 260 def subject = new Subject(name:"New subject", species:Term.findByName("Homo sapiens"), template:template) 265 261 def event = new Event(eventdescription:"New event", template:template) 266 def protocol = new Protocol(name:"New protocol", template:template)267 262 def sample = new Sample(name:"New sample", template:template) 268 263 … … 283 278 if (mc.identifier) { event.eventdescription = value; break } 284 279 event.setFieldValue(mc.property.name, value) 285 break286 case Protocol : (record.any {it.getClass()==mc.entity}) ? 0 : record.add(protocol)287 if (mc.identifier) { protocol.name = value; break }288 protocol.setFieldValue(mc.property.name, value)289 280 break 290 281 case Sample : (record.any {it.getClass()==mc.entity}) ? record.add(sample) : 0
Note: See TracChangeset
for help on using the changeset viewer.