Ignore:
Timestamp:
Jan 10, 2011, 4:44:44 PM (9 years ago)
Author:
robert@…
Message:

Implemented module notification when a study changes (#259)

Location:
trunk/grails-app/domain/dbnp/studycapturing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/dbnp/studycapturing/AssayModule.groovy

    r1027 r1357  
    1616         */
    1717        String url
     18       
     19        /** Determines whether this module will be notified of changes in studies. This can be used
     20         * to determine when synchronization should take place in a module. The URL called is
     21         *
     22         * [url]/rest/notifyStudyChange?studyToken=abc
     23         *
     24         * @see synchronizationService
     25         */
     26        boolean notify = false;
    1827
    1928        static constraints = {
  • trunk/grails-app/domain/dbnp/studycapturing/Study.groovy

    r1353 r1357  
    1313class Study extends TemplateEntity {
    1414        static searchable = true
     15       
     16        def synchronizationService
    1517
    1618        SecUser owner           // The owner of the study. A new study is automatically owned by its creator.
     
    499501                }
    500502        }
     503
     504        // Send messages to modules about changes in this study
     505        def beforeInsert = {
     506                synchronizationService.invalidateStudy( this );
     507        }
     508        def beforeUpdate = {
     509                synchronizationService.invalidateStudy( this );
     510        }
     511        def beforeDelete = {
     512                synchronizationService.invalidateStudy( this );
     513        }
    501514}
Note: See TracChangeset for help on using the changeset viewer.