Mariam History set up
This commit is contained in:
1 parent
59662fe76a
commit
dbe04b9dea
7 files changed
+91
-16
No files matched your search
@@ -0,0 +1,63 @@
|
||||
|
||||
function newFile() {
|
||||
|
||||
let fileObject = {
|
||||
getFile: getFile,
|
||||
initialize: initialize
|
||||
}
|
||||
|
||||
let fileCloud;
|
||||
let file;
|
||||
|
||||
return fileObject;
|
||||
|
||||
function initialize(pTeamCodeName, pBotCodeName, pProductCodeName, pLayerCodeName, pExchange, pMarket, callBackFunction) {
|
||||
|
||||
let product = ecosystem.getProduct(ecosystem.getBot(ecosystem.getTeam(pTeamCodeName), pBotCodeName), pProductCodeName);
|
||||
|
||||
if (product === undefined) {
|
||||
|
||||
throw "Product not found at this bot of the ecosystem! - pTeamCodeName = " + pTeamCodeName + ", pBotCodeName = " + pBotCodeName + ", pProductCodeName = " + pProductCodeName;
|
||||
|
||||
}
|
||||
|
||||
let exchange = ecosystem.getExchange(product, pExchange);
|
||||
|
||||
if (exchange === undefined) {
|
||||
|
||||
throw "Exchange not supoorted by this product of the ecosystem! - pTeamCodeName = " + pTeamCodeName + ", pBotCodeName = " + pBotCodeName + ", pProductCodeName = " + pProductCodeName + ", pExchange = " + pExchange;
|
||||
|
||||
}
|
||||
|
||||
let layer = ecosystem.getLayer(product, pLayerCodeName);
|
||||
|
||||
if (layer === undefined) {
|
||||
|
||||
throw "Layer not found at this product of the ecosystem! - pTeamCodeName = " + pTeamCodeName + ", pBotCodeName = " + pBotCodeName + ", pProductCodeName = " + pProductCodeName + ", pLayerCodeName = " + pLayerCodeName;
|
||||
|
||||
}
|
||||
|
||||
fileCloud = newFileCloud();
|
||||
fileCloud.initialize(pTeamCodeName, pBotCodeName);
|
||||
|
||||
/* Now we will get the file */
|
||||
|
||||
fileCloud.getFile(product, exchange, pMarket, undefined, undefined, onFileReceived);
|
||||
|
||||
function onFileReceived(pFile) {
|
||||
|
||||
file = pFile;
|
||||
|
||||
callBackFunction();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getFile() {
|
||||
|
||||
return file;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user