From 8592cfb89db05f0e52d8c1b8c7046e6f49e3522d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 1 Feb 2012 00:09:27 -0800 Subject: Adding a montage framework copy for the user document Adding a new montage copy containing the latest version of montage to use the new native widgets Signed-off-by: Valerio Virgillito --- node_modules/montage-user/data/blueprint.js | 1062 ++++++++++ node_modules/montage-user/data/context.js | 374 ++++ node_modules/montage-user/data/controllistener.js | 47 + .../montage-user/data/ldapaccess/ldapblueprint.js | 135 ++ .../montage-user/data/ldapaccess/ldapobjectid.js | 20 + .../data/ldapaccess/ldapselectorevaluator.js | 24 + .../montage-user/data/ldapaccess/ldapstore.js | 38 + .../data/nosqlaccess/nosqlblueprint.js | 135 ++ .../montage-user/data/nosqlaccess/nosqlobjectid.js | 22 + .../data/nosqlaccess/nosqlselectorevaluator.js | 24 + .../montage-user/data/nosqlaccess/nosqlstore.js | 68 + node_modules/montage-user/data/objectid.js | 77 + node_modules/montage-user/data/objectproperty.js | 298 +++ node_modules/montage-user/data/pledge.js | 270 +++ node_modules/montage-user/data/query.js | 114 + .../montage-user/data/restaccess/restblueprint.js | 138 ++ .../montage-user/data/restaccess/restobjectid.js | 21 + .../data/restaccess/restselectorevaluator.js | 24 + .../montage-user/data/restaccess/reststore.js | 186 ++ node_modules/montage-user/data/restriction.js | 66 + node_modules/montage-user/data/selector.js | 2220 ++++++++++++++++++++ .../montage-user/data/sqlaccess/sqlblueprint.js | 135 ++ .../montage-user/data/sqlaccess/sqlobjectid.js | 22 + .../data/sqlaccess/sqlselectorevaluator.js | 24 + .../montage-user/data/sqlaccess/sqlstore.js | 69 + node_modules/montage-user/data/store.js | 1211 +++++++++++ node_modules/montage-user/data/transactionid.js | 230 ++ 27 files changed, 7054 insertions(+) create mode 100755 node_modules/montage-user/data/blueprint.js create mode 100755 node_modules/montage-user/data/context.js create mode 100755 node_modules/montage-user/data/controllistener.js create mode 100755 node_modules/montage-user/data/ldapaccess/ldapblueprint.js create mode 100755 node_modules/montage-user/data/ldapaccess/ldapobjectid.js create mode 100755 node_modules/montage-user/data/ldapaccess/ldapselectorevaluator.js create mode 100755 node_modules/montage-user/data/ldapaccess/ldapstore.js create mode 100755 node_modules/montage-user/data/nosqlaccess/nosqlblueprint.js create mode 100755 node_modules/montage-user/data/nosqlaccess/nosqlobjectid.js create mode 100755 node_modules/montage-user/data/nosqlaccess/nosqlselectorevaluator.js create mode 100755 node_modules/montage-user/data/nosqlaccess/nosqlstore.js create mode 100755 node_modules/montage-user/data/objectid.js create mode 100755 node_modules/montage-user/data/objectproperty.js create mode 100755 node_modules/montage-user/data/pledge.js create mode 100755 node_modules/montage-user/data/query.js create mode 100755 node_modules/montage-user/data/restaccess/restblueprint.js create mode 100755 node_modules/montage-user/data/restaccess/restobjectid.js create mode 100755 node_modules/montage-user/data/restaccess/restselectorevaluator.js create mode 100755 node_modules/montage-user/data/restaccess/reststore.js create mode 100755 node_modules/montage-user/data/restriction.js create mode 100755 node_modules/montage-user/data/selector.js create mode 100755 node_modules/montage-user/data/sqlaccess/sqlblueprint.js create mode 100755 node_modules/montage-user/data/sqlaccess/sqlobjectid.js create mode 100755 node_modules/montage-user/data/sqlaccess/sqlselectorevaluator.js create mode 100755 node_modules/montage-user/data/sqlaccess/sqlstore.js create mode 100755 node_modules/montage-user/data/store.js create mode 100755 node_modules/montage-user/data/transactionid.js (limited to 'node_modules/montage-user/data') diff --git a/node_modules/montage-user/data/blueprint.js b/node_modules/montage-user/data/blueprint.js new file mode 100755 index 00000000..b3a66167 --- /dev/null +++ b/node_modules/montage-user/data/blueprint.js @@ -0,0 +1,1062 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +/** + @module montage/data/blueprint + @requires montage/core/core + @requires montage/data/store + @requires montage/data/objectid + @requires data/query + @requires core/exception + @requires data/objectproperty + @requires core/promise + @requires core/logger +*/ +var Montage = require("montage").Montage; +var Store = require("data/store").Store; +var TemporaryObjectId = require("data/objectid").TemporaryObjectId; +var Query = require("data/query").Query; +var Exception = require("core/exception").Exception; +var ObjectProperty = require("data/objectproperty").ObjectProperty; +var Promise = require("core/promise").Promise; +var logger = require("core/logger").logger("blueprint"); +/** + @class module:montage/data/blueprint.BlueprintBinder + @classdesc A blueprint binder is a collection of of blueprints for a specific access type. It also includes the connection information. + @extends module:montage/core/core.Montage +*/ +var BlueprintBinder = exports.BlueprintBinder = Montage.create(Montage,/** @lends module:montage/data/blueprint.BlueprintBinder# */ { + +/** + Description TODO + @private +*/ + _blueprintForPrototypeTable: { + value: {}, + serializable: false, + distinct: true, + enumerable: false, + writable: false + }, +/** + Description TODO + @type {Property} + @default {Table} {} + */ + restrictionsTable: { + value: {}, + serializable: true, + distinct: true, + enumerable: false, + writable: false + }, +/** + Description TODO + @type {Property} + @default {String} null + */ + name: { + value: null, + serializable: true + }, +/** + Description TODO + @function + @param {String} name TODO + @returns itself + */ + initWithName: { + value: function(name) { + this.name = (name !== null ? name : "default"); + return this; + } + }, +/** + Description TODO + @type {Property} + @default {Array} new Array(30) + */ + blueprints: { + serializable: true, + distinct: true, + writable: false, + value: new Array(30) + }, +/** + Description TODO + @function + @param {Array} blueprint TODO + @returns blueprint + */ + addBlueprint: { + value: function(blueprint) { + if (blueprint !== null) { + var index = this.blueprints.indexOf(blueprint); + if (index < 0) { + if (blueprint.binder !== null) { + blueprint.binder.removeBlueprint(blueprint); + } + this.blueprints.push(blueprint); + blueprint.binder = this; + // + var key = blueprint.moduleId + "." + blueprint.prototypeName; + this._blueprintForPrototypeTable[key] = blueprint; + } + } + return blueprint; + } + }, +/** + Description TODO + @function + @param {Array} blueprint TODO + @returns blueprint + */ + removeBlueprint: { + value: function(blueprint) { + if (blueprint !== null) { + var index = this.blueprints.indexOf(blueprint); + if (index >= 0) { + this.blueprints.splice(index, 1); + blueprint.binder = null; + // Remove the cached entry + var key = blueprint.moduleId + "." + blueprint.prototypeName; + delete this._blueprintForPrototypeTable[key]; + } + } + return blueprint; + } + }, +/** + Description TODO + @function + @param {String} name TODO + @param {String} moduleID TODO + @returns this.addBlueprint(this.createBlueprint().initWithNameAndModuleId(name, moduleId)) + */ + addBlueprintNamed : { + value: function(name, moduleId) { + return this.addBlueprint(this.createBlueprint().initWithNameAndModuleId(name, moduleId)); + } + }, +/** + Description TODO + @function + @returns Blueprint.create() + */ + createBlueprint: { + value: function() { + return Blueprint.create(); + } + }, +/** + Description TODO + @function + @param {String} name TODO + @param {Selector} defaultSelector TODO + @returns restriction + */ + addRestriction: { + value: function(name, defaultSelector) { + var restriction = null; + if (name != null && defaultSelector != null) { + restriction = this.restrictionsTable[name] = defaultSelector; + } + return restriction; + } + }, +/** + Description TODO + @function + @param {String} name TODO + @returns restriction + */ + removeRestriction: { + value: function(name) { + if (name !== null) { + var restriction = this.restrictionsTable[name] + if (restriction != null) { + delete restriction; + } + } + return restriction; + } + }, + +/** + Description TODO + @function + @param {String} restriction TODO + @returns selector + */ + defaultSelectorForRestriction: { + value: function(restriction) { + var selector = null; + if (restriction != null) { + selector = this.restrictionsTable[restriction.name]; + if (typeof selector === 'undefined') { + selector = null; + } + } + return selector; + } + }, + /** + Description TODO + @type {Property} + @default {ID} montage/data/store + */ + storeModuleId: { + value: "data/store" + }, + /** + Description TODO + @type {Property} + @default {String} "Store" + */ + storePrototypeName: { + value: "Store" + }, + /** + Return the blueprint associated with this prototype. + @function + @param {String} prototypeName TODO + @param {ID} moduleId TODO + @returns blueprint + */ + blueprintForPrototype: { + value: function(prototypeName, moduleId) { + var key = moduleId + "." + prototypeName; + var blueprint = this._blueprintForPrototypeTable[key]; + if (typeof blueprint === "undefined") { + blueprint = UnknownBlueprint; + var aBlueprint, index; + for (index = 0; typeof (aBlueprint = this.blueprints[index]) !== "undefined"; index++) { + if ((aBlueprint.prototypeName === prototypeName) && (aBlueprint.moduleId === moduleId)) { + blueprint = aBlueprint; + break; + } + } + this._blueprintForPrototypeTable[key] = blueprint; + } + if (blueprint === UnknownBlueprint) { + blueprint = null; + } + return blueprint; + } + } + +}); +/** + @class module:montage/data/bluprint.Blueprint +*/ +var Blueprint = exports.Blueprint = Montage.create(Montage,/** @lends module:montage/data/bluprint.Blueprint# */ { + /** + This is the canonical way of creating managed objects prototypes.
+ Newly created prototype will be blessed with all the required properties to be well behaved. + @function + @param {Object} aPrototype TODO + @param {String} propertyDescriptor TODO + @returns newPrototype + */ + create: { + configurable: true, + value: function(aPrototype, propertyDescriptor) { + if ((typeof aPrototype === 'undefined') || (Blueprint.isPrototypeOf(aPrototype))) { + var parentCreate = Object.getPrototypeOf(Blueprint)["create"]; + return parentCreate.call(this, (typeof aPrototype === "undefined" ? this : aPrototype), propertyDescriptor); + } + var newPrototype = Montage.create(aPrototype, propertyDescriptor); + ObjectProperty.manager.applyWithBlueprint(newPrototype, this); + // We have just created a custom prototype lets use it. + this.customPrototype = true; + return newPrototype; + } + }, +/** + Create a new instance of the target prototype for the blueprint. + @function + @return new instance + */ + newInstance: { + value: function() { + var prototype = this.newInstancePrototype(); + return (prototype ? prototype.create() : null); + } + }, + /** + Returns the target prototype for this blueprint.
+ Note: This method uses the customPrototype property to determine if it needs to require a custom prototype or create a default prototype. + @function + @return new prototype + */ + newInstancePrototype: { + value: function() { + if (this.customPrototype) { + var results = Promise.defer(); + require.async(this.moduleId, + function(exports) { + results.resolve(exports); + }); + var self = this; + return results.promise.then(function(exports) { + var prototype = exports[self.prototypeName]; + return (prototype ? prototype : null) + } + ) + } else { + if (exports[self.prototypeName]) { + var parentInstancePrototype = (this.parent ? this.parent.newInstancePrototype() : Montage ); + var newPrototype = Montage.create(parentInstancePrototype, { + // Token class + }); + ObjectProperty.manager.applyWithBlueprint(newPrototype, this); + exports[self.prototypeName] = newPrototype; + } + var prototype = exports[self.prototypeName]; + return (prototype ? prototype : null) + } + } + }, +/** + Description TODO + @type {Property} + @default {String} null + */ + name: { + value: null, + serializable: true + }, +/** + Description TODO + @function + @param {String} name TODO + @returns this.initWithNameAndModuleId(name, null) + */ + initWithName: { + value: function(name) { + return this.initWithNameAndModuleId(name, null); + } + }, +/** + Description TODO + @function + @param {String} name TODO + @param {String} moduleId TODO + @returns itself + */ + initWithNameAndModuleId: { + value: function(name, moduleId) { + this.name = (name !== null ? name : "default"); + // The default is that the prototype name is the name + this.prototypeName = this.name; + this.moduleId = moduleId; + this.customPrototype = false; + return this; + } + }, +/** + Description TODO + @type {Property} + @default null + */ + binder: { + value: null, + serializable: true + }, +/** + Description TODO + @type {Property} + @default null + */ + parent: { + value: null, + serializable: true + }, +/** + Description TODO + @type {Property} + @default null + */ + moduleId: { + value: null, + serializable: true + }, +/** + Description TODO + @type {Property} + @default null + */ + prototypeName: { + value: null, + serializable: true + }, +/** + Defines if the blueprint should use custom prototype for new instances.
+ Returns true if the blueprint needs to require a custom prototype for creating new instances, false if new instance are generic prototypes. + @type {Boolean} + @default false + */ + customPrototype: { + value: false, + serializable: true + }, +/** + Description TODO + @type {Property} + @default {Array} new Array(10) + */ + attributes: { + value: new Array(10), + serializable: true, + distinct: true, + writable: false + }, +/** + Description TODO + @private +*/ + _attributesTable: { + value: {}, + serializable: false, + distinct: true, + enumerable: false, + writable: false + }, +/** + Description TODO + @type {Property} + @default {Array} new Array(10) + */ + queries: { + value: new Array(10), + serializable: true, + distinct: true, + writable: false + }, +/** + Description TODO + @private +*/ + _queriesTable: { + value: {}, + serializable: false, + distinct: true, + enumerable: false, + writable: false + }, +/** + Description TODO + @type {Property} + @default {Table} {} + */ + restrictionsTable: { + value: {}, + serializable: true, + distinct: true, + enumerable: false, + writable: false + }, + /** + Add a new attribute to this blueprint.
+ If that attribute was associated with another blueprint it will be removed first. + @function + @param {String} attribute The attribute to be added. + @returns attribute + */ + addAttribute: { + value: function(attribute) { + if (attribute !== null && attribute.name !== null) { + var index = this.attributes.indexOf(attribute); + if (index < 0) { + if (attribute.blueprint !== null) { + attribute.blueprint.removeAttribute(attribute); + } + this.attributes.push(attribute); + this._attributesTable[attribute.name] = attribute; + attribute.blueprint = this; + } + } + return attribute; + } + }, +/** + Description TODO + @function + @param {String} attribute The attribute to be removed. + @returns attribute + */ + removeAttribute: { + value: function(attribute) { + if (attribute !== null && attribute.name !== null) { + var index = this.attributes.indexOf(attribute); + if (index >= 0) { + this.attributes.splice(index, 1); + delete this._attributesTable[attribute.name]; + attribute.blueprint = null; + } + } + return attribute; + } + }, +/** + Convenience to add one attribute. + @function + @param {String} name Add to one attribute + @returns name + */ + addToOneAttributeNamed: { + value: function(name) { + return this.addAttribute(this.createToOneAttribute().initWithName(name)); + } + }, + +/** + Convenience to add many attributes. + @function + @param {String} name Add to many attributes + @returns names + */ + addToManyAttributeNamed: { + value: function(name) { + return this.addAttribute(this.createToManyAttribute().initWithName(name)); + } + }, + + /* + * + */ +/** + Convenience to add an attribute to one relationship. + @function + @param {String} name TODO + @param {String} inverse TODO + @returns relationship + */ + addToOneRelationshipNamed: { + value: function(name, inverse) { + var relationship = this.addAttribute(this.createToOneRelationship().initWithName(name)); + if ((inverse != null) && (typeof inverse.targetBlueprint === "object")) { + relationship.targetBlueprint = inverse.blueprint; + inverse.targetBlueprint = this; + } + return relationship; + } + }, +/** + Convenience to add an attribute to many relationships. + @function + @param {String} name TODO + @param {String} inverse TODO + @returns relationship + */ + addToManyRelationshipNamed: { + value: function(name, inverse) { + var relationship = this.addAttribute(this.createToManyRelationship().initWithName(name)); + if ((inverse != null) && (typeof inverse.targetBlueprint === "object")) { + relationship.targetBlueprint = inverse.blueprint; + inverse.targetBlueprint = this; + } + return relationship; + } + }, +/** + Conventional method to create one new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} ToOneAttribute.create() + */ + createToOneAttribute: { + value: function() { + return ToOneAttribute.create(); + } + }, + + /** + Conventional method to create many new attributes.
+ This can be overwritten by specific stores. + @function + @returns {Function} ToManyAttribute.create() + */ + createToManyAttribute: { + value: function() { + return ToManyAttribute.create(); + } + }, + + /* + * + */ +/** + Conventional method to create new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} ToOneRelationship.create() + */ + createToOneRelationship: { + value: function() { + return ToOneRelationship.create(); + } + }, + + /** + Conventional method to create new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} ToOneRelationship.create() + */ + createToManyRelationship: { + value: function() { + return ToManyRelationship.create(); + } + }, +/** + Description TODO + @function + @param {String} name TODO + @returns attribute + */ + attributeForName: { + value: function(name) { + var attribute = this._attributesTable[name]; + if (typeof attribute === "undefined") { + attribute = UnknownAttribute; + var anAttribute, index; + for (index = 0; typeof (anAttribute = this.attributes[index]) !== "undefined"; index++) { + if (anAttribute.name === name) { + attribute = anAttribute; + break; + } + } + this._attributesTable[name] = attribute; + } + if (attribute === UnknownAttribute) { + attribute = null; + } + return attribute; + } + + }, +/** + Description TODO + @function + @param {String} query TODO + @returns query + */ + addQuery: { + value: function(query) { + if (query !== null && query.name != null) { + if (query.blueprint !== this) { + throw Exception.create().initWithMessageTargetAndMethod("Query not associated with this blueprint", this, query.name); + } + var index = this.queries.indexOf(query); + if (index < 0) { + this.queries.push(query); + this._queriesTable[query.name] = query; + } + } + return query; + } + }, +/** + Description TODO + @function + @param {String} query TODO + @returns query + */ + removeQuery: { + value: function(query) { + if (query !== null && query.name != null) { + if (query.blueprint !== this) { + throw Exception.create().initWithMessageTargetAndMethod("Query not associated with this blueprint", this, query.name); + } + var index = this.queries.indexOf(query); + if (index >= 0) { + this.queries.splice(index, 1); + delete this._queriesTable[query.name]; + } + } + return query; + } + }, +/** + Description TODO + @function + @param {String} name TODO + @returns query + */ + queryForName: { + value: function(name) { + var query = this._queriesTable[name]; + if (typeof query === "undefined") { + query = UnknownQuery; + var aQuery, index; + for (index = 0; typeof (aQuery = this.queries[index]) !== "undefined"; index++) { + if (query.name === name) { + query = aQuery; + break; + } + } + this._queriesTable[name] = query; + } + if (query === UnknownQuery) { + query = null; + } + return query; + } + }, +/** + Description TODO + @function + @param {String} name TODO + @param {Selector} selector TODO + @returns restriction + */ + addRestriction: { + value: function(name, selector) { + var restriction = null; + if (name != null && selector != null) { + restriction = this.restrictionsTable[name] = selector; + } + return restriction; + } + }, +/** + Description TODO + @function + @param {String} name TODO + @returns restriction + */ + removeRestriction: { + value: function(name) { + if (name !== null) { + var restriction = this.restrictionsTable[name] + if (restriction != null) { + delete restriction; + } + } + return restriction; + } + }, + +/** + Return the selector for this restriction.
+ Note: This selector is usually parametric.
+ Parameters need to be resolved before it can be evaluated. + @function + @param {String} restriction TODO + @returns selector + */ + selectorForRestriction: { + value: function(restriction) { + var selector = null; + if (restriction != null) { + selector = this.restrictionsTable[restriction.name]; + if (typeof selector === 'undefined') { + selector = null; + } + if ((selector == null) && (this.binder !== null)) { + selector = this.binder.defaultSelectorForRestriction(restriction); + } + } + return selector; + } + }, + +/** + This is the get function called on the target object to access properties.
+ On call this refers to the target object. + @function + @param {Object} propertyName TODO + @returns {Array} [storageKey] + */ + blueprintGet: { + value: function(propertyName) { + var attribute = this.blueprint.attributeForName(propertyName); + var storageKey = "_" + attribute.name; + this.willRead(attribute); + return this[storageKey]; + }, + enumerable: false, + serializable: false + }, +/** + This is the get function called on the target object to set properties.
+ On call this refers to the target object. + @function + @param {Object} propertyName TODO + @param {Property} value TODO + @returns {Array} [storageKey] + */ + blueprintSet: { + value: function(propertyName, value) { + var attribute = this.blueprint.attributeForName(propertyName); + var storageKey = "_" + attribute.name; + if (value == null && attribute.denyDelete) { + throw Exception.create().initWithMessageTargetAndMethod("Deny Delete", this, attribute.name); + } else { + this.willModify(attribute); + this[storageKey] = value; + } + }, + enumerable: false, + serializable: false + }, +/** + Returns tne new value for the temporary object ID.
+ This can be overwritten by subclass. + @function + @returns TemporaryObjectId.create().init() + */ + objectId$Implementation: { + get: function() { + return TemporaryObjectId.create().init(); + } + }, +/** + Description TODO + @function + @returns Query.create().initWithBlueprint(this) + */ + query: { + value: function() { + return Query.create().initWithBlueprint(this); + } + } + +}); +var UnknownBlueprint = Object.freeze(Blueprint.create().initWithName("Unknown")); +var UnknownQuery = Object.freeze(Query.create().initWithBlueprint(null)); + +/** + @class module:montage/data/blueprint.Attribute +*/ +var Attribute = Montage.create(Montage,/** @lends module:montage/data/blueprint.Attribute# */ { +/** + Description TODO + @function + @param {String} name TODO + @returns itself + */ + initWithName: { + value: function(name) { + this._name = (name !== null ? name : "default"); + return this; + } + }, +/** + Description TODO + @private +*/ + _name: { + serializable: true, + enumerable: false, + value: null + }, +/** + Description TODO + @function + @returns this._name + */ + name: { + get: function() { + return this._name; + } + }, +/** + Description TODO + @type {Property} + @default null + */ + blueprint: { + value: null, + serializable: true + }, +/** + Description TODO + @type {Property} + @default {Boolean} false + */ + mandatory: { + value: false, + serializable: true + }, +/** + Description TODO + @type {Property} + @default {Boolean} false + */ + denyDelete: { + value: false, + serializable: true + }, +/** + Description TODO + @type {Property} + @default {Boolean} false + */ + readOnly: { + value: false, + serializable: true + }, +/** + Description TODO + @type {Property} + @default {Boolean} false + */ + isToMany: { + value: false, + serializable: false + }, +/** + Description TODO + @type {Property} + @default {Boolean} false + */ + isDerived: { + value: false, + serializable: false + } + +}); +var UnknownAttribute = Object.freeze(Attribute.create().initWithName("Unknown")); + +/** + @class module:montage/data/blueprint.ToOneAttribute +*/ +var ToOneAttribute = exports.ToOneAttribute = Montage.create(Attribute,/** @lends module:montage/data/blueprint.ToOneAttribute# */ { +/** + Description TODO + @type {Property} + @default {String} "string" + */ + valueType: { + value: "string", + serializable: true + }, +/** + Description TODO + @type {Property} + @default {Object} null + */ + valueObjectPrototypeName: { + value: null, + serializable: true + }, +/** + Description TODO + @type {Property} + @default {Object} null + */ + valueObjectModuleId: { + value: null, + serializable: true + } + +}); +/** + @class module:montage/data/blueprint.ToOneRelationship +*/ +var ToOneRelationship = exports.ToOneRelationship = Montage.create(ToOneAttribute,/** @lends module:montage/data/blueprint.ToOneRelationship# */ { +/** + Description TODO + @type {Property} + @default {Object} null + */ + targetBlueprint: { + value: null, + serializable: true + } + +}); +/** + @class module:montage/data/blueprint.ToManyAttribute +*/ +var ToManyAttribute = exports.ToManyAttribute = Montage.create(Attribute,/** @lends module:montage/data/blueprint.ToManyAttribute# */ { +/** + Description TODO + @type {Property} + @default null + */ + sort: { + value: null + }, +/** + Description TODO + @type {Property} + @default {Boolean} true + */ + isToMany: { + value: true, + serializable: false + } + +}); +/** + @class module:montage/data/blueprint.ToManyRelationship +*/ +var ToManyRelationship = exports.ToManyRelationship = Montage.create(ToManyAttribute,/** @lends module:montage/data/blueprint.ToManyRelationship# */ { +/** + Description TODO + @type {Property} + @default {Object} null + */ + targetBlueprint: { + value: null, + serializable: true + }, +/** + Description TODO + @type {Property} + @default {Boolean} true + */ + isToMany: { + value: true, + serializable: false + } + +}); +/** + @class module:montage/data/blueprint.DerivedAttribute +*/ +var DerivedAttribute = exports.DerivedAttribute = Montage.create(Attribute,/** @lends module:montage/data/blueprint.DerivedAttribute# */ { +/** + Description TODO + @type {Property} + @default {Boolean} true + */ + isDerived: { + value: true, + serializable: false + }, + + /** + Description TODO + @type {Property} + @default {Array} [] + */ dependencies: { + value: [], + serializable: true + }, + /** + Description TODO + @type {Property} + @default null + */ + getterDefinition: { + value: null, + serializable: true + }, +/** + Description TODO + @type {Property} + @default null + */ + setterDefinition: { + value: null, + serializable: true + } + +}); diff --git a/node_modules/montage-user/data/context.js b/node_modules/montage-user/data/context.js new file mode 100755 index 00000000..694198e3 --- /dev/null +++ b/node_modules/montage-user/data/context.js @@ -0,0 +1,374 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +/** + @module montage/data/context + @requires montage/core/core + @requires montage/data/store + @requires montage/data/blueprint + @requires montage/data/objectproperty + @requires montage/core/shim/weak-map + @requires montage/core/shim/structures + @requires montage/core/exception + @requires montage/core/promise + @requires montage/core/logger + */ +var Montage = require("montage").Montage; +var Store = require("data/store").Store; +var Blueprint = require("data/blueprint").Blueprint; +var ObjectProperty = require("data/objectproperty").ObjectProperty; +// TODO [June 5 2011 PJYF] This s temporary implementation of WeakMap to let the browser catch up. +var WeakMap = require("core/shim/weak-map").WeakMap; +var Set = require("core/shim/structures").Set; +var Exception = require("core/exception").Exception; +var Promise = require("core/promise").Promise; +var logger = require("core/logger").logger("context"); +/** + @class module:montage/data/context.Context + @extends module:montage/data/store.Store + */ +var Context = exports.Context = Montage.create(Store, /** @lends module:montage/data/context.Context# */ { + /** + Collection of object inserted in this context since the last save. + @private + */ + _inserted: { + value: new Set(50), + serializable: true, + distinct: true, + enumerable: false, + writable: false + }, + /** + Collection of object deleted in this context since the last save. + @private + */ + _deleted: { + value: new Set(50), + serializable: true, + distinct: true, + enumerable: false, + writable: false + }, + /** + Collection of object modified in this context since the last save. + @private + */ + _modified: { + value: new Set(50), + serializable: true, + distinct: true, + enumerable: false, + writable: false + }, + + /** + Table of fetched objects for uniquing. The key is the object ID the value the actual object or the pledge representing it.
+ Note: This is a weak map so that the context does not hold on the objects and they can be garbage collected if no one else hold on them. + @private + */ + _objectMap: { + value: new WeakMap(), + serializable: true, + enumerable: false, + writable: false + }, + + /** + Collection of object inserted in this context since the last save. + @function + @returns this._inserted + @default empty set + */ + inserted: { + get: function() { + return this._inserted; + } + }, + + /** + Collection of object deleted in this context since the last save. + @function + @returns this._deleted + @default empty set + */ + deleted: { + get: function() { + return this._deleted; + } + }, + + /** + Collection of object modified in this context since the last save. + @function + @returns this._modified + @default empty set + */ + modified: { + get: function() { + return this._modified; + } + }, + + /** + Description TODO + @function + @param {String} id objectmap + @returns this._objectMap.get(id) | null + */ + objectForId: { + value: function(id) { + if (this._objectMap.has(id)) { + return this._objectMap.get(id); + } + return null; + } + }, + + /** + Inserts a newly created object in the context. + @function + @param {Object} instance TODO + @returns initialized object + */ + insert: { + value: function(instance) { + if (instance !== null) { + if (typeof instance.context === "undefined") { + var metadata = Montage.getInfoForObject(instance); + var blueprint = this.blueprintForPrototype(metadata.objectName, metadata.moduleId); + if (blueprint !== null) { + ObjectProperty.manager.apply(Object.getPrototypeOf(instance), blueprint); + } else { + throw Exception.create().initWithMessageTargetAndMethod("Cannot find blueprint for: " + metadata.objectName + " " + metadata.moduleId, this, "insert"); + } + } + if (instance.context === null) { + instance.context = this; + this._inserted.add(instance); + return this.initializeObject(instance, this).then(function(instance) { + this._objectMap.set(instance.objectId, instance); + return Promise.ref(instance); + }.bind(this)); + } else if (instance.context !== this) { + throw Exception.initWithMessageTargetAndMethod("This instance is already inserted in another context.", this, "insert"); + } + } else { + throw Exception.initWithMessageTargetAndMethod("Cannot insert a null object.", this, "insert"); + } + } + }, + + /** + Delete an object.
+ A deleted object will be deleted from the backing store on the next save. + @function + @param {Object} instance TODO + @returns Promise.ref(instance) + */ + 'delete': { + value: function(instance) { + if (instance !== null) { + if ((typeof instance.context === "undefined") || (instance.context === null)) { + return Promise.ref(instance); + } + if (instance.context !== this) { + throw Exception.initWithMessageTargetAndMethod("This instance is belongs to another context.", this, "delete"); + } + if (this._inserted.has(instance)) { + // We are forgetting a newly inserted object + this._inserted.delete(instance); + if (typeof instance.context !== "undefined") { + instance.context = null; + } + } else { + if (this._modified.has(instance)) { + // the object was modified before teh delete forget those. + this._modified.delete(instance); + instance = this._revertValues(instance); + } + this._deleted.add(instance); + } + this._objectMap.delete(instance.objectId); + } else { + throw Exception.initWithMessageTargetAndMethod("Cannot delete a null object.", this, "delete"); + } + return Promise.ref(instance); + } + }, + + /** + Revert an object to its saved values. + @function + @param {Object} instance TODO + @returns Promise.ref(instance) + */ + revert: { + value: function(instance) { + if (instance !== null) { + if (typeof instance.context === "undefined") { + return Promise.ref(instance); + } + if (instance.context !== null) { + if (instance.context !== this) { + throw Exception.initWithMessageTargetAndMethod("This instance is belongs to another context.", this, "revert"); + } + if (this._inserted.has(instance)) { + // This is a newly inserted object, there is no value to revert to, so do nothing. + } else if (this._modified.has(instance)) { + this._modified.delete(instance); + instance = this._revertValues(instance); + } + } else { + // Maybe that object was deleted let retrieve it? + if (this._deleted.has(instance)) { + this._deleted.delete(instance); + instance.context = this; + instance = this._revertValues(instance); + } + } + } else { + throw Exception.initWithMessageTargetAndMethod("Cannot revert a null object.", this, "revert"); + } + return Promise.ref(instance); + } + }, + + /** + Description TODO + @private + */ + _revertValues: { + value: function(instance) { + // TODO [PJYF May 24 2011] We should restore the saved values + return Promise.ref(instance); + } + }, + + /** + Saves all current changes and deletion to the backing store. + @function + */ + save: { + value: function() { + // TODO [PJYF Sept 4 2011] This is probably incomplete - we need to handle the callback + if (this.hasChanges()) { + this.parent.saveChangesInContext(this); + } + } + }, + + /** + This method from the parent store is overwritten to handle the save from the child context. + @function + @param {Property} context The child context + @param {String} transactionID The transaction id + */ + saveChangesInContext$Implementation: { + value: function(context, transactionID) { + if (context === this) { + // If called on it-self then save the context + Store.saveChangesInContext$Implementation.call(this, context, transactionID); + } + // The context has all the changes and we need to merge them with our own. + var inserted = context.inserted; + var deleted = context.deleted; + var modified = context.modified; + + var newUpdated = null; + var removedInserted = null; + + // First create and insert all new objects + inserted.forEach(function(object) { + var gid = object.objectId; + var localObject = this.objectForId(gid); + + if (localObject == null) { + // Insert a copy in our context. + ; + } else { + // Inserting an object already registered in my context? Pretty bogus! Treat it as an update. + ; + // Remove from the inserted list and add it to the updated one. + ; + } + + }); + + // Initialize the property values in these new objects. + + // Copy the values for all updated objects. + + // Delete removed Objects. + + // TODO [PJYF Sept 4 2011] This needs to be reimplemented + + } + }, + + /** + Description TODO + @function + @param {String} attribute TODO + @param {Object} instance TODO + */ + fulfillPropertyForInstance: { + value: function(attribute, instance) { + + } + }, + + /** + Description TODO + @function + @param {String} attribute TODO + @param {Object} instance TODO + */ + willModifyPropertyForInstance: { + value: function(attribute, instance) { + // TODO [PJYF Sep 30 2011] We should probably be smarter. + this._modified.add(instance); + } + }, + + /** + Fetch objects from the backing store. + @function + @param {String} query TODO + @returns Promise.ref(this.parent.queryInContext(query, this)) + */ + query: { + value: function(query) { + // TODO [PJYF Sept 23 2011] This is probably incomplete - we need to handle the refresh + return Promise.ref(this.parent.queryInContext(query, this)); + } + }, + + /** + Reload all objects from the backing store and merges changes in the context with the new values.
+ If the target passed is an Array each object will be refreshed. + @function + @param {Object} target The target to be refreshed. + @returns Promise.ref(this.repledgeObject(target, this)) + */ + refresh: { + value: function(target) { + // TODO [PJYF May 10 2011] This is incorrect we need to merge the changes in the refaulted objects + return Promise.ref(this.repledgeObject(target, this)); + } + }, + + /** + Check if there are unsaved changes in the context. + @function + @returns this._inserted.length > 0 or this._modified.length > 0 or this._deleted.length > 0 + */ + hasChanges: { + value: function() { + return this._inserted.length > 0 || this._modified.length > 0 || this._deleted.length > 0; + } + } + +}); diff --git a/node_modules/montage-user/data/controllistener.js b/node_modules/montage-user/data/controllistener.js new file mode 100755 index 00000000..94908ad6 --- /dev/null +++ b/node_modules/montage-user/data/controllistener.js @@ -0,0 +1,47 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +/** + @module montage/data/controllistener + @requires montage/core/core + @requires montage/core/logger +*/ +var Montage = require("montage").Montage; +var logger = require("core/logger").logger("controlListener"); +/** + @class module:montage/data/controllistener.ControlListener + @extends module:montage/core/core.Montage +*/ +var ControlListener = exports.ControlListener = Montage.create(Montage,/** @lends module:montage/data/controllistener.ControlListener# */ { +/** + Description TODO + @function + @param {Property} delegate TODO + @param {Property} key TODO + @param {Property} identifier TODO + @returns null + */ + callbackForKey: { + value: function(delegate, key, identifier) { + if (typeof delegate !== "function") { + return delegate; + } + if ((typeof delegate !== "object") || (typeof key !== "string")) { + return null; + } + if (identifier) { + var newKey = identifier + key.toCapitalized(); + if (typeof delegate[newKey] === "function") { + return delegate[newKey]; + } + } + if (typeof delegate[key] === "function") { + return delegate[key]; + } + return null; + } + } + +}); diff --git a/node_modules/montage-user/data/ldapaccess/ldapblueprint.js b/node_modules/montage-user/data/ldapaccess/ldapblueprint.js new file mode 100755 index 00000000..32444fef --- /dev/null +++ b/node_modules/montage-user/data/ldapaccess/ldapblueprint.js @@ -0,0 +1,135 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +/** + @module montage/data/ldapaccess/ldapblueprint + @requires montage/core/core + @requires montage/data/blueprint + @requires montage/data/ldapaccess/ldapselectorevaluator + @requires montage/core/logger +*/ +var Montage = require("montage").Montage; +var Blueprint = require("data/blueprint").Blueprint; +var BlueprintBinder = require("data/blueprint").BlueprintBinder; +var ToOneAttribute = require("data/blueprint").ToOneAttribute; +var ToManyAttribute = require("data/blueprint").ToManyAttribute; +var ToOneRelationship = require("data/blueprint").ToOneRelationship; +var ToManyRelationship = require("data/blueprint").ToManyRelationship; +var LdapSelectorEvaluator = require("data/ldapaccess/ldapselectorevaluator").LdapSelectorEvaluator; // registering the evaluators +var logger = require("core/logger").logger("ldapblueprint"); + +/** + @class module:montage/data/ldapaccess/ldapblueprint.LdapBlueprintBinder + @extends module:montage/data/blueprint.BlueprintBinder +*/ +var LdapBlueprintBinder = exports.LdapBlueprintBinder = Montage.create(BlueprintBinder,/** @lends module:montage/data/ldapaccess/ldapblueprint.LdapBlueprintBinder# */ { + +/** + Description TODO + @type {Property} URL + @default {String} "montage/data/ldapaccess/ldapstore" + */ + storeModuleId: { + value: "montage/data/ldapaccess/ldapstore" + }, +/** + Description TODO + @type {Property} + @default {String} "LdapStore" + */ + storePrototypeName: { + value: "LdapStore" + }, +/** + Description TODO + @function + @returns LdapBlueprint.create() + */ + createBlueprint: { + value: function() { + return LdapBlueprint.create(); + } + } + + +}) +/** + @class module:montage/data/idapaccess/ldapblueprint.LdapBlueprint +*/ +var LdapBlueprint = exports.LdapBlueprint = Montage.create(Blueprint,/** @lends module:montage/data/idapaccess/ldapblueprint.LdapBlueprint# */ { + +/** + Conventional method to crete new attribute.
+ This can be overwritten by specific stores. + @function + @returns LdapToOneAttribute.create() + */ + createToOneAttribute: { + value: function() { + return LdapToOneAttribute.create(); + } + }, + + /** + Conventional method to create a new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} LdapToManyAttribute.create() + */ + createToManyAttribute: { + value: function() { + return LdapToManyAttribute.create(); + } + }, + +/** + Conventional method to create a new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} LdapToOneRelationship.create() + */ + createToOneRelationship: { + value: function() { + return LdapToOneRelationship.create(); + } + }, + +/** + Conventional method to create a new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} LdapToManyRelationship.create() + */ + createToManyRelationship: { + value: function() { + return LdapToManyRelationship.create(); + } + } + +}); +/** + @class module:montage/data/ldapaccess/ldapblueprint.LdapToOneAttribute +*/ +var LdapToOneAttribute = exports.LdapToOneAttribute = Montage.create(ToOneAttribute,/** @lends module:montage/data/ldapaccess/ldapblueprint.LdapToOneAttribute# */ { + +}); +/** + @class module:montage/data/ldapaccess/ldapblueprint.LdapToOneRelationship +*/ +var LdapToOneRelationship = exports.LdapToOneRelationship = Montage.create(ToOneRelationship,/** @lends module:montage/data/ldapaccess/ldapblueprint.LdapToOneRelationship# */ { + +}); +/** + @class module:montage/data/ldapaccess/ldapblueprint.LdapToManyAttribute +*/ +var LdapToManyAttribute = exports.LdapToManyAttribute = Montage.create(ToManyAttribute,/** @lends module:montage/data/ldapaccess/ldapblueprint.LdapToManyAttribute# */ { + +}); +/** + @class module:montage/data/ldapaccess/ldapblueprint.LdapToManyRelationship +*/ +var LdapToManyRelationship = exports.LdapToManyRelationship = Montage.create(ToManyRelationship/** @lends module:montage/data/ldapaccess/ldapblueprint.LdapToManyRelationship# */, { + +}); diff --git a/node_modules/montage-user/data/ldapaccess/ldapobjectid.js b/node_modules/montage-user/data/ldapaccess/ldapobjectid.js new file mode 100755 index 00000000..642f7c5e --- /dev/null +++ b/node_modules/montage-user/data/ldapaccess/ldapobjectid.js @@ -0,0 +1,20 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +/** + @module montage/data/ldapaccess/ldapobjectid + @requires montage/core/core + @requires montage/core/logger +*/ +var Montage = require("montage").Montage; +var logger = require("core/logger").logger("ldapobjectid"); +/** + @class module:montage/data/ldapaccess/ldapobjectid.LdapObjectId + @extends module:montage/core/core.Montage +*/ +var LdapObjectId = exports.LdapObjectId = Montage.create(Montage,/** @lends module:montage/data/ldapaccess/ldapobjectid.LdapObjectId # */ { + + +}); diff --git a/node_modules/montage-user/data/ldapaccess/ldapselectorevaluator.js b/node_modules/montage-user/data/ldapaccess/ldapselectorevaluator.js new file mode 100755 index 00000000..a14bee2e --- /dev/null +++ b/node_modules/montage-user/data/ldapaccess/ldapselectorevaluator.js @@ -0,0 +1,24 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +/** + @module montage/data/ldapaccess/ldapselectorevaluator + @requires montage/core/core + @requires montage/data/selector + @requires montage/core/logger +*/ +var Montage = require("montage").Montage; +var SelectorEvaluator = require("data/selector").SelectorEvaluator; +var Selector = require("data/selector").Selector; +var logger = require("core/logger").logger("ldapselectorevaluator"); +/** + @class module:montage/data/ldapaccess/ldapselectorevaluator.LdapSelectorEvaluator + @extends module:montage/data/selector.SelectorEvaluator +*/ +var LdapSelectorEvaluator = exports.LdapSelectorEvaluator = Montage.create(SelectorEvaluator,/** @lends module:montage/data/ldapaccess/ldapselectorevaluator.LdapSelectorEvaluator# */ { + + +}); +Selector.registry.registerEvaluator(LdapSelectorEvaluator); diff --git a/node_modules/montage-user/data/ldapaccess/ldapstore.js b/node_modules/montage-user/data/ldapaccess/ldapstore.js new file mode 100755 index 00000000..b92517f2 --- /dev/null +++ b/node_modules/montage-user/data/ldapaccess/ldapstore.js @@ -0,0 +1,38 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +/** + @module montage/data/ldapaccess/ldapstore + @requires montage/core/core + @requires montage/data/store + @requires montage/core/logger +*/ +var Montage = require("montage").Montage; +var Store = require("data/store").Store; +var logger = require("core/logger").logger("ldapstore"); +/** + @class module:montage/data/ldapaccess/ldapstore.LdapStore + @extends module:montage/core/core.Montage +*/ +var LdapStore = exports.LdapStore = Montage.create(Store,/** @lends module:montage/data/ldapaccess/ldapstore.LdapStore# */ { + +/** + Description TODO + @function + @param {Property} binder TODO + @returns {Boolean} true or false + */ + canServiceBlueprintBinder: { + value: function(binder) { + if ((binder !== null) && (binder.storePrototypeName === "LdapStore")) { + // TODO [PJYF Apr 28 2011] We need to check that the connection url points to the same DB + return true; + } + return false; + } + } + + +}); diff --git a/node_modules/montage-user/data/nosqlaccess/nosqlblueprint.js b/node_modules/montage-user/data/nosqlaccess/nosqlblueprint.js new file mode 100755 index 00000000..bffd4ba6 --- /dev/null +++ b/node_modules/montage-user/data/nosqlaccess/nosqlblueprint.js @@ -0,0 +1,135 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +/** + @module montage/data/nosqlaccess/nosqlblueprint + @requires montage/core/core + @requires montage/data/blueprint + @requires montage/data/nosqlaccess/nosqlselectorevaluator + @requires montage/core/logger +*/ +var Montage = require("montage").Montage; +var Blueprint = require("data/blueprint").Blueprint; +var BlueprintBinder = require("data/blueprint").BlueprintBinder; +var ToOneAttribute = require("data/blueprint").ToOneAttribute; +var ToManyAttribute = require("data/blueprint").ToManyAttribute; +var ToOneRelationship = require("data/blueprint").ToOneRelationship; +var ToManyRelationship = require("data/blueprint").ToManyRelationship; +var NoSqlSelectorEvaluator = require("data/nosqlaccess/nosqlselectorevaluator").NoSqlSelectorEvaluator; // registering the evaluators +var logger = require("core/logger").logger("nosqlblueprint"); + +/** + @class module:montage/data/nosqlaccess/nosqlblueprint.NoSqlBlueprintBinder + @extends module:montage/data/blueprint.BlueprintBinder +*/ +var NoSqlBlueprintBinder = exports.NoSqlBlueprintBinder = Montage.create(BlueprintBinder,/** @lends module:montage/data/nosqlaccess/nosqlblueprint.NoSqlBlueprintBinder# */ { + +/** + The module ID of the store to use. + @type {Property} Function + @default {String} "montage/data/nosqlaccess/nosqlstore" + */ + storeModuleId: { + value: "montage/data/nosqlaccess/nosqlstore" + }, +/** + Description TODO + @type {Property} Function + @default {String} "NoSqlStore" + */ + storePrototypeName: { + value: "NoSqlStore" + }, +/** + Description TODO + @function + @returns {Function} NoSqlBlueprint.create() + */ + createBlueprint: { + value: function() { + return NoSqlBlueprint.create(); + } + } + + +}) +/** + @class module:montage/data/nosqlaccess/nosqlblueprint.NoSqlBlueprint +*/ +var NoSqlBlueprint = exports.NoSqlBlueprint = Montage.create(Blueprint,/** @lends module:montage/data/nosqlaccess/nosqlblueprint.NoSqlBlueprint# */ { + +/** + Conventional method to crete new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} NoSqlToOneAttribute.create() + */ + createToOneAttribute: { + value: function() { + return NoSqlToOneAttribute.create(); + } + }, + +/** + Conventional method to crete new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} NoSqlToManyAttribute.create() + */ + createToManyAttribute: { + value: function() { + return NoSqlToManyAttribute.create(); + } + }, + +/** + Conventional method to crete new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} NoSqlToOneRelationship.create() + */ + createToOneRelationship: { + value: function() { + return NoSqlToOneRelationship.create(); + } + }, + +/** + Conventional method to crete new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} NoSqlToManyRelationship.create() + */ + createToManyRelationship: { + value: function() { + return NoSqlToManyRelationship.create(); + } + } + +}); +/** + @class module:montage/data/nosqlaccess/nosqlblueprint.NoSqlToOneAttribute +*/ +var NoSqlToOneAttribute = exports.NoSqlToOneAttribute = Montage.create(ToOneAttribute,/** @lends module:montage/data/nosqlaccess/nosqlblueprint.NoSqlToOneAttribute# */ { + +}); +/** + @class module:montage/data/nosqlaccess/nosqlblueprint.NoSqlToOneRelationship +*/ +var NoSqlToOneRelationship = exports.NoSqlToOneRelationship = Montage.create(ToOneRelationship,/** @lends module:montage/data/nosqlaccess/nosqlblueprint.NoSqlToOneRelationship# */ { + +}); +/** + @class module:montage/data/nosqlaccess/nosqlblueprint.NoSqlToManyAttribute +*/ +var NoSqlToManyAttribute = exports.NoSqlToManyAttribute = Montage.create(ToManyAttribute,/** @lends module:montage/data/nosqlaccess/nosqlblueprint.NoSqlToManyAttribute# */ { + +}); +/** + @class module:montage/data/nosqlaccess/nosqlblueprint.NoSqlToManyRelationship +*/ +var NoSqlToManyRelationship = exports.NoSqlToManyRelationship = Montage.create(ToManyRelationship,/** @lends module:montage/data/nosqlaccess/nosqlblueprint.NoSqlToManyRelationship# */ { + +}); diff --git a/node_modules/montage-user/data/nosqlaccess/nosqlobjectid.js b/node_modules/montage-user/data/nosqlaccess/nosqlobjectid.js new file mode 100755 index 00000000..eaca83c9 --- /dev/null +++ b/node_modules/montage-user/data/nosqlaccess/nosqlobjectid.js @@ -0,0 +1,22 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +/** + @module montage/data/nosqlaccess/nosqlobjectid + @requires montage/core/core + @requires montage/data/objectid + @requires montage/core/logger +*/ +var Montage = require("montage").Montage; +var ObjectId = require("data/objectid").ObjectId; +var logger = require("core/logger").logger("nosqlobjectid"); +/** + @class module:montage/data/nosqlaccess/nosqlobjectid.NoSqlObjectId + @extends module:montage/data/objectid.ObjectId +*/ +var NoSqlObjectId = exports.NoSqlObjectId = Montage.create(ObjectId,/** @lends module:montage/data/nosqlaccess/nosqlobjectid.NoSqlObjectId# */ { + + +}); diff --git a/node_modules/montage-user/data/nosqlaccess/nosqlselectorevaluator.js b/node_modules/montage-user/data/nosqlaccess/nosqlselectorevaluator.js new file mode 100755 index 00000000..d73f15c9 --- /dev/null