a:41:{s:9:"#provides";s:24:"dojox.data.KeyValueStore";s:9:"#resource";s:21:"data/KeyValueStore.js";s:9:"#requires";a:2:{i:0;a:3:{i:0;s:6:"common";i:1;s:21:"dojo.data.util.filter";i:2;s:4:"dojo";}i:1;a:3:{i:0;s:6:"common";i:1;s:26:"dojo.data.util.simpleFetch";i:2;s:4:"dojo";}}s:24:"dojox.data.KeyValueStore";a:6:{s:4:"type";s:8:"Function";s:7:"summary";s:11:"constructor";s:10:"parameters";a:1:{s:17:"keywordParameters";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:20:"dataVar: jsonObject}";}}s:6:"source";s:496:" if(keywordParameters.url){ this.url = keywordParameters.url; } this._keyValueString = keywordParameters.data; this._keyValueVar = keywordParameters.dataVar; this._keyAttribute = "key"; this._valueAttribute = "value"; this._storeProp = "_keyValueStore"; this._features = { 'dojo.data.api.Read': true, 'dojo.data.api.Identity': true }; this._loadInProgress = false; //Got to track the initial load to prevent duelling loads of the dataset. this._queuedFetches = [];";s:6:"mixins";a:1:{s:9:"prototype";a:1:{i:0;s:26:"dojo.data.util.simpleFetch";}}s:9:"classlike";b:1;}s:28:"dojox.data.KeyValueStore.url";a:3:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:8:"instance";s:24:"dojox.data.KeyValueStore";s:7:"summary";s:0:"";}s:29:"dojox.data.KeyValueStore.data";a:2:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:7:"summary";s:0:"";}s:38:"dojox.data.KeyValueStore._assertIsItem";a:6:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"item";a:2:{s:4:"type";s:4:"item";s:7:"summary";s:50:"The item to test for being contained by the store.";}}s:6:"source";s:139:" if(!this.isItem(item)){ throw new Error("dojox.data.KeyValueStore: a function was passed an item argument that was not an item"); }";s:7:"summary";s:78:"This function tests whether the item passed in is indeed an item in the store.";s:7:"private";b:1;}s:43:"dojox.data.KeyValueStore._assertIsAttribute";a:6:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"item";a:1:{s:4:"type";s:4:"item";}s:9:"attribute";a:2:{s:4:"type";s:6:"String";s:7:"summary";s:55:"The attribute to test for being contained by the store.";}}s:6:"source";s:191:" if(!dojo.isString(attribute)){ throw new Error("dojox.data.KeyValueStore: a function was passed an attribute argument that was not an attribute object nor an attribute name string"); }";s:7:"summary";s:101:"This function tests whether the item passed in is indeed a valid 'attribute' like type for the store.";s:7:"private";b:1;}s:33:"dojox.data.KeyValueStore.getValue";a:5:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:4:"item";a:1:{s:4:"type";s:4:"item";}s:9:"attribute";a:1:{s:4:"type";s:21:"attribute-name-string";}s:12:"defaultValue";a:2:{s:8:"optional";b:1;s:4:"type";s:5:"value";}}s:6:"source";s:359:" this._assertIsItem(item); this._assertIsAttribute(item, attribute); var value; if(attribute == this._keyAttribute){ // Looking for key value = item[this._keyAttribute]; }else{ value = item[this._valueAttribute]; // Otherwise, attribute == ('value' || the actual key ) } if(value === undefined){ value = defaultValue; } return value;";s:7:"summary";s:33:"See dojo.data.api.Read.getValue()";}s:34:"dojox.data.KeyValueStore.getValues";a:6:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"item";a:1:{s:4:"type";s:4:"item";}s:9:"attribute";a:1:{s:4:"type";s:21:"attribute-name-string";}}s:6:"source";s:86:" var value = this.getValue(item, attribute); return (value ? [value] : []); //Array";s:7:"summary";s:144:"See dojo.data.api.Read.getValues() Key/Value syntax does not support multi-valued attributes, so this is just a wrapper function for getValue().";s:7:"returns";s:5:"Array";}s:38:"dojox.data.KeyValueStore.getAttributes";a:5:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"item";a:1:{s:4:"type";s:4:"item";}}s:6:"source";s:78:" return [this._keyAttribute, this._valueAttribute, item[this._keyAttribute]];";s:7:"summary";s:38:"See dojo.data.api.Read.getAttributes()";}s:37:"dojox.data.KeyValueStore.hasAttribute";a:5:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"item";a:1:{s:4:"type";s:4:"item";}s:9:"attribute";a:1:{s:4:"type";s:21:"attribute-name-string";}}s:6:"source";s:193:" this._assertIsItem(item); this._assertIsAttribute(item, attribute); return (attribute == this._keyAttribute || attribute == this._valueAttribute || attribute == item[this._keyAttribute]);";s:7:"summary";s:37:"See dojo.data.api.Read.hasAttribute()";}s:38:"dojox.data.KeyValueStore.containsValue";a:6:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:4:"item";a:1:{s:4:"type";s:4:"item";}s:9:"attribute";a:1:{s:4:"type";s:21:"attribute-name-string";}s:5:"value";a:1:{s:4:"type";s:8:"anything";}}s:6:"source";s:202:" var regexp = undefined; if(typeof value === "string"){ regexp = dojo.data.util.filter.patternToRegExp(value, false); } return this._containsValue(item, attribute, value, regexp); //boolean.";s:7:"summary";s:38:"See dojo.data.api.Read.containsValue()";s:7:"returns";s:8:"boolean.";}s:39:"dojox.data.KeyValueStore._containsValue";a:8:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:4:{s:4:"item";a:2:{s:4:"type";s:4:"item";s:7:"summary";s:46:"The data item to examine for attribute values.";}s:9:"attribute";a:2:{s:4:"type";s:34:"attribute || attribute-name-string";s:7:"summary";s:25:"The attribute to inspect.";}s:5:"value";a:2:{s:4:"type";s:8:"anything";s:7:"summary";s:19:"The value to match.";}s:6:"regexp";a:3:{s:8:"optional";b:1;s:4:"type";s:6:"RegExp";s:7:"summary";s:196:"Optional regular expression generated off value if value was of string type to handle wildcarding. If present and attribute values are string, then it can be used for comparison instead of 'value'";}}s:6:"source";s:367:" var values = this.getValues(item, attribute); for(var i = 0; i < values.length; ++i){ var possibleValue = values[i]; if(typeof possibleValue === "string" && regexp){ return (possibleValue.match(regexp) !== null); }else{ //Non-string matching. if(value === possibleValue){ return true; // Boolean } } } return false; // Boolean";s:7:"summary";s:66:"Internal function for looking at the values contained by the item.";s:11:"description";s:230:"Internal function for looking at the values contained by the item. This function allows for denoting if the comparison should be case sensitive for strings or not (for handling filtering cases where string case should not matter)";s:7:"returns";s:7:"Boolean";s:7:"private";b:1;}s:31:"dojox.data.KeyValueStore.isItem";a:6:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:9:"something";a:1:{s:4:"type";s:8:"anything";}}s:6:"source";s:113:" if (something && something[this._storeProp] === this) { return true; //Boolean } return false; //Boolean";s:7:"summary";s:31:"See dojo.data.api.Read.isItem()";s:7:"returns";s:7:"Boolean";}s:37:"dojox.data.KeyValueStore.isItemLoaded";a:6:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:9:"something";a:1:{s:4:"type";s:8:"anything";}}s:6:"source";s:42:" return this.isItem(something); //Boolean";s:7:"summary";s:117:"See dojo.data.api.Read.isItemLoaded() The KeyValueStore always loads all items, so if it's an item, then it's loaded.";s:7:"returns";s:7:"Boolean";}s:33:"dojox.data.KeyValueStore.loadItem";a:6:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:11:"keywordArgs";a:1:{s:4:"type";s:6:"object";}}s:6:"source";s:395:" // summary: // See dojo.data.api.Read.loadItem() // description: // The KeyValueStore always loads all items, so if it's an item, then it's loaded. // From the dojo.data.api.Read.loadItem docs: // If a call to isItemLoaded() returns true before loadItem() is even called, // then loadItem() need not do any work at all and will not even invoke // the callback handlers.";s:7:"summary";s:33:"See dojo.data.api.Read.loadItem()";s:11:"description";s:289:"The KeyValueStore always loads all items, so if it's an item, then it's loaded. From the dojo.data.api.Read.loadItem docs: If a call to isItemLoaded() returns true before loadItem() is even called, then loadItem() need not do any work at all and will not even invoke the callback handlers.";}s:36:"dojox.data.KeyValueStore.getFeatures";a:5:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:6:"source";s:33:" return this._features; //Object";s:7:"summary";s:36:"See dojo.data.api.Read.getFeatures()";s:7:"returns";s:6:"Object";}s:30:"dojox.data.KeyValueStore.close";a:5:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:7:"request";a:1:{s:4:"type";s:44:"dojo.data.api.Request || keywordArgs || null";}}s:6:"source";s:51:" // summary: // See dojo.data.api.Read.close()";s:7:"summary";s:30:"See dojo.data.api.Read.close()";}s:33:"dojox.data.KeyValueStore.getLabel";a:5:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"item";a:1:{s:4:"type";s:4:"item";}}s:6:"source";s:34:" return item[this._keyAttribute];";s:7:"summary";s:33:"See dojo.data.api.Read.getLabel()";}s:43:"dojox.data.KeyValueStore.getLabelAttributes";a:5:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"item";a:1:{s:4:"type";s:4:"item";}}s:6:"source";s:30:" return [this._keyAttribute];";s:7:"summary";s:43:"See dojo.data.api.Read.getLabelAttributes()";}s:36:"dojox.data.KeyValueStore._fetchItems";a:6:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:11:"keywordArgs";a:1:{s:4:"type";s:6:"Object";}s:12:"findCallback";a:1:{s:4:"type";s:8:"Function";}s:13:"errorCallback";a:1:{s:4:"type";s:8:"Function";}}s:6:"source";s:2954:" var self = this; var filter = function(requestArgs, arrayOfAllItems){ var items = null; if(requestArgs.query){ items = []; var ignoreCase = requestArgs.queryOptions ? requestArgs.queryOptions.ignoreCase : false; //See if there are any string values that can be regexp parsed first to avoid multiple regexp gens on the //same value for each item examined. Much more efficient. var regexpList = {}; for(var key in requestArgs.query){ var value = requestArgs.query[key]; if(typeof value === "string"){ regexpList[key] = dojo.data.util.filter.patternToRegExp(value, ignoreCase); } } for(var i = 0; i < arrayOfAllItems.length; ++i){ var match = true; var candidateItem = arrayOfAllItems[i]; for(var key in requestArgs.query){ var value = requestArgs.query[key]; if(!self._containsValue(candidateItem, key, value, regexpList[key])){ match = false; } } if(match){ items.push(candidateItem); } } }else if(requestArgs.identity){ items = []; var item; for(var key in arrayOfAllItems){ item = arrayOfAllItems[key]; if(item[self._keyAttribute] == requestArgs.identity){ items.push(item); break; } } }else{ // We want a copy to pass back in case the parent wishes to sort the array. We shouldn't allow resort // of the internal list so that multiple callers can get lists and sort without affecting each other. if(arrayOfAllItems.length> 0){ items = arrayOfAllItems.slice(0,arrayOfAllItems.length); } } findCallback(items, requestArgs); }; if(this._loadFinished){ filter(keywordArgs, this._arrayOfAllItems); }else{ if(this.url !== ""){ //If fetches come in before the loading has finished, but while //a load is in progress, we have to defer the fetching to be //invoked in the callback. if(this._loadInProgress){ this._queuedFetches.push({args: keywordArgs, filter: filter}); }else{ this._loadInProgress = true; var getArgs = { url: self.url, handleAs: "json-comment-filtered" }; var getHandler = dojo.xhrGet(getArgs); getHandler.addCallback(function(data){ self._processData(data); filter(keywordArgs, self._arrayOfAllItems); self._handleQueuedFetches(); }); getHandler.addErrback(function(error){ self._loadInProgress = false; throw error; }); } }else if(this._keyValueString){ this._processData(eval(this._keyValueString)); this._keyValueString = null; filter(keywordArgs, this._arrayOfAllItems); }else if(this._keyValueVar){ this._processData(this._keyValueVar); this._keyValueVar = null; filter(keywordArgs, this._arrayOfAllItems); }else{ throw new Error("dojox.data.KeyValueStore: No source data was provided as either URL, String, or Javascript variable data input."); } }";s:7:"summary";s:38:"See dojo.data.util.simpleFetch.fetch()";s:7:"private";b:1;}s:45:"dojox.data.KeyValueStore._handleQueuedFetches";a:5:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:6:"source";s:385:" if(this._queuedFetches.length > 0){ for(var i = 0; i < this._queuedFetches.length; i++){ var fData = this._queuedFetches[i]; var delayedFilter = fData.filter; var delayedQuery = fData.args; if(delayedFilter){ delayedFilter(delayedQuery, this._arrayOfAllItems); }else{ this.fetchItemByIdentity(fData.args); } } this._queuedFetches = []; }";s:7:"summary";s:92:"Internal function to execute delayed request in the store. Execute any deferred fetches now.";s:7:"private";b:1;}s:37:"dojox.data.KeyValueStore._processData";a:6:{s:9:"prototype";s:24:"dojox.data.KeyValueStore";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"data";a:1:{s:4:"type";s:5:"Array";}}s:6:"source";s:188:" this._arrayOfAllItems = []; for(var i=0; i