Changeset 1027
- Timestamp:
- Nov 1, 2010, 12:42:49 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/application.properties
r1022 r1027 1 1 #Grails Metadata file 2 #Tue Oct 26 1 5:12:32CEST 20102 #Tue Oct 26 16:55:24 CEST 2010 3 3 app.grails.version=1.3.5 4 4 app.name=gscf -
trunk/grails-app/conf/BootStrapStudies.groovy
r1014 r1027 480 480 name: 'SAM module for clinical data', 481 481 platform: 'clinical measurements', 482 consumer: samURL482 url: samURL 483 483 ).with { if (!validate()) { errors.each { println it} } else save()} 484 484 … … 487 487 name: 'Metabolomics module', 488 488 platform: 'GCMS/LCMS', 489 consumer: nmcdspURL489 url: nmcdspURL 490 490 ).with { if (!validate()) { errors.each { println it} } else save()} 491 491 -
trunk/grails-app/controllers/RestController.groovy
r1017 r1027 145 145 if(study) { 146 146 // Check whether the person is allowed to read the data of this study 147 /*148 147 if( !study.canRead(AuthenticationService.getRemotelyLoggedInUser( params.consumer, params.token ))) { 149 148 response.sendError(401) 150 149 return false 151 150 } 152 */ 151 153 152 def items = [:] 154 153 study.giveFields().each { field -> … … 283 282 284 283 assays.each{ assay -> 285 if (assay.module. consumer.equals(params.consumer )) {284 if (assay.module.url.equals(params.consumer )) { 286 285 if(assay) { 287 286 def map = [:] -
trunk/grails-app/controllers/dbnp/studycapturing/TemplateEditorController.groovy
r996 r1027 16 16 import dbnp.data.* 17 17 import dbnp.studycapturing.* 18 18 19 import dbnp.authentication.AuthenticationService 20 import grails.plugins.springsecurity.Secured 21 19 22 import cr.co.arquetipos.crypto.Blowfish 20 23 import grails.converters.* 21 24 import java.lang.reflect.*; 22 25 26 @Secured(['IS_AUTHENTICATED_REMEMBERED']) 23 27 class TemplateEditorController { 24 28 def entityName; 25 29 def entity; 26 27 30 def AuthenticationService 31 32 /** 33 * Fires after every action and determines the layout of the page 34 */ 35 def afterInterceptor = { model, modelAndView -> 36 if ( params['standalone'] ) { 37 model.layout = 'main'; 38 model.extraparams = [ 'standalone': 'true' ] ; 39 } else { 40 model.layout = 'dialog'; 41 model.extraparams = [] ; 42 } 43 } 28 44 29 45 /** … … 81 97 82 98 // redirect to template editor page of the specified entity 83 redirect(action: "index",params:[entity: resultEntity]) 99 params.entity = resultEntity 100 redirect(action: "index", params:params) 84 101 } 85 86 102 87 103 /** … … 110 126 } 111 127 128 /** 129 * compare two or more templates 130 */ 131 def compare = { 132 // Check whether a right entity is given 133 if( !_checkEntity() ) { 134 return 135 } 136 137 // fetch all templates for this entity 138 def templates = Template.findAllByEntity(entity) 139 140 // Find all available fields 141 def allFields = TemplateField.findAllByEntity( entity ).sort { a, b -> a.name <=> b.name } 142 143 // Generate a human readable entity name 144 def parts = entityName.tokenize( '.' ); 145 def humanReadableEntity = parts[ parts.size() - 1 ]; 146 147 return [ 148 entity: entity, 149 templates: templates, 150 allFields: allFields, 151 encryptedEntity: params.entity, 152 humanReadableEntity: humanReadableEntity, 153 ontologies: params.ontologies, 154 templateEntities: this.templateEntityList() 155 ]; 156 } 157 112 158 /** 113 159 * Shows the editing of a template … … 138 184 def parts = entityName.tokenize( '.' ); 139 185 def humanReadableEntity = parts[ parts.size() - 1 ]; 140 141 142 186 143 187 // Find all available fields … … 836 880 837 881 } 882 883 def templateEntityList = { 884 def entities = [ 885 [ name: 'Study', entity: 'dbnp.studycapturing.Study' ], 886 [ name: 'Subject', entity: 'dbnp.studycapturing.Subject' ], 887 [ name: 'Event', entity: 'dbnp.studycapturing.Event' ], 888 [ name: 'Sampling Event', entity: 'dbnp.studycapturing.SamplingEvent' ], 889 [ name: 'Sample', entity: 'dbnp.studycapturing.Sample' ], 890 [ name: 'Assay', entity: 'dbnp.studycapturing.Assay' ] 891 ] 892 893 entities.each { 894 // add the entity class name to the element 895 // do we have crypto information available? 896 if (grailsApplication.config.crypto) { 897 // generate a Blowfish encrypted and Base64 encoded string. 898 it.encoded = URLEncoder.encode( 899 Blowfish.encryptBase64( 900 it.entity.toString().replaceAll(/^class /, ''), 901 grailsApplication.config.crypto.shared.secret 902 ) 903 ) 904 } else { 905 // base64 only; this is INSECURE! As this class 906 // is instantiated elsewehere. Possibly exploitable! 907 it.encoded = URLEncoder.encode(it.entity.toString().replaceAll(/^class /, '').bytes.encodeBase64()) 908 } 909 } 910 911 return entities 912 } 838 913 } -
trunk/grails-app/domain/dbnp/studycapturing/AssayModule.groovy
r1014 r1027 12 12 String platform 13 13 14 /** Consumer id (e.g., OAuth consuemr key) of module where instance is located */ 15 String consumer 14 /** The base URL at which the module instance is located. This is also used 15 * as a consumer parameter to identify the module in the authentication process. 16 */ 17 String url 16 18 17 19 static constraints = { -
trunk/grails-app/domain/dbnp/studycapturing/Template.groovy
r996 r1027 89 89 */ 90 90 public Template( Template otherTemplate) { 91 this() 92 93 //authenticationService = new AuthenticationService() 94 95 this.name = otherTemplate.name + " (Copy)" 96 this.description = otherTemplate.description 97 this.entity = otherTemplate.entity 98 this.owner = otherTemplate.owner 99 100 // The fields are copied by reference 101 this.fields = otherTemplate.fields 91 this( otherTemplate, otherTemplate.owner ) 102 92 } 103 93 -
trunk/grails-app/views/study/show.gsp
r1009 r1027 240 240 <td>${field}</td> 241 241 <g:each in="${studyList}" var="studyInstance"> 242 <td>${studyInstance.getFieldValue(field.name)}</td> 242 <td> 243 <g:if test="${studyInstance.fieldExists(field.name)}"> 244 ${studyInstance.getFieldValue(field.name)} 245 </g:if> 246 <g:else> 247 - 248 </g:else> 249 </td> 243 250 </g:each> 244 251 </tr> -
trunk/grails-app/views/templateEditor/elements/_liTemplate.gsp
r959 r1027 1 1 <li id="template_${template.id}"class="ui-state-default"> 2 2 <g:if test="${template.inUse()}"> 3 <g:render template="elements/liTemplateNonEditable" model="['template': template ]"/>3 <g:render template="elements/liTemplateNonEditable" model="['template': template, , 'standalone': standalone]"/> 4 4 </g:if> 5 5 <g:else> 6 <g:render template="elements/liTemplateEditable" model="['template': template ]"/>6 <g:render template="elements/liTemplateEditable" model="['template': template, 'standalone': standalone]"/> 7 7 </g:else> 8 8 </li> -
trunk/grails-app/views/templateEditor/elements/_liTemplateEditable.gsp
r996 r1027 7 7 ${template.name} 8 8 9 10 9 <form class="templateField_form" id="template_${template.id}_form" action="updateTemplate"> 11 10 <g:hiddenField name="id" value="${template.id}" /> 12 11 <g:hiddenField name="version" value="${template.version}" /> 12 <g:hiddenField name="standalone" value="${standalone}" /> 13 13 <g:render template="elements/templateForm" model="['template': template]"/> 14 14 <div class="templateFieldButtons"> -
trunk/grails-app/views/templateEditor/elements/_liTemplateNonEditable.gsp
r996 r1027 12 12 <g:hiddenField name="id" value="${template.id}" /> 13 13 <g:hiddenField name="version" value="${template.version}" /> 14 <g:hiddenField name="standalone" value="${standalone}" /> 14 15 <g:render template="elements/templateForm" model="['template': template]"/> 15 16 <div class="templateFieldButtons"> -
trunk/grails-app/views/templateEditor/index.gsp
r996 r1027 17 17 <html> 18 18 <head> 19 <meta name="layout" content=" dialog"/>19 <meta name="layout" content="${layout}"/> 20 20 <title>template editor</title> 21 21 <script src="${createLinkTo(dir: 'js', file: 'templateEditor.js')}" type="text/javascript"></script> 22 22 <link rel="stylesheet" href="${createLinkTo(dir: 'css', file: 'templateEditor.css')}" /> 23 <style type="text/css"> 24 #content .templateEditorStep { font-size: 0.8em; } 25 </style> 26 <script type="text/javascript" language="javascript"> 27 var standalone = ${extraparams?.standalone ? 'true' : 'false'}; 28 </script> 23 29 </head> 24 30 <body> … … 32 38 <li class="empty ui-state-default" <g:if test="${templates.size() > 0 }">style='display: none;'</g:if>>There are no templates for ${humanReadableEntity}. Use the 'Add template' button to add fields.</li> 33 39 <g:each in="${templates}" var="currentTemplate"> 34 <g:render template="elements/liTemplate" model="['template': currentTemplate ]"/>40 <g:render template="elements/liTemplate" model="['template': currentTemplate, 'extraparams': extraparams]"/> 35 41 </g:each> 36 42 </ul> … … 44 50 <g:hiddenField name="entity" value="${encryptedEntity}" /> 45 51 <g:hiddenField name="ontologies" value="${ontologies}" /> 52 <g:hiddenField name="standalone" value="${extraparams?.standalone}" /> 46 53 <g:render template="elements/templateForm" model="['template': null]"/> 47 54 <div class="templateFieldButtons"> … … 55 62 <g:hiddenField name="entity" value="${encryptedEntity}" /> 56 63 <g:hiddenField name="ontologies" value="${ontologies}" /> 64 <g:hiddenField name="standalone" value="${extraparams?.standalone}" /> 57 65 <input type="hidden" name="template" id="templateSelect" value="${template?.id}"> 58 66 </g:form> 59 67 </div> 60 68 <br clear="all" /> 61 69 <div id="wait" class="wait"> 62 70 -
trunk/grails-app/views/templateEditor/template.gsp
r996 r1027 17 17 <html> 18 18 <head> 19 <meta name="layout" content=" dialog"/>19 <meta name="layout" content="${layout}"/> 20 20 <title>template editor</title> 21 21 <script src="${createLinkTo(dir: 'js', file: 'templateEditor.js')}" type="text/javascript"></script> … … 26 26 <script type="text/javascript" src="${resource(dir: 'js', file: 'ontology-chooser.js')}"></script> 27 27 </g:else> 28 29 <style type="text/css"> 30 #content .templateEditorStep { font-size: 0.8em; } 31 </style> 28 32 </head> 29 33 <body> … … 80 84 <g:if test="${template}"> 81 85 <div class="templateEditorStep" id="step2_selectedFields"> 82 <h3 class="templateName">${template.name} (<a class="switch" href="${createLink(action:'index' )}?entity=${encryptedEntity.encodeAsURL()}">switch</a>)</h3>86 <h3 class="templateName">${template.name} (<a class="switch" href="${createLink(action:'index',params: extraparams + [ 'entity': encryptedEntity ])}">switch</a>)</h3> 83 87 84 88 <p>Currently, this template contains the following fields. Drag fields to reorder. Drag fields to the list of available fields to remove the field from the template.</p> … … 117 121 </div> 118 122 </g:if> 119 123 <br clear="all" /> 120 124 <div id="ontologyDialog"> 121 125 <g:render template="ontologyDialog" /> -
trunk/web-app/css/templateEditor.css
r996 r1027 97 97 .wait { display: none; } 98 98 99 /* Compare templates view */ 100 .dataTables_length { float: left; width: 40%; } 101 .dataTables_filter { float: right; width: 50%; text-align: right; } 102 table#compare_templates { clear: both; } 103 .dataTables_info { float: left; width: 40%; line-height: 25px; } 104 .dataTables_paginate { float: right; text-align: right; width: 50%; padding-top: 5px; } 105 106 .paging_full_numbers span.paginate_active { background:none repeat scroll 0 0 #2E6AB1; color:#FFFFFF; } 107 .paging_full_numbers span.paginate_button, .paging_full_numbers span.paginate_active { 108 border:1px solid #CCCCCC; margin-right:2px; padding:1px 6px; text-decoration:none; 109 cursor: pointer; 110 } 111 112 113 114 99 115 /* Add Ontology dialog */ 100 116 #addOntology { list-style-type: none; padding-left: 0; }
Note: See TracChangeset
for help on using the changeset viewer.