Ignore:
Timestamp:
Oct 28, 2010, 4:39:45 PM (13 years ago)
Author:
j.saito@…
Message:

Ticket #57 - Unified getAssays and getAssay.

Also, added convenience method for checking the params object in RestControllers? in CommunicationManager?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/groovy/dbnp/rest/common/CommunicationManager.groovy

    r934 r1010  
    44import java.net.URLEncoder
    55import org.codehaus.groovy.grails.web.json.*
     6
    67
    78/**  CommunicationManager
     
    264265
    265266
     267    /**
     268     * Give list of missing parameters for a parameter call in a RestController.
     269     * 
     270     * @params params Map params        The parameter list required by this view.
     271     * @params requiredParamers                 List of parameter names that must be provided
     272     * @return true, if params has all required parameters, false otherwise
     273     */ 
     274        static String hasValidParams( params, Object [] requiredParams ) {
     275                def list = []
     276                requiredParams.each { p ->
     277                        if( !params[p] ) list.push p
     278                }
     279                if(list.size()>0) { return true }
     280                return false
     281        }
     282
     283
    266284
    267285}
Note: See TracChangeset for help on using the changeset viewer.