Changeset 1487
- Timestamp:
- Feb 3, 2011, 10:51:16 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/views/advancedQuery/index.gsp
r1482 r1487 40 40 41 41 <g:if test="${flash.error}"> 42 <div class="error ">42 <div class="errormessage"> 43 43 ${flash.error.toString().encodeAsHTML()} 44 44 </div> -
trunk/src/groovy/dbnp/query/Search.groovy
r1483 r1487 49 49 public void setResultFields( Map r ) { resultFields = r; } 50 50 51 public Search() { 52 def ctx = ApplicationHolder.getApplication().getMainContext(); 53 def authenticationService = ctx.getBean("authenticationService"); 54 def sessionUser = authenticationService?.getLoggedInUser(); 55 56 if( sessionUser ) 57 this.user = sessionUser; 58 else 59 this.user = null 60 } 61 51 62 /** 52 63 * Returns the number of results found by this search … … 215 226 return []; 216 227 217 // Determine the moduleCommunicationService 218 def ctx = (ApplicationContext)ApplicationHolder.getApplication().getMainContext(); 228 // Determine the moduleCommunicationService. Because this object 229 // is mocked in the tests, it can't be converted to a ApplicationContext object 230 def ctx = ApplicationHolder.getApplication().getMainContext(); 219 231 def moduleCommunicationService = ctx.getBean("moduleCommunicationService"); 220 232 -
trunk/src/groovy/dbnp/query/StudySearch.groovy
r1482 r1487 67 67 68 68 def studies = Study.list().findAll { it.canRead( this.user ) }; 69 69 70 70 // If no criteria are found, return all studies 71 71 if( !criteria || criteria.size() == 0 ) { -
trunk/test/unit/dbnp/query/StudySearchTests.groovy
r1478 r1487 5 5 import org.dbnp.gdt.AssayModule 6 6 import org.codehaus.groovy.grails.commons.ApplicationHolder 7 import dbnp.authentication.*; 7 8 8 9 /** … … 33 34 ] 34 35 def assays = [ new Assay( name: 'Assay 1', parent: studies[0], samples: [samples[0]] ), new Assay( name: 'Assay 2', parent: studies[1], samples: [samples[1]] ) ] 36 37 def users = [ new SecUser( username: "abc" ) ]; 35 38 36 39 mockDomain( Study, studies ); … … 42 45 43 46 mockDomain( AssayModule ); 47 mockDomain( SecUser, users ) 48 mockDomain( SecUserSecRole ) 49 mockDomain( SecRole ) 44 50 45 51 subjects.each { it.parent.addToSubjects( it ); } … … 49 55 samples.each { it.parent.addToSamples( it ); } 50 56 assays.each { it.parent.addToAssays( it ); } 57 studies.each { 58 it.owner = users[0] 59 } 51 60 52 61 // some mocks to make sure test doesn't break on finding 'moduleCommunicationService' 53 ApplicationHolder.metaClass.static.getApplication = { [getMainContext: { [getBean: {a -> null}] }] } 62 ApplicationHolder.metaClass.static.getApplication = { [getMainContext: 63 { [getBean: 64 { what -> 65 if( what == "authenticationService" ) 66 return [getLoggedInUser: { return users[0]; } ] 67 else if( what == "moduleCommunicationService" ) 68 return null 69 } 70 ] } 71 ] } 54 72 55 73 } … … 70 88 71 89 // Search without criteria 72 studySearch.setCriteria( 90 studySearch.setCriteria(); 73 91 studySearch.execute(); 74 92 -
trunk/web-app/css/default_style.css
r1485 r1487 196 196 } 197 197 198 /* DISABLED as this is conflicting with other error styles, 199 please rename this in your stuff before enabling again, or 200 move it into a separate css file and/or div element */ 201 #content .disabledEerror { 198 #content .errormessage { 202 199 border: 1px solid #f99; /* #006dba; */ 203 200 margin-bottom: 10px;
Note: See TracChangeset
for help on using the changeset viewer.