- Timestamp:
- May 20, 2010, 2:56:52 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy
r417 r449 29 29 import dbnp.studycapturing.TemplateFieldType 30 30 import dbnp.studycapturing.TemplateField 31 import grails.converters.JSON 31 32 32 33 class ImporterController { 33 def ImporterService 34 def ImporterService 34 35 35 36 /** … … 40 41 41 42 def simplewizard = { 42 def entities = ["Subject", "Event", "Sample"] 43 render(view:"index_simple", model:[studies:Study.list(), entities:entities]) 43 render(view:"index_simple", model:[studies:Study.list(), entities: grailsApplication.config.gscf.domain.importableEntities]) 44 44 } 45 45 … … 160 160 render(view:"step4") 161 161 } 162 163 /** 164 * Return templates which belong to a certain entity type 165 * 166 * @param entity entity name string (Sample, Subject, Study et cetera) 167 * @return JSON object containing the found templates 168 */ 169 def ajaxGetTemplatesByEntity = { 170 def entityClass = grailsApplication.config.gscf.domain.importableEntities.get(params.entity).entity 171 172 // fetch all templates for a specific entity 173 def templates = Template.findAllByEntity(Class.forName(entityClass, true, this.getClass().getClassLoader())) 174 175 println templates 176 177 // render as JSON 178 render templates as JSON 179 } 162 180 }
Note: See TracChangeset
for help on using the changeset viewer.