Add method 'createItem' to DB plugins

This commit is contained in:
Esteban Ordano 2014-10-28 15:20:43 -03:00
commit 5eade81294
4 changed files with 34 additions and 0 deletions

View file

@ -95,6 +95,16 @@ GoogleDrive.prototype._httpGet = function(theUrl) {
return xmlHttp.responseText;
}
GoogleDrive.prototype.createItem = function(name, value, callback) {
this.getItem(name, function(err, retrieved) {
if (err || !retrieved) {
return this.setItem(name, value, callback);
} else {
return callback('EEXISTS');
}
});
};
GoogleDrive.prototype.getItem = function(k, cb) {
//console.log('[googleDrive.js.95:getItem:]', k); //TODO
var self = this;