Ignore:
Timestamp:
Mar 30, 2012, 11:34:46 AM (10 years ago)
Author:
work@…
Message:
  • added getAssayData api call
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/api/ApiService.groovy

    r2189 r2192  
    1616
    1717import java.security.MessageDigest
     18import dbnp.studycapturing.Assay
     19import dbnp.authentication.SecUser
    1820
    1921class ApiService {
     
    2123    static final String API_SECRET = "th!s_sH0uld^Pr0bab7y_m0v3_t%_th3_uSeR_d0Ma!n_ins7ead!"
    2224    static transactional = true
     25    def moduleCommunicationService
    2326
    2427    /**
     
    5053        }
    5154    }
    52    
    5355
    54     def flattenDomainData(elements) {
     56    /**
     57     * flatten domain data to relevant data to return in an api
     58     * call and not to expose domain internals
     59     *
     60     * @param elements
     61     * @return
     62     */
     63    def flattenDomainData(List elements) {
    5564        println elements.class
    5665        def items = []
     
    8493        return items
    8594    }
     95
     96    def getMeasurements(Assay assay, SecUser user) {
     97        def serviceURL = "${assay.module.url}/rest/getMeasurements"
     98        def serviceArguments = "assayToken=${assay.assayUUID}"
     99
     100        // call module method
     101        def json = moduleCommunicationService.callModuleMethod(
     102                assay.module.url,
     103                serviceURL,
     104                serviceArguments,
     105                "POST",
     106                user
     107        );
     108
     109        return json
     110    }
    86111}
Note: See TracChangeset for help on using the changeset viewer.