How to deploy a customized server runnable app
Table of Contents
Create a new server runnable app
1.Under Extool tab click “Customize App”
2.Click “Add New App”
3.Enter all the app information
4.Verify the app is created
Setup the worker
1.Download the file
2.Install JRE
3.Install UnlimitedJCEPolicy for the JRE
4.Configure the worker
Run the app
Deploy a real app
1.Create a knowledgebase file
2.Create the app
3.Create the worker
4.Run the app
Create a newserver runnable app
First you need create the app in our excel client
1.Under Extool tab click “Customize App”
2.Click “Add New App”
3.Enter all the app information
4.Verify the app is created
If you try to run the app an error message will show telling No worker is running for this app, so the next step is to create a worker for it.
Setup the worker
1.Download the file
2.Install JRE
3.Install UnlimitedJCEPolicy for the JRE
Worker.zip contains the files for jre8 “jce_policy-8.zip” you can unzip it and extract the US_export_policy.jar and local_policy.jar to path-to-jre\lib\security
4.Configure the worker
Unzip the worker.zip and you will have the following files and folder
Config.data contains credentials for connecting to our api server and is encrypted. You should not change the data inside.
Config.properties is for worker configuration such as max runtime for an app and apps storing folder
Worker.jar is the main code
Run.bat is the start script
Apps folder contains all the apps supported by this worker in this example only one app (test1) will be hosted here.
Under folder “apps” create a new folder called test1.
Create two files: info.txt and hello.bat under test1.
Info.txt, change the contentas follows
name=test1
hello.bat,change the content as follows
echo hello
Run the app
Double click the run.bat and the worker will be running and ready to get commands from api server
Back to excel and run the test1.
Verify the task output is what you have put in hello.bat
Deploy a real app(webpage)
This app will plot a pie chart based on the data from excel sheet.
here is the original code which read data from js file. We will make it work with data in excel sheet.
1.Create a knowledgebase file
First a knowledgebase is needed to tell end user how to use the app. Create a new excel file and added the following content
Input parameters will have a rawdata field and points to the range of actual data
2.Create the app
Create the app in Extool->Customize App->Add New App
After click upload the app will be created
3.Create the worker
Under apps folder create a folder piechart and create the following files
Info.txt, change the content as follows
name=pie_chart_plot
dummy.bat,change the content as follows (as the data will be processed by js in html page this bat will actually do nothing only act as a place holder)
rem
display.html, the original code is list below which will plot the static data within the file.
<head>
<script src="
<script src="
</head>
<body>
<div id="myDiv" style="width: 480px; height: 380px;"<!-- Plotly chart will be drawn inside this DIV --</div>
<script>
var data = [{
values: [19, 26, 55],
labels: ['Residential', 'Non-Residential', 'Utility'],
type: 'pie'
}];
var layout = {
height: 380,
width: 480
};
Plotly.newPlot('myDiv', data, layout);
</script>
</body>
Modify the file to make it read data from input parameters.
<head>
<script src="
<script src="
<script src="
</head>
<body>
<div id="myDiv" style="width: 480px; height: 380px;"<!-- Plotly chart will be drawn inside this DIV --</div>
<script>
<#include "/template/report/inputs.ftl">
Papa.parse(inputmap["rawdata"], {
download: true,
header: true,
skipEmptyLines: true,
complete: function(results) {
var data = [{
values: [],
labels: [],
type: 'pie'
}];
var rawdata = results.data;
for(var i = 0; i < rawdata.length; i++){
data[0].labels.push(rawdata[i]['Name']);
data[0].values.push(rawdata[i]['Value']);
}
var layout = {
height: 380,
width: 480
};
Plotly.newPlot('myDiv', data, layout);
}
});
</script>
</body>
<#include "/template/report/inputs.ftl"> is the internal script which will put all the input parameters into a js variable called inputmap.
The inputmap[‘rawdata’] was packed as a cvs file and stored in s3 server so we need a cvs parser to get the content.
Now run the run.bat to start the worker.
4.Test the app
Search pie_chart_plot in extool sidebar and get knowledge base. Change the data to a =10, b=20, c=30 as the following images shown.
A few seconds later a webpage will be popped up and you shall see the chart