Changeset 1443
- Timestamp:
- Jan 26, 2011, 9:47:40 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/application.properties
r1441 r1443 1 1 #Grails Metadata file 2 #Wed Jan 26 11:14:11CET 20112 #Wed Jan 26 21:41:18 CET 2011 3 3 app.build.display.info=0 4 4 app.build.svn.revision=1079 … … 13 13 plugins.db-util=0.4 14 14 plugins.famfamfam=1.0.1 15 plugins.gdt=0.0. 415 plugins.gdt=0.0.5 16 16 plugins.grom=0.2.2 17 17 plugins.hibernate=1.3.6 -
trunk/grails-app/conf/Config.groovy
r1430 r1443 94 94 } 95 95 96 // cryptography settings97 // @see WizardTaglib.groovy (encrypt)98 // @see TemplateEditorController.groovy (decrypt)99 crypto {100 shared.secret = RandomStringUtils.random(32, true, true)101 }102 103 // GSCF specific configuration104 gscf {105 domain = [106 // importable entities107 // use: grailsApplication.config.gscf.domain.entities108 entities: [109 // dbnp.data110 'dbnp.data.FeatureBase',111 'dbnp.data.FeatureType',112 'dbnp.data.Ontology',113 'dbnp.data.Term',114 115 // dbnp.studycapturing116 'dbnp.studycapturing.Assay',117 'dbnp.studycapturing.AssayModule',118 'dbnp.studycapturing.AssayType',119 'dbnp.studycapturing.Compound',120 'dbnp.studycapturing.Event',121 'dbnp.studycapturing.EventGroup',122 'dbnp.studycapturing.Person',123 'dbnp.studycapturing.PersonAffilitation',124 'dbnp.studycapturing.PersonRole',125 'dbnp.studycapturing.Publication',126 'dbnp.studycapturing.Sample',127 'dbnp.studycapturing.SamplingEvent',128 'dbnp.studycapturing.Study',129 'dbnp.studycapturing.StudyPerson',130 'dbnp.studycapturing.Subject',131 'dbnp.studycapturing.Template',132 'dbnp.studycapturing.TemplateEntity',133 'dbnp.studycapturing.TemplateField',134 'dbnp.studycapturing.TemplateFieldListItem',135 'dbnp.studycapturing.TemplateFieldType'136 ],137 138 // importable entities139 // use: grailsApplication.config.gscf.domain.importableEntities140 // @see ImporterController141 importableEntities: [142 event: [name: 'Event', entity: 'dbnp.studycapturing.Event', encrypted:''],143 sample: [name: 'Sample', entity: 'dbnp.studycapturing.Sample', encrypted:''],144 study: [name: 'Study', entity: 'dbnp.studycapturing.Study', encrypted:''],145 subject: [name: 'Subject', entity: 'dbnp.studycapturing.Subject', encrypted:''],146 samplingevent: [name: 'SamplingEvent', entity: 'dbnp.studycapturing.SamplingEvent', encrypted:'']147 148 ]149 ]150 }151 152 96 // jquery plugin 153 97 grails.views.javascript.library = "jquery" -
trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy
r1430 r1443 5 5 import org.apache.poi.ss.usermodel.Workbook 6 6 import grails.converters.JSON 7 import cr.co.arquetipos.crypto.Blowfish7 //import cr.co.arquetipos.crypto.Blowfish 8 8 import org.codehaus.groovy.grails.plugins.web.taglib.ValidationTagLib 9 9 import grails.plugins.springsecurity.Secured … … 32 32 def ImporterService 33 33 def validationTagLib = new ValidationTagLib() 34 def GdtService 34 35 35 36 /** … … 40 41 // Grom a development message 41 42 if (pluginManager.getGrailsPlugin('grom')) "redirecting into the webflow".grom() 42 43 // TODO --> move this logic to the application Bootstrapping as this44 // does not need to run every time the importer is started45 //46 // encrypt the importable entities47 grailsApplication.config.gscf.domain.importableEntities.each {48 it.value.encrypted =49 URLEncoder.encode(Blowfish.encryptBase64(50 it.value.entity.toString().replaceAll(/^class /, ''),51 grailsApplication.config.crypto.shared.secret52 ))53 }54 43 55 44 /** … … 120 109 flow.page = 1 121 110 flow.studies = Study.findAllWhere(owner: authenticationService.getLoggedInUser()) 122 flow.importer_importableentities = grailsApplication.config.gscf.domain.importableEntities111 flow.importer_importableentities = GdtService.getTemplateEntities() 123 112 124 113 success() … … 298 287 */ 299 288 def ajaxGetTemplatesByEntity = { 300 def entityName = Blowfish.decryptBase64(301 URLDecoder.decode(params.entity),302 grailsApplication.config.crypto.shared.secret303 )304 305 //def entityClass = grailsApplication.config.gscf.domain.importableEntities.get(params.entity).entity306 def entityClass = entityName307 308 289 // fetch all templates for a specific entity 309 def templates = Template.findAllByEntity(Class.forName(entityClass, true, this.getClass().getClassLoader())) 290 def templates = Template.findAllByEntity(GdtService.getInstanceByEntity(params.entity.decodeURL())) 291 310 292 311 293 // render as JSON … … 330 312 def selectedentities = [] 331 313 332 def entityName = Blowfish.decryptBase64( 333 URLDecoder.decode(params.entity), 334 grailsApplication.config.crypto.shared.secret 335 ) 336 337 def entityClass = Class.forName(entityName, true, this.getClass().getClassLoader()) 314 def entityName = GdtService.decryptEntity(params.entity.decodeURL()) 315 def entityClass = GdtService.getInstanceByEntityName(entityName) 338 316 339 317 // Initialize some session variables -
trunk/grails-app/taglib/dbnp/importer/ImporterTagLib.groovy
r1430 r1443 24 24 static namespace = 'importer' 25 25 def ImporterService 26 def GdtService 26 27 27 28 /** … … 168 169 def res = "<select style=\"font-size:10px\" name=\"${name}.index.${custval}\">" 169 170 170 grailsApplication.config.gscf.domain.importableEntities.each { e -> 171 res += "<option value=\"${e.value.name}\"" 172 res += (e.value.type == sel) ? " selected" : "" 173 res += ">${e.value.name}</option>" 171 GdtService.getTemplateEntities().each { e -> 172 res += "<option value\"${e.name}\"" 173 res += ">${e.name} bla</option>" 174 174 } 175 175 -
trunk/grails-app/views/importer/common/_properties_horizontal.gsp
r1430 r1443 32 32 <table> 33 33 <g:each var="stdentity" in ="${importer_importableentities}"> 34 <% if (importer_selectedentities.any { it.name.toLowerCase() == stdentity. value.entity.toLowerCase() } && stdentity.value.entity!="") { %>34 <% if (importer_selectedentities.any { it.name.toLowerCase() == stdentity.entity.toLowerCase() } && stdentity.entity!="") { %> 35 35 36 <tr><td colspan="3"><h4>${stdentity. value.name}</h4></td></tr>36 <tr><td colspan="3"><h4>${stdentity.name}</h4></td></tr> 37 37 <tr> 38 38 <td class="header" width="25px"><input id="clearselect" type="button" value="clear" name="clearselect"></td> 39 39 <g:each var="selentity" in="${importer_selectedentities}"> 40 <g:if test="${selentity.name.toLowerCase()==stdentity. value.entity.toLowerCase()}">40 <g:if test="${selentity.name.toLowerCase()==stdentity.entity.toLowerCase()}"> 41 41 <td class="header" width="200px"> 42 42 <b>${importer_header[selentity.columnindex.toInteger()].name}</b> … … 60 60 </g:each> 61 61 62 <% } %> <!-- end of JSP if-->63 </g:each> 62 <% } %> <!-- end of JSP if--> 63 </g:each> 64 64 </table> -
trunk/grails-app/views/importer/pages/_page_one.gsp
r1430 r1443 1 <%@ page import="nl.grails.plugins.gdt.GdtService" %> 1 2 <% 2 3 /** … … 65 66 name="entity" 66 67 id="entity" 67 from="${ importer_importableentities}"68 optionValue="${{it. value.name}}"69 optionKey="${{it. value.encrypted}}"68 from="${GdtService.cachedEntities}" 69 optionValue="${{it.name}}" 70 optionKey="${{it.encoded}}" 70 71 noSelection="['':'-Choose type of data-']" 71 72 onChange="${remoteFunction( controller: 'importer',
Note: See TracChangeset
for help on using the changeset viewer.