Changeset 251
- Timestamp:
- Mar 9, 2010, 3:53:46 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy
r247 r251 23 23 import org.apache.poi.ss.usermodel.DataFormatter 24 24 import dbnp.studycapturing.Template 25 import dbnp.studycapturing.Study 26 import dbnp.studycapturing.Subject 27 import dbnp.studycapturing.Event 28 import dbnp.studycapturing.Protocol 29 import dbnp.studycapturing.Sample 30 import dbnp.studycapturing.TemplateFieldType 25 31 26 32 class ImporterController { … … 53 59 54 60 render (view:"step1", model:[header:header, datamatrix:datamatrix]) 55 56 61 } 57 62 58 63 /** 59 64 * User has assigned all entities and celltypes to the columns and continues to the next step (assigning properties to columns) 65 * All information of the columns is stored in a session as MappingColumn object 60 66 * 61 67 * @param entity list of entities and columns it has been assigned to (columnindex:entitytype format) 62 68 * @param celltype list of celltypes and columns it has been assigned to (columnindex:celltype format) 63 69 * @return properties page 70 * 71 * @see celltype: http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Cell.html 64 72 */ 65 73 def savepreview = { … … 69 77 celltypes.each { c -> 70 78 def temp = c.split(":") 79 def celltype = temp[1].toInteger() 80 def templatefieldtype = TemplateFieldType.STRING 71 81 72 session.header[temp[0].toInteger()].celltype = temp[1].toInteger() 82 session.header[temp[0].toInteger()].celltype = celltype 83 84 switch (celltype) { 85 case 0 : templatefieldtype = TemplateFieldType.INTEGER 86 break 87 case 1 : templatefieldtype = TemplateFieldType.STRING 88 break 89 case 2 : // formula cell type, cannot handle this 90 break 91 case 3 : templatefieldtype = TemplateFieldType.STRING 92 break 93 default: break 94 } 73 95 } 74 96 … … 76 98 def temp = e.split(":") 77 99 Class clazz 78 switch (temp[1]) { 100 101 switch (temp[1].toInteger()) { 79 102 case 0: clazz = Study 80 103 break … … 87 110 case 4: clazz = Sample 88 111 break 89 default: clazz = String112 default: clazz = Object 90 113 } 114 115 session.header[temp[0].toInteger()].index = temp[0].toInteger() 91 116 session.header[temp[0].toInteger()].entity = clazz 92 117 } … … 106 131 def saveproperties = { 107 132 108 /*def columnproperties = request.getParameterValues("columnproperty")133 def columnproperties = request.getParameterValues("columnproperty") 109 134 columnproperties.each { cp -> 110 135 def temp = cp.split(":") 111 session.header[temp[0]] 112 }*/ 136 session.header[temp[0].toInteger()].property = temp[1].toInteger() 137 } 138 113 139 for (e in session.header) { 114 140 println e -
trunk/grails-app/domain/dbnp/importer/MappingColumn.groovy
r247 r251 13 13 14 14 String name 15 dbnp.studycapturing.TemplateFieldType t ype15 dbnp.studycapturing.TemplateFieldType templatefieldtype 16 16 Class entity 17 17 String property … … 25 25 26 26 String toString() { 27 return name + "/" + type + "/" + entity + "/" + property + "/" + celltype + "/" + index + "/" + value27 return "Name:" + name + "/Type:" + templatefieldtype + "/Entity:" + entity + "/Property:" + property + "/Celltype:" + celltype + "/Index:" + index + "/Value:" + value 28 28 } 29 29 } -
trunk/grails-app/domain/dbnp/studycapturing/TemplateStudyField.groovy
- Property svn:keywords changed from Rev Date Author to Date Author Rev
-
trunk/grails-app/taglib/dbnp/importer/ImporterTagLib.groovy
r247 r251 22 22 [type:3, name:"Protocol"], [type:4, name:"Sample"]] 23 23 24 def standardcelltypes = [[type:0, name:"Numeric"], [type:1, name:"String"], [type:2, name:"Formula"], 25 [type:3, name:"Blank"], [type:4, name:"Boolean"], [type:5, name:"Error"]] 24 def standardcelltypes = [ 25 [type:0, name:"Numeric"], [type:1, name:"String"], [type:2, name:"Formula"], 26 [type:3, name:"Blank"], [type:4, name:"Boolean"], [type:5, name:"Error"], [type:6, name:"Date"], 27 [type:7, name:"Float"], [type:8, name:"Double"], [type:9, name:"List of items"], [type:10, name:"Ontologyterm"] 28 ] 26 29 27 30 /**
Note: See TracChangeset
for help on using the changeset viewer.