From e80988c33b51cb7df97b76d009ad282f25223e5b Mon Sep 17 00:00:00 2001 From: Bharath Hariharan Date: Wed, 18 Sep 2019 18:25:48 -0700 Subject: [PATCH] First round of renames within files --- README.md | 10 ++++----- gen/cordova_plugins.js | 6 ++--- .../com.salesforce.plugin.smartsync.js | 2 +- .../com.salesforce.plugin.smartsync.js | 4 ++-- libs/cordova.force.js | 4 ++-- libs/mobilesync.js | 2 +- samples/accounteditor/AccountEditor.html | 2 +- samples/fileexplorer/FileExplorer.html | 2 +- .../mobilesyncexplorer/SmartSyncExplorer.html | 8 +++---- samples/mobilesyncexplorer/bootconfig.json | 2 +- samples/notesync/NoteSync.html | 8 +++---- samples/simplesyncreact/SimpleSync.html | 8 +++---- .../UserAndGroupSearch.html | 2 +- samples/usersearch/UserSearch.html | 2 +- setversion.sh | 10 +++++++++ test/MockSDKInfo.js | 2 +- test/MockSmartSyncPlugin.js | 22 +++++++++---------- test/SFSDKInfoTestSuite.js | 2 +- test/forcepluginstest/index.html | 4 ++-- test/test.html | 10 ++++----- 20 files changed, 61 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 00993b34..191db69c 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ Library to do file related REST API calls from JavaScript. Library to do REST API calls from JavaScript using promises instead of callbacks. -**smartsync.js** +**mobilesync.js** -Contains the SmartSync data library. +Contains the MobileSync data library. This library depends on force.js and cordova.force.js. It also requires underscore and backbone. # /test @@ -36,7 +36,7 @@ Contains all the tests for the SalesforceMobileSDK JavaScript libraries. HTML page to run the tests outside the container. -**MockCordova.js, MockSDKInfo.js, MockSmartStore.js, MockSmartSyncPlugin.js** +**MockCordova.js, MockSDKInfo.js, MockSmartStore.js, MockMobileSyncPlugin.js** Libraries used to mock the container when running tests directly in a browser. @@ -48,6 +48,6 @@ Super class of test suites. Test suites for SmartStore. -**SFSmartSyncTestSuite.js** +**SFMobileSyncTestSuite.js** -Test suite for SmartSync library. +Test suite for MobileSync library. diff --git a/gen/cordova_plugins.js b/gen/cordova_plugins.js index b76cd97b..8ef59d8b 100644 --- a/gen/cordova_plugins.js +++ b/gen/cordova_plugins.js @@ -27,8 +27,8 @@ module.exports = [ ] }, { - "file": "plugins/com.salesforce/com.salesforce.plugin.smartsync.js", - "id": "com.salesforce.plugin.smartsync", + "file": "plugins/com.salesforce/com.salesforce.plugin.mobilesync.js", + "id": "com.salesforce.plugin.mobilesync", }, { "file": "plugins/com.salesforce/com.salesforce.util.bootstrap.js", @@ -62,7 +62,7 @@ module.exports = [ module.exports.metadata = // TOP OF METADATA { - "com.salesforce": "7.2.0" + "com.salesforce": "8.0.0" } // BOTTOM OF METADATA }); diff --git a/gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js b/gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js index 2668c596..38b412e6 100644 --- a/gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js +++ b/gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js @@ -26,7 +26,7 @@ // Version this js was shipped with var SALESFORCE_MOBILE_SDK_VERSION = "8.0.0"; -var SERVICE = "com.salesforce.smartsync"; +var SERVICE = "com.salesforce.mobilesync"; var exec = require("com.salesforce.util.exec").exec; var defaultStoreConfig = {'isGlobalStore':false}; diff --git a/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.smartsync.js b/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.smartsync.js index 7532dc3b..9c551aec 100644 --- a/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.smartsync.js +++ b/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.smartsync.js @@ -1,4 +1,4 @@ -cordova.define("com.salesforce.plugin.smartsync", function(require, exports, module) { +cordova.define("com.salesforce.plugin.mobilesync", function(require, exports, module) { /* * Copyright (c) 2012-present, salesforce.com, inc. * All rights reserved. @@ -27,7 +27,7 @@ cordova.define("com.salesforce.plugin.smartsync", function(require, exports, mod // Version this js was shipped with var SALESFORCE_MOBILE_SDK_VERSION = "8.0.0"; -var SERVICE = "com.salesforce.smartsync"; +var SERVICE = "com.salesforce.mobilesync"; var exec = require("com.salesforce.util.exec").exec; var defaultStoreConfig = {'isGlobalStore':false}; diff --git a/libs/cordova.force.js b/libs/cordova.force.js index e07ef946..65963a1b 100644 --- a/libs/cordova.force.js +++ b/libs/cordova.force.js @@ -1078,8 +1078,8 @@ cordova.define("com.salesforce.plugin.smartstore.client", function(require, expo // For backward compatibility navigator.smartstoreClient = cordova.require("com.salesforce.plugin.smartstore.client"); -cordova.define("com.salesforce.plugin.smartsync", function (require, exports, module) { - var SERVICE = "com.salesforce.smartsync"; +cordova.define("com.salesforce.plugin.mobilesync", function (require, exports, module) { + var SERVICE = "com.salesforce.mobilesync"; var exec = require("com.salesforce.util.exec").exec; var defaultStoreConfig = {'isGlobalStore':false}; diff --git a/libs/mobilesync.js b/libs/mobilesync.js index 9df59cee..fa372a64 100644 --- a/libs/mobilesync.js +++ b/libs/mobilesync.js @@ -84,7 +84,7 @@ { var sdkinfo = cordova.require("com.salesforce.plugin.sdkinfo"); if(sdkinfo && typeof(sdkinfo.registerAppFeature) === 'function'){ - // register SmartSync JS App feature + // register MobileSync JS App feature sdkinfo.registerAppFeature('SJ'); } } diff --git a/samples/accounteditor/AccountEditor.html b/samples/accounteditor/AccountEditor.html index 0eed50c4..5d3f989c 100644 --- a/samples/accounteditor/AccountEditor.html +++ b/samples/accounteditor/AccountEditor.html @@ -28,7 +28,7 @@ - + diff --git a/samples/fileexplorer/FileExplorer.html b/samples/fileexplorer/FileExplorer.html index 4636a7ab..ae35ff52 100644 --- a/samples/fileexplorer/FileExplorer.html +++ b/samples/fileexplorer/FileExplorer.html @@ -28,7 +28,7 @@ - + diff --git a/samples/mobilesyncexplorer/SmartSyncExplorer.html b/samples/mobilesyncexplorer/SmartSyncExplorer.html index 53ac923c..d73ff4b9 100644 --- a/samples/mobilesyncexplorer/SmartSyncExplorer.html +++ b/samples/mobilesyncexplorer/SmartSyncExplorer.html @@ -20,7 +20,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -175,11 +175,11 @@

