src/aria/templates/ModuleCtrl.js
function (targetService, jsonData, cb, options) {
            var typeUtils = ariaUtilsType;
            // change cb as an object if a string or a function is passed as a
            // callback
            if (typeUtils.isString(cb) || typeUtils.isFunction(cb)) {
                var ncb = {
                    fn : cb,
                    scope : this
                };
                cb = ncb;
            } else if (typeUtils.isObject(cb) && cb.scope == null) {
                cb.scope = this; // default scope = this
            }
            if (!options) {
                options = {};
            }
            var wrapCB = {
                fn : this._submitJsonRequestCB,
                scope : this,
                args : {
                    cb : cb
                }
            };
            // Request object constructed with all necessary properties
            var requestObject = {
                moduleName : this.$package,
                session : this._session,
                actionQueuing : null,
                requestHandler : this.$requestHandler,
                urlService : this.$urlService,
                requestJsonSerializer : this.$requestJsonSerializer,
                async : options.async,
                timeout : options.timeout,
                headers : options.headers
            };

            if (typeUtils.isString(targetService)) {
                requestObject.actionName = targetService;
            } else {
                requestObject.serviceSpec = targetService;
            }

            ariaModulesRequestMgr.submitJsonRequest(requestObject, jsonData, wrapCB);
        }
function (targetService, jsonData, cb, options) {
            var typeUtils = ariaUtilsType;
            // change cb as an object if a string or a function is passed as a
            // callback
            if (typeUtils.isString(cb) || typeUtils.isFunction(cb)) {
                var ncb = {
                    fn : cb,
                    scope : this
                };
                cb = ncb;
            } else if (typeUtils.isObject(cb) && cb.scope == null) {
                cb.scope = this; // default scope = this
            }
            if (!options) {
                options = {};
            }
            var wrapCB = {
                fn : this._submitJsonRequestCB,
                scope : this,
                args : {
                    cb : cb
                }
            };
            // Request object constructed with all necessary properties
            var requestObject = {
                moduleName : this.$package,
                session : this._session,
                actionQueuing : null,
                requestHandler : this.$requestHandler,
                urlService : this.$urlService,
                requestJsonSerializer : this.$requestJsonSerializer,
                async : options.async,
                timeout : options.timeout,
                headers : options.headers
            };

            if (typeUtils.isString(targetService)) {
                requestObject.actionName = targetService;
            } else {
                requestObject.serviceSpec = targetService;
            }

            ariaModulesRequestMgr.submitJsonRequest(requestObject, jsonData, wrapCB);
        }
function ( targetService , jsonData , cb , options ) { var typeUtils = ariaUtilsType ; // change cb as an object if a string or a function is passed as a // callback if ( typeUtils . isString ( cb ) || typeUtils . isFunction ( cb ) ) { var ncb = { fn : cb , scope : this } ; cb = ncb ; } else if ( typeUtils . isObject ( cb ) && cb . scope == null ) { cb . scope = this ; // default scope = this } if ( ! options ) { options = { } ; } var wrapCB = { fn : this . _submitJsonRequestCB , scope : this , args : { cb : cb } } ; // Request object constructed with all necessary properties var requestObject = { moduleName : this . $package , session : this . _session , actionQueuing : null , requestHandler : this . $requestHandler , urlService : this . $urlService , requestJsonSerializer : this . $requestJsonSerializer , async : options . async , timeout : options . timeout , headers : options . headers } ; if ( typeUtils . isString ( targetService ) ) { requestObject . actionName = targetService ; } else { requestObject . serviceSpec = targetService ; } ariaModulesRequestMgr . submitJsonRequest ( requestObject , jsonData , wrapCB ) ; }
Submit a JSON Request
@see aria.modules.RequestMgr.
@param {String|Object} targetService, either :
<ul>
<li> the action path - e.g. 'search' or 'search?x=y'. This path will be automatically concatenated to the
module path determined from the class package </li>
<li> a 'service specification' structure, understood by the UrlService implementation</li>
</ul>
@param {Object} jsonData - the data to post to the server
@param {aria.core.CfgBeans:Callback} cb the callback
@param {aria.modules.RequestBeans.SubmitJsonRequestOptions} options object containing options for the
request, such as timeout and headers.
Submit a JSON Request