From b89a7ee8b956c96a1dcee995ea840feddc5d4b27 Mon Sep 17 00:00:00 2001 From: Pierre Frisch Date: Thu, 22 Dec 2011 07:25:50 -0800 Subject: First commit of Ninja to ninja-internal Signed-off-by: Valerio Virgillito --- .../montage/data/sqlaccess/sqlblueprint.js | 135 +++++++++++++++++++++ node_modules/montage/data/sqlaccess/sqlobjectid.js | 22 ++++ .../montage/data/sqlaccess/sqlselectorevaluator.js | 24 ++++ node_modules/montage/data/sqlaccess/sqlstore.js | 69 +++++++++++ 4 files changed, 250 insertions(+) create mode 100755 node_modules/montage/data/sqlaccess/sqlblueprint.js create mode 100755 node_modules/montage/data/sqlaccess/sqlobjectid.js create mode 100755 node_modules/montage/data/sqlaccess/sqlselectorevaluator.js create mode 100755 node_modules/montage/data/sqlaccess/sqlstore.js (limited to 'node_modules/montage/data/sqlaccess') diff --git a/node_modules/montage/data/sqlaccess/sqlblueprint.js b/node_modules/montage/data/sqlaccess/sqlblueprint.js new file mode 100755 index 00000000..5c389e3c --- /dev/null +++ b/node_modules/montage/data/sqlaccess/sqlblueprint.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/sqlaccess/sqlblueprint + @requires montage/core/core + @requires montage/data/blueprint + @requires montage/data/sqlaccess/sqlselectorevaluator + @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 SqlSelectorEvaluator = require("data/sqlaccess/sqlselectorevaluator").SqlSelectorEvaluator; // registering the evaluators +var logger = require("core/logger").logger("sqlblueprint"); + +/** + @class module:montage/data/sqlaccess/sqlblueprint.SqlBlueprintBinder + @extends module:montage/data/blueprint.BlueprintBinder +*/ +var SqlBlueprintBinder = exports.SqlBlueprintBinder = Montage.create(BlueprintBinder,/** @lends module:montage/data/sqlaccess/sqlblueprint.SqlBlueprintBinder# */ { + +/** + Description TODO + @type {Property} URL + @default {String} "montage/data/sqlaccess/sqlstore" + */ + storeModuleId: { + value: "data/sqlaccess/sqlstore" + }, +/** + Description TODO + @type {Property} + @default {String} "SqlStore" + */ + storePrototypeName: { + value: "SqlStore" + }, +/** + Description TODO + @function + @returns {Function} SqlBlueprint.create() + */ + createBlueprint: { + value: function() { + return SqlBlueprint.create(); + } + } + + +}) +/** + @class module:montage/data/sqlaccess/sqlblueprint.SqlBlueprint +*/ +var SqlBlueprint = exports.SqlBlueprint = Montage.create(Blueprint,/** @lends module:montage/data/sqlaccess/sqlblueprint.SqlBlueprint# */ { + +/** + Conventional method to crete new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} SqlToOneAttribute.create() + */ + createToOneAttribute: { + value: function() { + return SqlToOneAttribute.create(); + } + }, + +/** + Conventional method to crete new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} SqlToManyAttribute.create() + */ + createToManyAttribute: { + value: function() { + return SqlToManyAttribute.create(); + } + }, + + /** + Conventional method to crete new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} SqlToOneRelationship.create() + */ + createToOneRelationship: { + value: function() { + return SqlToOneRelationship.create(); + } + }, + +/** + Conventional method to crete new attribute.
+ This can be overwritten by specific stores. + @function + @returns {Function} SqlToManyRelationship.create() + */ + createToManyRelationship: { + value: function() { + return SqlToManyRelationship.create(); + } + } + +}); +/** + @class module:montage/data/sqlaccess/sqlblueprint.SqlToOneAttribute +*/ +var SqlToOneAttribute = exports.SqlToOneAttribute = Montage.create(ToOneAttribute,/** @lends module:montage/data/sqlaccess/sqlblueprint.SqlToOneAttribute# */ { + +}); +/** + @class module:montage/data/sqlaccess/sqlblueprint.SqlToOneRelationship +*/ +var SqlToOneRelationship = exports.SqlToOneRelationship = Montage.create(ToOneRelationship,/** @lends module:montage/data/sqlaccess/sqlblueprint.SqlToOneRelationship# */ { + +}); +/** + @class module:montage/data/sqlaccess/sqlblueprint.SqlToManyAttribute +*/ +var SqlToManyAttribute = exports.SqlToManyAttribute = Montage.create(ToManyAttribute,/** @lends module:montage/data/sqlaccess/sqlblueprint.SqlToManyAttribute# */ { + +}); +/** + @class module:montage/data/sqlaccess/sqlblueprint.SqlToManyRelationship +*/ +var SqlToManyRelationship = exports.SqlToManyRelationship = Montage.create(ToManyRelationship, /** @lends module:montage/data/sqlaccess/sqlblueprint.SqlToManyRelationship# */{ + +}); diff --git a/node_modules/montage/data/sqlaccess/sqlobjectid.js b/node_modules/montage/data/sqlaccess/sqlobjectid.js new file mode 100755 index 00000000..1a450fbe --- /dev/null +++ b/node_modules/montage/data/sqlaccess/sqlobjectid.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/sqlaccess/sqlobjectid + @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("sqlobjectid"); +/** + @class module:montage/data/sqlaccess/sqlobjectid.SqlObjectId + @extends module:montage/data/objectid.ObjectId +*/ +var SqlObjectId = exports.SqlObjectId = Montage.create(ObjectId, /** @lends module:montage/data/sqlaccess/sqlobjectid.SqlObjectId# */{ + + +}); diff --git a/node_modules/montage/data/sqlaccess/sqlselectorevaluator.js b/node_modules/montage/data/sqlaccess/sqlselectorevaluator.js new file mode 100755 index 00000000..91eb2e1c --- /dev/null +++ b/node_modules/montage/data/sqlaccess/sqlselectorevaluator.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/sqlaccess/sqlselectorevaluator + @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("sqlselectorevaluator"); +/** + @class module:montage/data/sqlaccess/sqlselectorevaluator.SqlSelectorEvaluator + @extends module:montage/data/selector.SelectorEvaluator +*/ +var SqlSelectorEvaluator = exports.SqlSelectorEvaluator = Montage.create(SelectorEvaluator,/** @lends module:montage/data/sqlaccess/sqlselectorevaluator.SqlSelectorEvaluator# */ { + + +}); +Selector.registry.registerEvaluator(SqlSelectorEvaluator); diff --git a/node_modules/montage/data/sqlaccess/sqlstore.js b/node_modules/montage/data/sqlaccess/sqlstore.js new file mode 100755 index 00000000..e8d22eb4 --- /dev/null +++ b/node_modules/montage/data/sqlaccess/sqlstore.js @@ -0,0 +1,69 @@ +/* +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/sqlaccess/sqlstore + @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("sqlstore"); + +/** + @class module:montage/data/sqlaccess/sqlstore.SqlStore + @extends module:montage/data/store.Store +*/ +var SqlStore = exports.SqlStore = Montage.create(Store,/** @lends module:montage/data/sqlaccess/sqlstore.SqlStore# */ { + +/** + Description TODO + @function + @param {Property} binder TODO + @returns {Boolean} true or false + */ + canServiceBlueprintBinder: { + value: function(binder) { + if ((binder !== null) && (binder.storePrototypeName === "SqlStore")) { + // TODO [PJYF Apr 19 2011] We need to check that the connection url points to the same DB + return true; + } + return false; + } + }, + +/** + Description TODO + @function + @param {Object} objectId TODO + @param {Property} context TODO + @param {Property} transactionId TODO + @returns null + */ + pledgeForObjectId$Implementation: { + value: function(objectId, context, transactionId) { + // TODO [PJYF Apr 28 2011] We need to implement it. + return null; + } + }, + +/** + Description TODO + @function + @param {Object} sourceObject TODO + @param {Property} relationship TODO + @param {Property} context TODO + @param {Property} transactionId TODO + @returns null + */ + pledgeForSourceObjectRelationship$Implementation: { + value: function(sourceObject, relationship, context, transactionId) { + // TODO [PJYF Apr 28 2011] We need to implement it. + return null; + } + } + +}); -- cgit v1.2.3