Contacts

}, syncDown: function() { - cordova.require("com.salesforce.plugin.smartsync").reSync("syncDownContacts" /* see usersyncs.json */, this.handleSyncUpdate.bind(this)); + cordova.require("com.salesforce.plugin.mobilesync").reSync("syncDownContacts" /* see usersyncs.json */, this.handleSyncUpdate.bind(this)); }, syncUp: function() { - cordova.require("com.salesforce.plugin.smartsync").reSync("syncUpContacts" /* see usersyncs.json */, this.handleSyncUpdate.bind(this)); + cordova.require("com.salesforce.plugin.mobilesync").reSync("syncUpContacts" /* see usersyncs.json */, this.handleSyncUpdate.bind(this)); }, sync: function() { diff --git a/samples/mobilesyncexplorer/bootconfig.json b/samples/mobilesyncexplorer/bootconfig.json index ec2ff946..7083be68 100644 --- a/samples/mobilesyncexplorer/bootconfig.json +++ b/samples/mobilesyncexplorer/bootconfig.json @@ -3,7 +3,7 @@ "oauthRedirectURI": "testsfdc:///mobilesdk/detect/oauth/done", "oauthScopes": ["api","web"], "isLocal": true, - "startPage": "SmartSyncExplorer.html", + "startPage": "MobileSyncExplorer.html", "errorPage": "error.html", "shouldAuthenticate": true, "attemptOfflineLoad": false, diff --git a/samples/notesync/NoteSync.html b/samples/notesync/NoteSync.html index 37bfe2df..0e893059 100644 --- a/samples/notesync/NoteSync.html +++ b/samples/notesync/NoteSync.html @@ -20,7 +20,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -161,11 +161,11 @@

<%= Title %>

syncDown: function() { var target = {type:"custom", androidImpl:"com.salesforce.samples.notesync.ContentSoqlSyncDownTarget", iOSImpl:"SFContentSoqlSyncDownTarget", query:"SELECT " + this.fieldlist.join(",") + " FROM ContentNote LIMIT 1000"}; - cordova.require("com.salesforce.plugin.smartsync").syncDown(target, "notes", {mergeMode:Force.MERGE_MODE_DOWNLOAD.LEAVE_IF_CHANGED}, this.handleSyncUpdate.bind(this)); + cordova.require("com.salesforce.plugin.mobilesync").syncDown(target, "notes", {mergeMode:Force.MERGE_MODE_DOWNLOAD.LEAVE_IF_CHANGED}, this.handleSyncUpdate.bind(this)); }, syncUp: function(event) { - cordova.require("com.salesforce.plugin.smartsync").syncUp("notes", {fieldlist: this.fieldlist}, this.handleSyncUpdate.bind(this)); + cordova.require("com.salesforce.plugin.mobilesync").syncUp("notes", {fieldlist: this.fieldlist}, this.handleSyncUpdate.bind(this)); }, inspect: function() { diff --git a/samples/simplesyncreact/SimpleSync.html b/samples/simplesyncreact/SimpleSync.html index 44420322..9d0b7c8e 100644 --- a/samples/simplesyncreact/SimpleSync.html +++ b/samples/simplesyncreact/SimpleSync.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -120,7 +120,7 @@

Users

}, syncDown: function(target) { - cordova.require("com.salesforce.plugin.smartsync").syncDown(target, "users", {}, this.handleSyncUpdate.bind(this)); + cordova.require("com.salesforce.plugin.mobilesync").syncDown(target, "users", {}, this.handleSyncUpdate.bind(this)); }, syncDownMru: function(event) { @@ -136,7 +136,7 @@

Users

}, syncUp: function(event) { - cordova.require("com.salesforce.plugin.smartsync").syncUp("users", {fieldlist: this.fieldlist}, this.handleSyncUpdate.bind(this)); + cordova.require("com.salesforce.plugin.mobilesync").syncUp("users", {fieldlist: this.fieldlist}, this.handleSyncUpdate.bind(this)); }, cacheSize: function() { diff --git a/samples/userandgroupsearch/UserAndGroupSearch.html b/samples/userandgroupsearch/UserAndGroupSearch.html index ef817d02..ecf09e43 100644 --- a/samples/userandgroupsearch/UserAndGroupSearch.html +++ b/samples/userandgroupsearch/UserAndGroupSearch.html @@ -27,7 +27,7 @@ - + diff --git a/samples/usersearch/UserSearch.html b/samples/usersearch/UserSearch.html index 83750d29..ac946fdc 100644 --- a/samples/usersearch/UserSearch.html +++ b/samples/usersearch/UserSearch.html @@ -27,7 +27,7 @@ - + diff --git a/setversion.sh b/setversion.sh index ffe9a421..e2bee52a 100755 --- a/setversion.sh +++ b/setversion.sh @@ -39,6 +39,13 @@ update_package_json () gsed -i "s/\"version\":.*\"[^\"]*\"/\"version\": \"${version}\"/g" ${file} } +update_cordova_plugins () +{ + local file=$1 + local version=$2 + gsed -i "s/\"com.salesforce\":.*\"[^\"]*\"/\"com.salesforce\": \"${version}\"/g" ${file} +} + update_mock_sdk_info () { local file=$1 @@ -66,6 +73,9 @@ echo -e "${YELLOW}*** SETTING VERSION TO ${OPT_VERSION} ***${NC}" echo "*** Updating package.json ***" update_package_json "./package.json" "${OPT_VERSION}" +echo "*** Updating cordova_plugins.js ***" +update_cordova_plugins "./gen/cordova_plugins.js" "${OPT_VERSION}" + echo "*** Updating MockSDKInfo test ***" update_mock_sdk_info "./test/MockSDKInfo.js" "${OPT_VERSION}" diff --git a/test/MockSDKInfo.js b/test/MockSDKInfo.js index 42af6897..736da4a6 100644 --- a/test/MockSDKInfo.js +++ b/test/MockSDKInfo.js @@ -46,7 +46,7 @@ var MockSDKInfo = (function(window) { cordova.interceptExec(SDKINFO_SERVICE, "getInfo", function (successCB, errorCB, args) { successCB(new SDKInfo("8.0.0", - ["com.salesforce.oauth", "com.salesforce.sdkinfo", "com.salesforce.sfaccountmanager", "com.salesforce.network", "com.salesforce.testrunner", "com.salesforce.smartstore", "com.salesforce.smartsync"], + ["com.salesforce.oauth", "com.salesforce.sdkinfo", "com.salesforce.sfaccountmanager", "com.salesforce.network", "com.salesforce.testrunner", "com.salesforce.smartstore", "com.salesforce.mobilesync"], "SalesforceHybridSDKTestApp", "1.0", { "remoteAccessConsumerKey": "3MVG9Iu66FKeHhINkB1l7xt7kR8czFcCTUhgoA8Ol2Ltf1eYHOU4SqQRSEitYFDUpqRWcoQ2.dBv_a1Dyu5xa", diff --git a/test/MockSmartSyncPlugin.js b/test/MockSmartSyncPlugin.js index 2ae31d0c..3f96abd2 100644 --- a/test/MockSmartSyncPlugin.js +++ b/test/MockSmartSyncPlugin.js @@ -25,12 +25,12 @@ */ /** - * MockSmartSyncPlugin + * MockMobileSyncPlugin * Meant for development and testing only, the data is stored in SessionStorage, queries do full scans. * NB: cleanResyncGhosts only works for soql sync down */ -var MockSmartSyncPlugin = (function(window) { +var MockMobileSyncPlugin = (function(window) { // Constructor var module = function(storeConfig) { this.storeConfig = storeConfig; @@ -145,7 +145,7 @@ var MockSmartSyncPlugin = (function(window) { successCB(sync); if (target.type == "refresh") { - // smartsync.js doesn't have something equivalent to the (new in 5.0) refresh sync down + // mobilesync.js doesn't have something equivalent to the (new in 5.0) refresh sync down // So we need to get the local ids, build a soql query out of them // And use that for the collection cache.find({queryType:"range", orderPath:cache.keyField, pageSize:500}) // XXX not handling case with more than 500 local ids @@ -328,7 +328,7 @@ var SyncManagerMap = (function() { syncManager = isGlobalStore?this.globalSyncManagers[storeName]:this.userSyncManagers[storeName]; if(syncManager == null) { - syncManager = new MockSmartSyncPlugin({'isGlobalStore': isGlobalStore,'storeName' :storeName}); + syncManager = new MockMobileSyncPlugin({'isGlobalStore': isGlobalStore,'storeName' :storeName}); if(isGlobalStore == true) this.globalSyncManagers[storeName] = syncManager; else @@ -376,34 +376,34 @@ var syncManagerMap = new SyncManagerMap(); (function (cordova, syncManager, globalSyncManager) { - var SMARTSYNC_SERVICE = "com.salesforce.smartsync"; + var MOBILESYNC_SERVICE = "com.salesforce.mobilesync"; - cordova.interceptExec(SMARTSYNC_SERVICE, "syncUp", function (successCB, errorCB, args) { + cordova.interceptExec(MOBILESYNC_SERVICE, "syncUp", function (successCB, errorCB, args) { var mgr = syncManagerMap.getSyncManager(args); mgr.syncUp(args[0].target, args[0].soupName, args[0].options, args[0].syncName, successCB, errorCB); }); - cordova.interceptExec(SMARTSYNC_SERVICE, "syncDown", function (successCB, errorCB, args) { + cordova.interceptExec(MOBILESYNC_SERVICE, "syncDown", function (successCB, errorCB, args) { var mgr = syncManagerMap.getSyncManager(args); mgr.syncDown(args[0].target, args[0].soupName, args[0].options, args[0].syncName, successCB, errorCB); }); - cordova.interceptExec(SMARTSYNC_SERVICE, "getSyncStatus", function (successCB, errorCB, args) { + cordova.interceptExec(MOBILESYNC_SERVICE, "getSyncStatus", function (successCB, errorCB, args) { var mgr = syncManagerMap.getSyncManager(args); mgr.getSyncStatus(args[0].syncId || args[0].syncName, successCB, errorCB); }); - cordova.interceptExec(SMARTSYNC_SERVICE, "reSync", function (successCB, errorCB, args) { + cordova.interceptExec(MOBILESYNC_SERVICE, "reSync", function (successCB, errorCB, args) { var mgr = syncManagerMap.getSyncManager(args); mgr.reSync(args[0].syncId || args[0].syncName, successCB, errorCB); }); - cordova.interceptExec(SMARTSYNC_SERVICE, "cleanResyncGhosts", function (successCB, errorCB, args) { + cordova.interceptExec(MOBILESYNC_SERVICE, "cleanResyncGhosts", function (successCB, errorCB, args) { var mgr = syncManagerMap.getSyncManager(args); mgr.cleanResyncGhosts(args[0].syncId, successCB, errorCB); }); - cordova.interceptExec(SMARTSYNC_SERVICE, "deleteSync", function (successCB, errorCB, args) { + cordova.interceptExec(MOBILESYNC_SERVICE, "deleteSync", function (successCB, errorCB, args) { var mgr = syncManagerMap.getSyncManager(args); mgr.deleteSync(args[0].syncId || args[0].syncName, successCB, errorCB); }); diff --git a/test/SFSDKInfoTestSuite.js b/test/SFSDKInfoTestSuite.js index 748f34df..e8ff87f3 100644 --- a/test/SFSDKInfoTestSuite.js +++ b/test/SFSDKInfoTestSuite.js @@ -72,7 +72,7 @@ SDKInfoTestSuite.prototype.testGetInfo = function() { QUnit.equal(sdkInfo.forcePluginsAvailable[2], "com.salesforce.sdkinfo", "wrong force plugins"); QUnit.equal(sdkInfo.forcePluginsAvailable[3], "com.salesforce.sfaccountmanager", "wrong force plugins"); QUnit.equal(sdkInfo.forcePluginsAvailable[4], "com.salesforce.smartstore", "wrong force plugins"); - QUnit.equal(sdkInfo.forcePluginsAvailable[5], "com.salesforce.smartsync", "wrong force plugins"); + QUnit.equal(sdkInfo.forcePluginsAvailable[5], "com.salesforce.mobilesync", "wrong force plugins"); QUnit.equal(sdkInfo.forcePluginsAvailable[6], "com.salesforce.testrunner", "wrong force plugins"); // bootConfig QUnit.ok(sdkInfo.bootConfig.isLocal, "wrong bootConfig.isLocal"); diff --git a/test/forcepluginstest/index.html b/test/forcepluginstest/index.html index 863620ff..5f4a8830 100644 --- a/test/forcepluginstest/index.html +++ b/test/forcepluginstest/index.html @@ -18,7 +18,7 @@ - + @@ -30,7 +30,7 @@ - + - + - + @@ -33,7 +33,7 @@ - + @@ -83,7 +83,7 @@

Salesforce Javascript Libraries Tests

Run ForceJS Tests

Run SmartStore Tests

Run SmartStore Load Tests

-

Run SmartSync Tests

+

Run MobileSync Tests