Changeset 16 for trunk/grails-app


Ignore:
Timestamp:
Feb 28, 2011, 10:46:51 AM (12 years ago)
Author:
robert@…
Message:

Improvement of the synchronization error handling and changes for deploying the module to dbnptest

Location:
trunk/grails-app
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/config-development.properties

    r7 r16  
    77# server URL
    88grails.serverURL=http://localhost:8184/metagenomics
     9grails.server.port.http=8184
    910
    1011# DATABASE
  • trunk/grails-app/controllers/nl/tno/metagenomics/integration/SynchronizeController.groovy

    r4 r16  
    1010               
    1111                if( !redirectUrl )
    12                         redirectUrl = g.createLink( controller: 'study' );
     12                        redirectUrl = g.createLink( controller: 'run' );
    1313               
    1414                // Set the date of last synchronization to now. Doing it here, prevents the
     
    1818                //                      etc...
    1919                // synchronizationService.lastFullSynchronization = new Date();
    20                        
    2120                [ url: redirectUrl ]
    2221        }
    2322       
    2423        def perform = {
    25                 synchronizationService.sessionToken = session.sessionToken
    26                 synchronizationService.user = session.user
    27 
    28                 synchronizationService.fullSynchronization();
    29 
    30                 render "";
     24                try {
     25                        synchronizationService.sessionToken = session.sessionToken
     26                        synchronizationService.user = session.user
     27       
     28                        synchronizationService.fullSynchronization();
     29                        render "";
     30                } catch( Exception e ) {
     31                        // Catch all exceptions, show them to the user (by rendering a text message) and print a stacktrace
     32                        log.error "Exception during full synchronization: " + e.getMessage()
     33                        e.printStackTrace()
     34                       
     35                        render "An error occurred during synchronization (" + e.class?.name + "): " + e.getMessage();
     36                }
    3137        }
    3238}
  • trunk/grails-app/domain/nl/tno/metagenomics/auth/User.groovy

    r7 r16  
    1515       
    1616        static mapping = {
     17                table 'gscfuser'
    1718                auth cascade: "all-delete-orphan"
    1819        }
  • trunk/grails-app/services/nl/tno/metagenomics/integration/SynchronizationService.groovy

    r14 r16  
    634634                                        // Update the sample object if necessary
    635635                                        sampleFound.name = gscfSample.name
    636                                         sampleFound.subject = gscfSample.subject
    637                                         sampleFound.event = gscfSample.event + ( gscfSample.startTime ? " (" + gscfSample.startTime + ")" : "" )
     636                                        sampleFound.subject = gscfSample.subject.toString()
     637                                        sampleFound.event = gscfSample.event.toString() + ( gscfSample.startTime ? " (" + gscfSample.startTime + ")" : "" )
    638638                                        sampleFound.save();
    639639                                } else {
     
    648648                                                // Update the sample object if necessary
    649649                                                sampleFound.name = gscfSample.name
    650                                                 sampleFound.subject = gscfSample.subject
    651                                                 sampleFound.event = gscfSample.event + ( gscfSample.startTime ? " (" + gscfSample.startTime + ")" : "" )
     650                                                sampleFound.subject = gscfSample.subject.toString()
     651                                                sampleFound.event = gscfSample.event.toString() + ( gscfSample.startTime ? " (" + gscfSample.startTime + ")" : "" )
    652652                                                sampleFound.save();
    653653                                        } else {
     
    656656                                                // If it doesn't exist, create a new object
    657657                                                sampleFound = new Sample( sampleToken: gscfSample.sampleToken, name: gscfSample.name, study: assay.study );
    658                                                 sampleFound.subject = gscfSample.subject
    659                                                 sampleFound.event = gscfSample.event + ( gscfSample.startTime ? " (" + gscfSample.startTime + ")" : "" )
     658                                                sampleFound.subject = gscfSample.subject.toString()
     659                                                sampleFound.event = gscfSample.event.toString() + ( gscfSample.startTime ? " (" + gscfSample.startTime + ")" : "" )
    660660                                                assay.study.addToSamples( sampleFound );
    661661                                                sampleFound.save();
  • trunk/grails-app/views/synchronize/full.gsp

    r6 r16  
    2626                                                window.location.refresh();
    2727                                        } else {
     28                                                alert( "Redirect to: ${url.encodeAsJavaScript()}" );
    2829                                                if( confirm( "Would you like to continue to the original page?") ) {
    2930                                                        window.location.replace( "${url.encodeAsJavaScript()}" );
Note: See TracChangeset for help on using the changeset viewer.