no need to drag the initial workspace
This commit is contained in:
1 parent
fa7d55e541
commit
2e652a498f
9 files changed
+32
-189
No files matched your search
@@ -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;
|
||||
}
|
||||
@@ -17,21 +17,18 @@ 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',
|
||||
'Workspace.js',
|
||||
'MQService',
|
||||
|
||||
'ChartingSpace/EdgeEditor.js',
|
||||
|
||||
+22
-28
@@ -191,12 +191,6 @@ function onBrowserRequest (request, response) {
|
||||
}
|
||||
break
|
||||
|
||||
case 'Ecosystem.js':
|
||||
{
|
||||
respondWithFile(process.env.PATH_TO_WEB_SERVER + 'Ecosystem.js', response)
|
||||
}
|
||||
break
|
||||
|
||||
case 'Images': // This means the Scripts folder.
|
||||
{
|
||||
let path = process.env.PATH_TO_WEB_SERVER + 'Images/' + requestParameters[2]
|
||||
@@ -340,28 +334,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')
|
||||
@@ -384,6 +356,28 @@ function onBrowserRequest (request, response) {
|
||||
}
|
||||
break
|
||||
|
||||
case 'Workspace.js':
|
||||
{
|
||||
let fs = require('fs')
|
||||
|
||||
try {
|
||||
let filePath = process.env.INTER_PROCESS_FILES_PATH + '/Workspace.json'
|
||||
fs.readFile(filePath, onFileRead)
|
||||
} catch (e) {
|
||||
console.log('[ERROR] Error reading the Workspace.', e)
|
||||
}
|
||||
|
||||
function onFileRead(err, workspace) {
|
||||
if (err) {
|
||||
respondWithContent(undefined, response)
|
||||
} else {
|
||||
let responseContent = 'function getWorkspace(){ return ' + workspace + '}'
|
||||
respondWithContent(responseContent, response)
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
|
||||
case 'Storage':
|
||||
{
|
||||
respondWithFile(process.env.STORAGE_PATH + '/' + request.url.substring(9), response)
|
||||
|
||||
Reference in new issue
Block a user