diff --git a/Ecosystem.js b/Ecosystem.js deleted file mode 100644 index beb6f5573..000000000 --- a/Ecosystem.js +++ /dev/null @@ -1,149 +0,0 @@ - -function newEcosystem() { - - let thisObject = { - getHost: getHost, - getCompetition: getCompetition, - getDataMine: getDataMine, - getDataMines: getDataMines, - getBot: getBot, - getProduct: getProduct, - getDataSet: getDataSet, - getExchange: getExchange, - getPlotter: getPlotter, - getPlotterModule: getPlotterModule, - getStoragePermissions: getStoragePermissions, - setEvent: setEvent, - initialize: initialize - } - - let ECOSYSTEM = JSON.parse(window.localStorage.getItem('ecosystem')); - if (ECOSYSTEM === null || ECOSYSTEM === undefined) { - ECOSYSTEM = getUserEcosystem() - } - - return thisObject; - - function initialize() { - - } - - function setEvent(input) { - ECOSYSTEM.hosts = input; - } - - function getStoragePermissions() { - - return ECOSYSTEM.STORAGE_PERMISSIONS; - - } - - function getHost(pHostCodeName) { - - for (let i = 0; i < ECOSYSTEM.hosts.length; i++) { - - if (ECOSYSTEM.hosts[i].codeName === pHostCodeName) { - - return ECOSYSTEM.hosts[i]; - } - } - } - - function getCompetition(pHost, pCompetitionCodeName) { - - for (let i = 0; i < pHost.competitions.length; i++) { - - if (pHost.competitions[i].codeName === pCompetitionCodeName) { - - return pHost.competitions[i]; - } - } - } - - function getDataMines() { - - return ECOSYSTEM.dataMines; - - } - - function getDataMine(pDataMineCodeName) { - - for (let i = 0; i < ECOSYSTEM.dataMines.length; i++) { - - if (ECOSYSTEM.dataMines[i].codeName === pDataMineCodeName) { - - return ECOSYSTEM.dataMines[i]; - } - } - } - - function getBot(pDataMine, pBotCodeName) { - - for (let i = 0; i < pDataMine.bots.length; i++) { - - if (pDataMine.bots[i].codeName === pBotCodeName) { - - return pDataMine.bots[i]; - } - } - } - - function getPlotter(pDataMine, pPlotterCodeName) { - - for (let i = 0; i < pDataMine.plotters.length; i++) { - - if (pDataMine.plotters[i].codeName === pPlotterCodeName) { - - return pDataMine.plotters[i]; - } - } - } - - function getPlotterModule(pPlotter, pModuleCodeName) { - - for (let i = 0; i < pPlotter.modules.length; i++) { - - if (pPlotter.modules[i].codeName === pModuleCodeName) { - - return pPlotter.modules[i]; - } - } - } - - function getProduct(pBot, pProductCodeName) { - - for (let i = 0; i < pBot.products.length; i++) { - - if (pBot.products[i].codeName === pProductCodeName) { - - return pBot.products[i]; - } - } - } - - function getDataSet(pProduct, pSetCodeName) { - - for (let i = 0; i < pProduct.dataSets.length; i++) { - - if (pProduct.dataSets[i].codeName === pSetCodeName) { - - return pProduct.dataSets[i]; - } - } - } - - function getExchange(pProduct, pName) { - - for (let i = 0; i < pProduct.exchangeList.length; i++) { - - if (pProduct.exchangeList[i].name === pName) { - - return pProduct.exchangeList[i]; - } - } - } - - - - return false; -} diff --git a/Project.njsproj b/Project.njsproj index bbbf77562..44f1a4295 100644 --- a/Project.njsproj +++ b/Project.njsproj @@ -31,7 +31,6 @@ true - @@ -44,7 +43,6 @@ - diff --git a/Scripts/AppLoader.js b/Scripts/AppLoader.js index 7cbf924cc..0e76e1c32 100644 --- a/Scripts/AppLoader.js +++ b/Scripts/AppLoader.js @@ -17,20 +17,16 @@ function newAppLoader() { try { if (INFO_LOG === true) { logger.write('[INFO] loadModules -> Entering function.') } - window.localStorage.removeItem('ecosystem') - let plotters let modulesArray = [] plotters = defaultPlotters() - modulesArray = ['UserEcosystem.js'] modulesArray = modulesArray.concat([ 'ChartingSpace/Viewport.js', - + 'Globals.js', - 'Ecosystem.js', - 'UserEcosystem.js', + 'AppSchema.js', 'MQService', diff --git a/server.js b/server.js index ec81065fb..0491a6019 100644 --- a/server.js +++ b/server.js @@ -340,28 +340,6 @@ function onBrowserRequest (request, response) { } break - case 'UserEcosystem.js': - { - let fs = require('fs') - - try { - let filePath = process.env.INTER_PROCESS_FILES_PATH + '/ecosystem.json' - fs.readFile(filePath, onFileRead) - } catch (e) { - console.log('[ERROR] Error reading the user ecosystem.', e) - } - - function onFileRead (err, userEcosystem) { - if (err) { - respondWithContent(undefined, response) - } else { - let responseContent = 'function getUserEcosystem(){ return ' + userEcosystem + '}' - respondWithContent(responseContent, response) - } - } - } - break - case 'AppSchema.js': { let fs = require('fs')