Governance: Plugins Implementation Finished
This commit is contained in:
1 parent
914920d2dd
commit
1bf9e599ee
16 files changed
+317
-212
No files matched your search
@@ -90,6 +90,36 @@
|
||||
"type": "node",
|
||||
"childType": "Plugin API Maps",
|
||||
"autoAdd": false
|
||||
},
|
||||
{
|
||||
"name": "pluginUserProfiles",
|
||||
"type": "node",
|
||||
"childType": "Plugin User Profiles",
|
||||
"autoAdd": false
|
||||
},
|
||||
{
|
||||
"name": "pluginPools",
|
||||
"type": "node",
|
||||
"childType": "Plugin Pools",
|
||||
"autoAdd": false
|
||||
},
|
||||
{
|
||||
"name": "pluginAssets",
|
||||
"type": "node",
|
||||
"childType": "Plugin Assets",
|
||||
"autoAdd": false
|
||||
},
|
||||
{
|
||||
"name": "pluginFeatures",
|
||||
"type": "node",
|
||||
"childType": "Plugin Features",
|
||||
"autoAdd": false
|
||||
},
|
||||
{
|
||||
"name": "pluginPositions",
|
||||
"type": "node",
|
||||
"childType": "Plugin Positions",
|
||||
"autoAdd": false
|
||||
}
|
||||
],
|
||||
"alternativeIcons": [
|
||||
|
||||
@@ -14,31 +14,6 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
return thisObject
|
||||
|
||||
function getPluginFileNames(projectName, pluginType, callBack) {
|
||||
httpRequest(undefined, 'PluginFileNames/' + projectName + '/' + pluginType, onResponse)
|
||||
|
||||
function onResponse(err, data) {
|
||||
if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
console.log('Failed to Fetch Plugin ' + pluginType + ' from the Client')
|
||||
return
|
||||
}
|
||||
|
||||
let pluginFileNames = JSON.parse(data)
|
||||
callBack(pluginFileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addPluginFileIfNeeded(node, fileNames) {
|
||||
for (let i = 0; i < fileNames.length; i++) {
|
||||
let fileName = fileNames[i]
|
||||
fileName = fileName.replace('.json', '')
|
||||
if (UI.projects.foundations.utilities.children.isMissingChildrenByName(node, fileName) === true) {
|
||||
let child = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, 'Plugin File')
|
||||
child.name = fileName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginProjects(node, rootNodes) {
|
||||
for (let k = 0; k < PROJECTS_SCHEMA.length; k++) {
|
||||
let projectDefinition = PROJECTS_SCHEMA[k]
|
||||
@@ -68,27 +43,8 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
function getProjectName(node) {
|
||||
/* Validations to see if we can do this or not. */
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload.uiObject === undefined) { return }
|
||||
|
||||
if (node.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('You need to have a Plugin Project node as a parent to execute this action.')
|
||||
return
|
||||
}
|
||||
if (node.payload.parentNode.payload === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('You need to have a Plugin Project node as a parent to execute this action.')
|
||||
return
|
||||
}
|
||||
let pluginProject = node.payload.parentNode
|
||||
let config = JSON.parse(pluginProject.config)
|
||||
|
||||
return config.codeName
|
||||
}
|
||||
|
||||
function addMissingPluginDataMines(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -96,15 +52,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Data-Mines', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Data-Mines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginTradingMines(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -112,15 +68,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Trading-Mines', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Mines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginTradingSystems(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -128,15 +84,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Trading-Systems', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Systems', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginTradingEngines(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -144,15 +100,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Trading-Engines', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Trading-Engines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginLearningMines(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -160,15 +116,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Learning-Mines', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Mines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginLearningSystems(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -176,15 +132,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Learning-Systems', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Systems', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginLearningEngines(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -192,15 +148,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Learning-Engines', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Learning-Engines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginTutorials(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -208,15 +164,15 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Tutorials', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Tutorials', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginApiMaps(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -224,10 +180,10 @@ function newFoundationsFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'API-Maps', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'API-Maps', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
function newFoundationsUtilitiesPlugins() {
|
||||
let thisObject = {
|
||||
getPluginFileNames: getPluginFileNames,
|
||||
addPluginFileIfNeeded: addPluginFileIfNeeded,
|
||||
getProjectName: getProjectName
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function getPluginFileNames(projectName, pluginType, callBack) {
|
||||
httpRequest(undefined, 'PluginFileNames/' + projectName + '/' + pluginType, onResponse)
|
||||
|
||||
function onResponse(err, data) {
|
||||
if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
console.log('Failed to Fetch Plugin ' + pluginType + ' from the Client')
|
||||
return
|
||||
}
|
||||
|
||||
let pluginFileNames = JSON.parse(data)
|
||||
callBack(pluginFileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addPluginFileIfNeeded(node, fileNames) {
|
||||
for (let i = 0; i < fileNames.length; i++) {
|
||||
let fileName = fileNames[i]
|
||||
fileName = fileName.replace('.json', '')
|
||||
if (UI.projects.foundations.utilities.children.isMissingChildrenByName(node, fileName) === true) {
|
||||
let child = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, 'Plugin File')
|
||||
child.name = fileName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getProjectName(node) {
|
||||
/* Validations to see if we can do this or not. */
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload.uiObject === undefined) { return }
|
||||
|
||||
if (node.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('You need to have a Plugin Project node as a parent to execute this action.')
|
||||
return
|
||||
}
|
||||
if (node.payload.parentNode.payload === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('You need to have a Plugin Project node as a parent to execute this action.')
|
||||
return
|
||||
}
|
||||
let pluginProject = node.payload.parentNode
|
||||
let config = JSON.parse(pluginProject.config)
|
||||
|
||||
return config.codeName
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"type": "Plugin Assets",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Add Missing Plugin Assets",
|
||||
"label": "Add Missing Assets",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "Data Mine",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
"level": 1,
|
||||
"propertyNameAtParent": "pluginAssets",
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Plugin Project->"
|
||||
},
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
"name": "pluginFiles",
|
||||
"type": "array",
|
||||
"childType": "Plugin File",
|
||||
"autoAdd": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"type": "Plugin Features",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Add Missing Plugin Features",
|
||||
"label": "Add Missing Features",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "Data Mine",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
"level": 1,
|
||||
"propertyNameAtParent": "pluginFeatures",
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Plugin Project->"
|
||||
},
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
"name": "pluginFiles",
|
||||
"type": "array",
|
||||
"childType": "Plugin File",
|
||||
"autoAdd": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"type": "Plugin Pools",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Add Missing Plugin Pools",
|
||||
"label": "Add Missing Pools",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "Data Mine",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
"level": 1,
|
||||
"propertyNameAtParent": "pluginPools",
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Plugin Project->"
|
||||
},
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
"name": "pluginFiles",
|
||||
"type": "array",
|
||||
"childType": "Plugin File",
|
||||
"autoAdd": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"type": "Plugin Positions",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Add Missing Plugin Positions",
|
||||
"label": "Add Missing Positions",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
"relatedUiObject": "Data Mine",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
"level": 1,
|
||||
"propertyNameAtParent": "pluginPositions",
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Plugin Project->"
|
||||
},
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
"name": "pluginFiles",
|
||||
"type": "array",
|
||||
"childType": "Plugin File",
|
||||
"autoAdd": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"type": "Plugin Data Mines",
|
||||
"type": "Plugin User Profiles",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Add Missing Plugin Data Mines",
|
||||
"label": "Add Missing Data Mines",
|
||||
"action": "Add Missing Plugin User Profiles",
|
||||
"label": "Add Missing User Profiles",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Proceed",
|
||||
"workDoneLabel": "Done",
|
||||
@@ -22,7 +22,7 @@
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
"level": 1,
|
||||
"propertyNameAtParent": "pluginDataMines",
|
||||
"propertyNameAtParent": "pluginUserProfiles",
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Plugin Project->"
|
||||
},
|
||||
|
||||
@@ -24,6 +24,31 @@ function newGovernanceActionSwitch() {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 'Add Missing Plugin User Profiles':
|
||||
{
|
||||
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginUserProfiles(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Pools':
|
||||
{
|
||||
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginPools(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Features':
|
||||
{
|
||||
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginFeatures(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Assets':
|
||||
{
|
||||
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginAssets(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Plugin Positions':
|
||||
{
|
||||
UI.projects.foundations.functionLibraries.pluginsFunctions.addMissingPluginPositions(action.node, action.rootNodes)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,63 +1,15 @@
|
||||
function newGovernanceFunctionLibraryPluginsFunctions() {
|
||||
let thisObject = {
|
||||
addMissingPluginDataMines: addMissingPluginDataMines,
|
||||
addMissingPluginTradingMines: addMissingPluginTradingMines,
|
||||
addMissingPluginTradingSystems: addMissingPluginTradingSystems,
|
||||
addMissingPluginTradingEngines: addMissingPluginTradingEngines,
|
||||
addMissingPluginLearningMines: addMissingPluginLearningMines,
|
||||
addMissingPluginLearningSystems: addMissingPluginLearningSystems,
|
||||
addMissingPluginLearningEngines: addMissingPluginLearningEngines,
|
||||
addMissingPluginTutorials: addMissingPluginTutorials,
|
||||
addMissingPluginApiMaps: addMissingPluginApiMaps
|
||||
addMissingPluginUserProfiles: addMissingPluginUserProfiles,
|
||||
addMissingPluginPools: addMissingPluginPools,
|
||||
addMissingPluginAssets: addMissingPluginAssets,
|
||||
addMissingPluginFeatures: addMissingPluginFeatures,
|
||||
addMissingPluginPositions: addMissingPluginPositionss
|
||||
}
|
||||
return thisObject
|
||||
|
||||
function getPluginFileNames(projectName, pluginType, callBack) {
|
||||
httpRequest(undefined, 'PluginFileNames/' + projectName + '/' + pluginType, onResponse)
|
||||
|
||||
function onResponse(err, data) {
|
||||
if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
console.log('Failed to Fetch Plugin ' + pluginType + ' from the Client')
|
||||
return
|
||||
}
|
||||
|
||||
let pluginFileNames = JSON.parse(data)
|
||||
callBack(pluginFileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addPluginFileIfNeeded(node, fileNames) {
|
||||
for (let i = 0; i < fileNames.length; i++) {
|
||||
let fileName = fileNames[i]
|
||||
fileName = fileName.replace('.json', '')
|
||||
if (UI.projects.foundations.utilities.children.isMissingChildrenByName(node, fileName) === true) {
|
||||
let child = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(node, 'Plugin File')
|
||||
child.name = fileName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getProjectName(node) {
|
||||
/* Validations to see if we can do this or not. */
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload.uiObject === undefined) { return }
|
||||
|
||||
if (node.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('You need to have a Plugin Project node as a parent to execute this action.')
|
||||
return
|
||||
}
|
||||
if (node.payload.parentNode.payload === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('You need to have a Plugin Project node as a parent to execute this action.')
|
||||
return
|
||||
}
|
||||
let pluginProject = node.payload.parentNode
|
||||
let config = JSON.parse(pluginProject.config)
|
||||
|
||||
return config.codeName
|
||||
}
|
||||
|
||||
function addMissingPluginDataMines(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
function addMissingPluginUserProfiles(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -65,15 +17,15 @@ function newGovernanceFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Data-Mines', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'User-Profiles', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginTradingMines(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
function addMissingPluginPools(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -81,15 +33,15 @@ function newGovernanceFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Trading-Mines', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Pools', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginTradingSystems(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
function addMissingPluginAssets(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -97,15 +49,15 @@ function newGovernanceFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Trading-Systems', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Assets', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginTradingEngines(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
function addMissingPluginFeatures(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -113,15 +65,15 @@ function newGovernanceFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Trading-Engines', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Features', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginLearningMines(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
function addMissingPluginPositionss(node, rootNodes) {
|
||||
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
@@ -129,74 +81,10 @@ function newGovernanceFunctionLibraryPluginsFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Learning-Mines', onNamesArrived)
|
||||
UI.projects.foundations.utilities.plugins.getPluginFileNames(projectName, 'Positions', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginLearningSystems(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Learning-Systems', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginLearningEngines(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Learning-Engines', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginTutorials(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'Tutorials', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingPluginApiMaps(node, rootNodes) {
|
||||
let projectName = getProjectName(node)
|
||||
if (projectName === "" || projectName === undefined) {
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
getPluginFileNames(projectName, 'API-Maps', onNamesArrived)
|
||||
|
||||
function onNamesArrived(fileNames) {
|
||||
addPluginFileIfNeeded(node, fileNames)
|
||||
UI.projects.foundations.utilities.plugins.addPluginFileIfNeeded(node, fileNames)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -212,6 +212,11 @@
|
||||
"name": "Status Bar",
|
||||
"propertyName": "statusBar",
|
||||
"functionName": "newFoundationsUtilitiesStatusBar"
|
||||
},
|
||||
{
|
||||
"name": "Plugins",
|
||||
"propertyName": "plugins",
|
||||
"functionName": "newFoundationsUtilitiesPlugins"
|
||||
}
|
||||
],
|
||||
"spaces": [
|
||||
|
||||
Reference in new issue
Block a user