source: trunk/grails-app/controllers/nl/tno/metagenomics/StudyController.groovy @ 7

Last change on this file since 7 was 4, checked in by robert@…, 8 years ago

Implemented trash in order to prevent deletion of data

File size: 736 bytes
Line 
1package nl.tno.metagenomics
2
3class StudyController {
4        def synchronizationService
5        def gscfService
6        def fileService
7        def trashService
8       
9        def index = {
10                // Synchronize all studies
11                synchronizationService.sessionToken = session.sessionToken
12                synchronizationService.user = session.user
13
14                synchronizationService.synchronizeStudies()
15               
16                // Clean the upload directory
17                fileService.cleanDirectory();
18               
19                // Clean the trash if needed
20                trashService.cleanTrash();
21               
22                // Filter studies for the ones the user is allowed to see
23                def studies = Study.list();
24                [studies: studies.findAll { it.canRead( session.user ) }, 
25                        gscfAddUrl: gscfService.urlAddStudy(), 
26                        lastSynchronized: synchronizationService.lastFullSynchronization ] 
27        }
28
29}
Note: See TracBrowser for help on using the repository browser.