Changeset 245 for trunk/grails-app/controllers
- Timestamp:
- Mar 8, 2010, 5:53:30 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy
r215 r245 57 57 58 58 /** 59 * User has assigned all entities to the columns and continues to the next step (assigning properties to columns)59 * User has assigned all entities and celltypes to the columns and continues to the next step (assigning properties to columns) 60 60 * 61 * @param entity list of entities 61 * @param entity list of entities and columns it has been assigned to (columnindex:entitytype format) 62 * @param celltype list of celltypes and columns it has been assigned to (columnindex:celltype format) 62 63 * @return properties page 63 64 */ 64 65 def savepreview = { 65 66 def entities = request.getParameterValues("entity") 67 def celltypes = request.getParameterValues("celltype") 68 69 celltypes.each { c -> 70 def temp = c.split(":") 71 72 session.header[temp[0].toInteger()].celltype = temp[1].toInteger() 73 } 74 75 entities.each { e -> 76 def temp = e.split(":") 77 Class clazz 78 switch (temp[1]) { 79 case 0: clazz = Study 80 break 81 case 1: clazz = Subject 82 break 83 case 2: clazz = Event 84 break 85 case 3: clazz = Protocol 86 break 87 case 4: clazz = Sample 88 break 89 default: clazz = String 90 } 91 session.header[temp[0].toInteger()].entity = clazz 92 } 66 93 67 94 // currently only one template is used for all entities … … 72 99 render(view:"step2", model:[entities:entities, header:session.header, templates:templates]) 73 100 } 101 102 /** 103 * @param columnproperty array of columns and the assigned property in `column:property_id` format 104 * 105 */ 106 def saveproperties = { 107 108 /*def columnproperties = request.getParameterValues("columnproperty") 109 columnproperties.each { cp -> 110 def temp = cp.split(":") 111 session.header[temp[0]] 112 }*/ 113 for (e in session.header) { 114 println e 115 } 116 render ("properties saved") 117 } 74 118 }
Note: See TracChangeset
for help on using the changeset viewer.