- Timestamp:
- Aug 25, 2011, 1:52:01 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/visualization/VisualizeController.groovy
r1979 r1981 15 15 package dbnp.visualization 16 16 17 import dbnp.studycapturing.*; 18 import grails.converters.JSON 19 import org.dbnp.gdt.TemplateField 20 17 21 class VisualizeController { 22 def authenticationService 23 18 24 /** 19 25 * Shows the visualization screen 20 26 */ 21 def index = { } 27 def index = { 28 [ studies: Study.giveReadableStudies( authenticationService.getLoggedInUser() )] 29 } 22 30 31 def getStudies = { 32 def studies = Study.giveReadableStudies( authenticationService.getLoggedInUser() ); 33 34 render studies as JSON 35 } 36 37 def getFields = { 38 def entities = [ Study, Subject, Event, SamplingEvent, Sample, Assay ] 39 def fields = []; 40 41 entities.each { entity -> 42 def entityFields = TemplateField.findAll( "from TemplateField where entity = ?", [ entity ] ); 43 44 println "Entity " + entity + " -> " + entityFields 45 46 def domainFields = entity.giveDomainFields(); 47 48 ( domainFields + entityFields ).each { field -> 49 fields << [ "id": field.name, "source": "GSCF", "category": entity.toString(), "name": field.name ] 50 } 51 } 52 53 render fields as JSON 54 } 55 56 def getVisualizationTypes = { 57 def types = [ [ "id": "barchart", "name": "Barchart"] ]; 58 render types as JSON 59 } 60 61 def getData = { 62 def data = [[3,7,9,1,4,6,8,2,5]]; 63 64 render data as JSON 65 } 23 66 24 67 }
Note: See TracChangeset
for help on using the changeset viewer.