Changeset 256 for trunk/grails-app/controllers
- Timestamp:
- Mar 11, 2010, 11:48:16 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy
r255 r256 62 62 63 63 /** 64 * User has assigned all entities and celltypes to the columns and continues to the next step (assigning properties to columns)64 * User has assigned all entities and templatefieldtypes to the columns and continues to the next step (assigning properties to columns) 65 65 * All information of the columns is stored in a session as MappingColumn object 66 66 * 67 67 * @param entity list of entities and columns it has been assigned to (columnindex:entitytype format) 68 * @param celltype list of celltypes and columns it has been assigned to (columnindex:celltype format)68 * @param templatefieldtype list of celltypes and columns it has been assigned to (columnindex:templatefieldtype format) 69 69 * @return properties page 70 70 * 71 71 * @see celltype: http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Cell.html 72 72 */ 73 def savepreview = { 73 def savepreview = { 74 def tft = null 74 75 def entities = request.getParameterValues("entity") 75 def celltypes = request.getParameterValues("celltype")76 def templatefieldtypes = request.getParameterValues("templatefieldtype") 76 77 77 celltypes.each { c -> 78 def temp = c.split(":") 79 def celltype = temp[1].toInteger() 80 def templatefieldtype = TemplateFieldType.STRING 78 templatefieldtypes.each { t -> 79 def temp = t.split(":") 80 def templatefieldtype = temp[1] 81 81 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 case 4 : templatefieldtype = TemplateFieldType.STRING 94 break 82 switch (templatefieldtype) { 83 case "STRING" : tft = TemplateFieldType.STRING 84 break 85 case "TEXT" : tft = TemplateFieldType.TEXT 86 break 87 case "INTEGER" : tft = TemplateFieldType.INTEGER 88 break 89 case "FLOAT" : tft = TemplateFieldType.FLOAT 90 break 91 case "DOUBLE" : tft = TemplateFieldType.DOUBLE 92 break 93 case "STRINGLIST" : tft = TemplateFieldType.STRINGLIST 94 break 95 case "ONTOLOGYTERM" : tft = TemplateFieldType.ONTOLOGYTERM 96 break 97 case "DATE" : tft = TemplateFieldType.DATE 98 break 95 99 default: break 96 100 } 101 session.header[temp[0].toInteger()].templatefieldtype = tft 97 102 } 98 103 99 104 entities.each { e -> 100 105 def temp = e.split(":") 101 Class clazz 106 Class clazz 102 107 103 108 switch (temp[1].toInteger()) { … … 113 118 break 114 119 default: clazz = Object 120 break 115 121 } 116 122 … … 132 138 */ 133 139 def saveproperties = { 140 def columnproperties = request.getParameterValues("columnproperty") 134 141 135 def columnproperties = request.getParameterValues("columnproperty")136 142 columnproperties.each { cp -> 137 143 def temp = cp.split(":")
Note: See TracChangeset
for help on using the changeset viewer.