Changeset 1588 for trunk/grails-app/controllers/dbnp
- Timestamp:
- Mar 4, 2011, 12:30:52 PM (11 years ago)
- Location:
- trunk/grails-app/controllers/dbnp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/authentication/LoginController.groovy
r1430 r1588 28 28 * Dependency injection for the GSCF authentication service 29 29 */ 30 def AuthenticationService30 def authenticationService 31 31 32 32 /** … … 75 75 // If the user is already authenticated with this session_id, redirect 76 76 // him 77 if( AuthenticationService.isRemotelyLoggedIn( consumer, token ) ) {77 if( authenticationService.isRemotelyLoggedIn( consumer, token ) ) { 78 78 if( returnUrl ) { 79 79 redirect url: returnUrl … … 85 85 // If the user is already logged in locally, we log him in and 86 86 // immediately redirect him 87 if ( AuthenticationService.isLoggedIn()) {88 AuthenticationService.logInRemotely( consumer, token, AuthenticationService.getLoggedInUser() )87 if (authenticationService.isLoggedIn()) { 88 authenticationService.logInRemotely( consumer, token, authenticationService.getLoggedInUser() ) 89 89 90 90 if( returnUrl ) { -
trunk/grails-app/controllers/dbnp/authentication/LogoutController.groovy
r1482 r1588 4 4 5 5 class LogoutController { 6 def AuthenticationService6 def authenticationService 7 7 8 8 /** … … 24 24 if( params.consumer || params.token ) { 25 25 // Log out the remote user 26 AuthenticationService.logOffRemotely( params.consumer, params.token )26 authenticationService.logOffRemotely( params.consumer, params.token ) 27 27 } 28 28 -
trunk/grails-app/controllers/dbnp/exporter/ExporterController.groovy
r1456 r1588 1 1 /** 2 * ExporterController Control er2 * ExporterController Controller 3 3 * 4 4 * Description of my controller … … 32 32 class ExporterController { 33 33 34 def AuthenticationService 35 def ImporterService 34 def authenticationService 36 35 37 36 /* … … 41 40 def index = { 42 41 43 def user = AuthenticationService.getLoggedInUser()42 def user = authenticationService.getLoggedInUser() 44 43 def max = Math.min(params.max ? params.int('max') : 10, 100) 45 44 -
trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy
r1562 r1588 27 27 def authenticationService 28 28 def fileService 29 def ImporterService29 def importerService 30 30 def validationTagLib = new ValidationTagLib() 31 def GdtService31 def gdtService 32 32 33 33 /** … … 114 114 115 115 if (params.entity) { 116 flash.importer_datatemplates = Template.findAllByEntity( GdtService.getInstanceByEntity(params.entity.decodeURL()))116 flash.importer_datatemplates = Template.findAllByEntity(gdtService.getInstanceByEntity(params.entity.decodeURL())) 117 117 } 118 118 … … 133 133 134 134 if (params.entity) { 135 flash.importer_datatemplates = Template.findAllByEntity( GdtService.getInstanceByEntity(params.entity.decodeURL()))135 flash.importer_datatemplates = Template.findAllByEntity(gdtService.getInstanceByEntity(params.entity.decodeURL())) 136 136 } 137 137 … … 320 320 def ajaxGetTemplatesByEntity = { 321 321 // fetch all templates for a specific entity 322 def templates = Template.findAllByEntity( GdtService.getInstanceByEntity(params.entity.decodeURL()))322 def templates = Template.findAllByEntity(gdtService.getInstanceByEntity(params.entity.decodeURL())) 323 323 324 324 … … 340 340 if (importedfile.exists()) { 341 341 try { 342 session.importer_workbook = ImporterService.getWorkbook(new FileInputStream(importedfile))342 session.importer_workbook = importerService.getWorkbook(new FileInputStream(importedfile)) 343 343 } catch (Exception e) { 344 344 log.error ".importer wizard could not load file: " + e … … 351 351 352 352 try { 353 session.importer_workbook = ImporterService.getWorkbook(new FileInputStream(importedfile))353 session.importer_workbook = importerService.getWorkbook(new FileInputStream(importedfile)) 354 354 } catch (Exception e) { 355 355 log.error ".importer wizard could not load file: " + e … … 360 360 def selectedentities = [] 361 361 362 def entityName = GdtService.decryptEntity(params.entity.decodeURL())363 def entityClass = GdtService.getInstanceByEntityName(entityName)362 def entityName = gdtService.decryptEntity(params.entity.decodeURL()) 363 def entityClass = gdtService.getInstanceByEntityName(entityName) 364 364 365 365 // Initialize some session variables … … 371 371 flow.importer_headerrow = params.headerrow.toInteger() 372 372 flow.importer_entityclass = entityClass 373 flow.importer_entity = GdtService.cachedEntities.find{ it.entity==entityName }373 flow.importer_entity = gdtService.cachedEntities.find{ it.entity==entityName } 374 374 375 375 // Get the header from the Excel file using the arguments given in the first step of the wizard 376 flow.importer_header = ImporterService.getHeader(session.importer_workbook,376 flow.importer_header = importerService.getHeader(session.importer_workbook, 377 377 flow.importer_sheetindex, 378 378 flow.importer_headerrow, … … 380 380 entityClass) 381 381 382 session.importer_datamatrix = ImporterService.getDatamatrix(382 session.importer_datamatrix = importerService.getDatamatrix( 383 383 session.importer_workbook, flow.importer_header, 384 384 flow.importer_sheetindex, … … 437 437 // Create an actual class instance of the selected entity with the selected template 438 438 // This should be inside the closure because in some cases in the advanced importer, the fields can have different target entities 439 //def entityClass = GdtService.getInstanceByEntityName(flow.importer_header[columnindex.toInteger()].entity.getName())439 //def entityClass = gdtService.getInstanceByEntityName(flow.importer_header[columnindex.toInteger()].entity.getName()) 440 440 def entityObj = flow.importer_entityclass.newInstance(template:template) 441 441 … … 520 520 521 521 // Import the workbook and store the table with entity records and store the failed cells 522 def (table, failedcells) = ImporterService.importData(flow.importer_template_id,522 def (table, failedcells) = importerService.importData(flow.importer_template_id, 523 523 session.importer_workbook, 524 524 flow.importer_sheetindex, … … 661 661 //def (validatedSuccesfully, updatedEntities, failedToPersist) = 662 662 //try { 663 ImporterService.saveDatamatrix(flow.importer_study, flow.importer_importeddata, authenticationService, log)663 importerService.saveDatamatrix(flow.importer_study, flow.importer_importeddata, authenticationService, log) 664 664 665 665 //} -
trunk/grails-app/controllers/dbnp/studycapturing/StudyController.groovy
r1494 r1588 11 11 */ 12 12 class StudyController { 13 def AuthenticationService13 def authenticationService 14 14 15 15 //static allowedMethods = [save: "POST", update: "POST", delete: "POST"] … … 24 24 def list = { 25 25 26 def user = AuthenticationService.getLoggedInUser()26 def user = authenticationService.getLoggedInUser() 27 27 def max = Math.min(params.max ? params.int('max') : 10, 100) 28 28 def offset = params.offset ? params.int( 'offset' ) : 0 … … 37 37 @Secured(['IS_AUTHENTICATED_REMEMBERED']) 38 38 def myStudies = { 39 def user = AuthenticationService.getLoggedInUser()39 def user = authenticationService.getLoggedInUser() 40 40 def max = Math.min(params.max ? params.int('max') : 10, 100) 41 41 def offset = params.offset ? params.int( 'offset' ) : 0 … … 88 88 else { 89 89 // Check whether the user may see this study 90 def loggedInUser = AuthenticationService.getLoggedInUser()90 def loggedInUser = authenticationService.getLoggedInUser() 91 91 if( !studyInstance.canRead(loggedInUser) ) { 92 92 flash.message = "You have no access to this study" … … 111 111 return 112 112 113 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: AuthenticationService.getLoggedInUser() ]113 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: authenticationService.getLoggedInUser() ] 114 114 } 115 115 … … 124 124 return 125 125 126 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: AuthenticationService.getLoggedInUser() ]126 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: authenticationService.getLoggedInUser() ] 127 127 } 128 128 … … 137 137 return 138 138 139 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: AuthenticationService.getLoggedInUser() ]139 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: authenticationService.getLoggedInUser() ] 140 140 } 141 141 … … 150 150 return 151 151 152 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: AuthenticationService.getLoggedInUser() ]152 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: authenticationService.getLoggedInUser() ] 153 153 } 154 154 … … 163 163 return 164 164 165 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: AuthenticationService.getLoggedInUser() ]165 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: authenticationService.getLoggedInUser() ] 166 166 } 167 167 … … 176 176 return 177 177 178 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: AuthenticationService.getLoggedInUser() ]178 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: authenticationService.getLoggedInUser() ] 179 179 } 180 180 … … 189 189 return 190 190 191 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: AuthenticationService.getLoggedInUser() ]191 [studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ), loggedInUser: authenticationService.getLoggedInUser() ] 192 192 } 193 193 … … 236 236 // Check whether the user may see these studies 237 237 def studiesAllowed = [] 238 def loggedInUser = AuthenticationService.getLoggedInUser()238 def loggedInUser = authenticationService.getLoggedInUser() 239 239 240 240 studyList.each { studyInstance -> … … 262 262 else { 263 263 // Check whether the user may see this study 264 def loggedInUser = AuthenticationService.getLoggedInUser()264 def loggedInUser = authenticationService.getLoggedInUser() 265 265 if( !studyInstance.canRead(loggedInUser) ) { 266 266 flash.message = "You have no access to this study"
Note: See TracChangeset
for help on using the changeset viewer.