Elastic COBOL
CloudBees now supports Elastic COBOL by Heirloom Computing.
This write up shows how you can deploy an Elastic COBOL application to the CloudBees cloud platform.
1.0 Setting Up The Environment
1.1 Account Registration
You will need to sign up for an account for CloudBees and sign up for an account for Elastic COBOL.
Once you have completed the registration process, sign in to the Elastic COBOL portal and subscribe to the desktop monthly service.
Elastic COBOL is available on Windows, Linux & Mac OS X and can be used for free for 14 days. You can cancel any time before then without incurring any costs. If you need longer, please contact us at info@heirloomcomputing.com
1.2 Product Installation
First, download and install Elastic COBOL to your platform of choice. Instructions for this can be found in the Getting Started Guide.
Next, install the Eclipse plugin for CloudBees. Instructions for this can be found in the How-to Guide.
Open the Elastic COBOL perspective (Window > Open Perspective > Other > Elastic COBOL) and the CloudBees perspective (Window > Open Perspective > Other > CloudBees).
2.0 Using Elastic COBOL with CloudBees
2.1 Create A COBOL Project
- Select the Elastic COBOL perspective.
- File > New > COBOL Project
- Enter "register" in the "Project name:" text box. On the "Project type" tab select "Samples > Servlet Register" and click "Finish".
- In the "Navigator" pane, expand "register > resources" and double-click on "register.html" to open an edit window for it.
- Change ACTION="/register/register" to ACTION="/register" and click the "Save" icon on the toolbar. It should look like this when done:
2.2 Create A CloudBees Project
- Select the CloudBees perspective.
- Click the "CloudBees" icon on the toolbar and select "Configure". Enter your account credentials, deselect all options for "DEV@cloud" and "All Jenkins", and click "OK".
- Click the "CloudBees" icon on the toolbar and select "New CloudBees Project".
- Enter "COBOLBees" in the "Project name:" text box, click "Next", and click "Finish".
2.3 Configure The CloudBees Project
We are going to use the CloudBees project as a template (or vehicle) to deploy the existing Elastic COBOL application. To do so, certain runtime packages and files need to be placed in the CloudBees project.
- In the "Package Explorer" pane, right-click on "COBOLBees" and select "Properties".
- Select "Java Compiler" and make sure that the "Compiler compliance level:" is set to "1.6" -- if not, then check "Enable project specific settings", select "1.6", click "OK", click "Yes".
- In the "Package Explorer" pane, right-click on "COBOLBees" and select "Properties".
- Select "Java Build Path" and the "Libraries" tab.
- Click "Add External JARs", locate & select "ecobol.jar" (the Elastic COBOL runtime services package). This will be in the location where you installed Elastic COBOL. For example: C:\ecobol\plugins\com.heirloomcomputing.ecd.core_12.12.17\elastic_cobol
- Click "OK".
- In the "Package Explorer" pane, expand "COBOLBees > webapp > WEB-INF > lib".
- Right-click on "lib", and select "Import".
- Select "General > File System", click "Next", click "Browse", navigate to the same location as above, select "elastic_cobol" and click "OK".
- In the "Import" dialog, select "ecobol.jar" and click "Finish".
- In the "Package Explorer" pane, right-click on "webapp", and select "Import".
- Select "General > File System", click "Next", click "Browse", navigate to your HOME directory (e.g. C:\user\name), select your HOME directory and click "OK".
- In the import dialog, select "elasticcobol.properties" and click "Finish". The "Package Explorer" pane should now look like this:
2.4 Add The Elastic COBOL Application
- In the "Package Explorer" pane, expand "register > intermediate_java_code > (default package)". This location is where the Elastic COBOL compiler produces the intermediate Java representation of the application.
- Right-click on "register.java" and select "Copy". This is the COBOL servlet to process information from the web form.
- In the "Package Explorer" pane, expand "COBOLBees > src > example".
- Right-click on "example" and select "Paste".
- Expand "register > resources", right-click on "register.html" and select "Copy". This is the web form that passes the data to the COBOL servlet.
- Right-click on "webapp" and select "Paste". The "COBOLBees" project should now look like this in the "Package Explorer":
2.5 Configure The Deployment Descriptor
- In the "Package Explorer" pane, double-click on "web.xml" to open it in the editor.
- In the editor window for "web.xml", expand "servlet", click on "Hello Servlet" (in the Content column), and enter "register".
- Click on "example.HelloServlet (again in the Content column), and enter "com.heirloomcomputing.ecs.run.servlet".
- Right-click on "servlet" (in the Node column) > Add Child > init-param.
- Expand "init-param", click on "token" (in the Content column), and enter "servlet".
- Click on "param-value" (again in the Content column), and enter "example.register".
- Expand "servlet-mapping", click on "HelloServlet" (in the Content column), and enter "register".
- Click on "url-pattern" (again in the Content column), and enter "/register".
- Click the "Save" icon on the toolbar. The editor window for "web.xml" should now look like this:
3.0 Deploying The Application
3.1 Locally
- In the "Package Explorer" pane, right-click on "CloudBees", select "CloudBees > Run Local".
3.2 On The Cloud
- In the "Package Explorer" pane, right-click on "CloudBees", select "CloudBees > Deploy to RUN@cloud".
4.0 Running The Application
4.1 Locally
- In a browser tab, enter "http://localhost:8335/register.html".
- Fill out some data and click "Register Software" at the bottom of the form.
4.2 On The Cloud
- In a browser tab, enter "http://cobolbees.YOURDOMAIN.cloudbees.net/register.html" (replacing YOURDOMAIN with the name of your CloudBees domain).
- Fill out some data and click "Register Software" at the bottom of the form.
4.3 Example Output
If the application was configured and deployed correctly, then after you have clicked "Register Software", the Elastic COBOL application servlet is invoked and it will report back to you on the input it received. If you enter no data whatsoever, the response from the COBOL servlet will look like this:
5.0 Support
Please visit https://heirloomcomputing.zendesk.com/
0 Comments