.
This commit is contained in:
@@ -1,25 +1,33 @@
|
||||
define([
|
||||
"dojo/_base/config",
|
||||
'dojo/_base/declare',
|
||||
'dstore/Rest',
|
||||
'dstore/RequestMemory',
|
||||
'dstore/SimpleQuery',
|
||||
'dstore/Trackable',
|
||||
'dstore/Tree',
|
||||
'dojo/_base/lang',
|
||||
'dstore/Store',
|
||||
'dojo/request',
|
||||
'dstore/QueryResults',
|
||||
'dstore/Cache',
|
||||
"hos/Socket",
|
||||
"dojo/request/xhr",
|
||||
"dojox/uuid/generateRandomUuid"
|
||||
], function(config, declare, Rest, RequestMemory, SimpleQuery, Trackable, Tree, Socket, xhr, generateRandomUuid){
|
||||
], function(config, declare, lang, Store, request, QueryResults, Cache, Socket, xhr, generateRandomUuid){
|
||||
|
||||
var RuleEngineStore = declare([Rest, RequestMemory, SimpleQuery, Trackable, Tree], {
|
||||
_getTarget: function(id){
|
||||
var target = this.target;
|
||||
if(!target.slice(-1) == '/'){
|
||||
target += "/";
|
||||
}
|
||||
return target + "packages" + id;
|
||||
var _RuleEngineStore = declare([Store], {
|
||||
|
||||
_request: function (target, options) {
|
||||
// Most responses will be in JSON, so we make that the default expected format.
|
||||
options = lang.mixin({ handleAs: 'json' }, options);
|
||||
options.headers = lang.mixin({}, this.headers, options.headers);
|
||||
return request(this.target + target, options);
|
||||
},
|
||||
|
||||
fetch: function () {
|
||||
return new QueryResults(this._request('packages'));
|
||||
}
|
||||
});
|
||||
|
||||
var RuleEngineStore = declare([_RuleEngineStore, Cache], {
|
||||
isValidFetchCache: true
|
||||
});
|
||||
|
||||
var _store = new RuleEngineStore({
|
||||
target: config.hos.ruleEngineUrl
|
||||
|
||||
Reference in New Issue
Block a user