Changeset 6


Ignore:
Timestamp:
Jan 19, 2011, 2:19:10 PM (12 years ago)
Author:
robert@…
Message:

Resolved two bugs in synchronization:

  • full synchronization didn't work when no studies were present in the database (initial synchronization)
  • synchronization didn't work with spaces in the end of a studyToken
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/application.properties

    r2 r6  
    11#Grails Metadata file
    2 #Thu Dec 23 09:39:58 CET 2010
     2#Wed Jan 19 09:55:04 CET 2011
    33app.build.display.info=0
    44app.grails.version=1.3.6
     
    66app.servlet.version=2.4
    77app.version=0.1
     8plugins.db-util=0.4
    89plugins.famfamfam=1.0.1
    9 plugins.db-util=0.4
    1010plugins.hibernate=1.3.6
     11plugins.jquery=1.4.4.1
     12plugins.jquery-ui=1.8.7
    1113plugins.tomcat=1.3.6
    12 plugins.jquery=1.4.4
    13 plugins.jquery-ui=1.8.7
  • trunk/grails-app/conf/BaseFilters.groovy

    r4 r6  
    100100                        before = {
    101101                                // Never perform full synchronization on rest call when the synchronize controller is used
    102                                 if( controllerName == "rest" || controllerName == "synchronize" ) {
     102                                if( controllerName == "rest" || controllerName == "synchronize" || controllerName == "dbUtil" ) {
    103103                                        return true;
    104104                                }
  • trunk/grails-app/services/nl/tno/metagenomics/integration/GscfService.groovy

    r4 r6  
    120120         * @return ArrayList
    121121         */
    122         public ArrayList getAssays(String sessionToken, String studyToken) {
     122        public ArrayList getAssays(String sessionToken, String studyToken) throws NotAuthorizedException, ResourceNotFoundException {
    123123                try {
    124124                        return this.callGSCF(sessionToken, "getAssays", ["studyToken": studyToken])
     
    139139         * @return ArrayList
    140140         */     
    141         public def getAssay(String sessionToken, String studyToken, String assayToken ) {
     141        public def getAssay(String sessionToken, String studyToken, String assayToken ) throws NotAuthorizedException, ResourceNotFoundException {
    142142                def list
    143143                try {
     
    165165         * @return ArrayList
    166166         */
    167         public ArrayList getSamples(String sessionToken, String assayToken) {
     167        public ArrayList getSamples(String sessionToken, String assayToken) throws NotAuthorizedException, ResourceNotFoundException {
    168168                // Samples of a Study limited to a single Assay
    169169                try {
     
    186186         * @return ArrayList
    187187         */
    188         public def getSample(String sessionToken, String assayToken, String sampleToken) {
     188        public def getSample(String sessionToken, String assayToken, String sampleToken) throws NotAuthorizedException, ResourceNotFoundException {
    189189                def list
    190190
     
    262262                        if( parameter.value instanceof Collection ) {
    263263                                parameter.value.each { value ->
    264                                         addr += "&${parameter.key}=${value}"
     264                                        addr += "&${parameter.key}=" + value.toString().encodeAsURL()
    265265                                }
    266266                        } else {
    267                                 addr += "&${parameter.key}=${parameter.value}"
     267                                addr += "&${parameter.key}=" + parameter.value.toString().encodeAsURL()
    268268                        }
    269269                }
  • trunk/grails-app/services/nl/tno/metagenomics/integration/SynchronizationService.groovy

    r4 r6  
    103103                def studies
    104104                if( eager ) {
    105                         studies = Study.list().findAll { !it.trashcan };
    106                         log.trace "Eager synchronization: " + studies.size();
     105                        studies = []
     106                        log.trace "Eager synchronization";
    107107                } else {
    108108                        studies = Study.findAllWhere( [isDirty: true] );
    109109                        log.trace "Default synchronization: " + studies.size()
     110
     111                        // Perform no synchronization if no studies have to be synchronized
     112                        if( studies.size() == 0 )
     113                                return []
    110114                }
    111115               
    112                 // Perform no synchronization if no studies have to be synchronized
    113116                // Perform synchronization on only one study directly, because otherwise
    114117                // the getStudies method could throw a ResourceNotFoundException or NotAuthorizedException
    115118                // that can better be handled by synchronizeStudy
    116                 if( studies.size() == 0 ) {
    117                         return []
    118                 } else if( studies.size() == 1 ) {
    119                         println "Study: " + studies[ 0]
     119                if( studies.size() == 1 ) {
    120120                        def newStudy = synchronizeStudy( studies[0] );
    121121                        if( newStudy )
  • trunk/grails-app/views/synchronize/full.gsp

    r3 r6  
    2222                                  url: "<g:createLink controller="synchronize" action="perform" />",
    2323                                  success: function(data) { window.location.replace( "${url.encodeAsJavaScript()}" ); },
    24                                   error: function(xhr, textStatus, errorThrown) { alert( "Error " + xhr.responseCode + ": " + textStatus ); window.location.replace( "${url.encodeAsJavaScript()}" ); }
     24                                  error: function(xhr, textStatus, errorThrown) {
     25                                        if( confirm( "Error " + xhr.responseCode + ": " + xhr.responseText + ". Would you like to try again?" ) ) {
     26                                                window.location.refresh();
     27                                        } else {
     28                                                if( confirm( "Would you like to continue to the original page?") ) {
     29                                                        window.location.replace( "${url.encodeAsJavaScript()}" );
     30                                                } else {
     31                                                        $( "#wait_dialog").dialog( "close" );
     32                                                }
     33                                        }                                               
     34                                  }
    2535                                });
    2636                        });
Note: See TracChangeset for help on using the changeset viewer.