Walks you through the process of creating an
Enterprise Developer project for the CarsProgram demonstration application, and populating the project with demonstration files.
Create the ProgramRESTAPI project
- In Eclipse, click
File > New > COBOL Project.
- In the
Project name field, type
ProgramRESTAPI.
- Check
Use default location; then click
Finish.
The
Application Explorer view now shows the
ProgramRESTAPI project under the
Enterprise Developer > Enterprise Development Projects node.
Set build configuration properties ProgramRESTAPI
Before Eclipse builds this project, you want to set several configuration options to ensure that all required files are generated,
are in the correct output format, and are located in specific folders.
- Add additional directives
- First, you need to add some additional compiler directives that generate an XML mapping file and required Web service files.
- In the
Application Explorer view, right-click the
ProgramRESTAPI project, and then select
Properties from the context menu.
- Expand
Micro Focus > Build Configurations, and then click
COBOL.
- In the right pane, check
Enable configuration specific settings.
- Click in the
Additional directives field, and then click the browse button
.
- On the Additional directives dialog box, type:
xmlgen(loadlib) xmlgen(ws)
Note: loadlib is the name of your output path, which you set in the next section.
- Click
OK to close the dialog box, and then click
Apply.
- Set output options
- Next, you need to set your output path and target type.
- In the left pane, click
Link.
- In the right pane, replace the
New Configuration.bin value in the
Output Path with
loadlib, and then press
Enter.
- In the the
Target Type drop-down list, select
All Native Library Files.
- Click
Apply and Close to save your configuration changes.
This action automatically creates the
loadlib subdirectory in your project.
Add CarsProgram demonstration files to the project
- Import COBOL source
-
- From the
Application Explorer view, right-click the
ProgramRESTAPI project and select
Import from the context menu.
This opens the
Import dialog box.
- Expand
General and click File System.
- Click
Next.
- Click the
Browse button that corresponds to the
From directory field, and browse to the
$COBDIR/demo/imtk/CarsProgram directory.
- Click
Open.
- On the list of files, check just the
CarsProgram.cbl and the
cars.cpy files.
- Click
Finish.
This adds the source files to the project, builds the project automatically, and places the output files into the
loadlib output directory.
- Import
cars.xml
- Now you can import the
cars.xml data file directly into the new
loadlib output directory:
- In the
Application Explorer view, expand the
loadlib node.
Here you can see the output files generated by the build, including
CarsProgram.xml file that maps COBOL data fields to XML.
- Right-click the
loadlib node, and then select
Import > Import from the context menu.
- Expand
General and click File System.
- Click
Next.
- Click the
Browse button that corresponds to the
From directory field, and browse to the
$COBDIR/demo/imtk/CarsProgram directory.
- Click
Open.
- On the list of files, check just the
cars.xml file.
Because you accessed the
Import wizard from the
loadlib node in your project, the
Into folder field is populated with the path to your output directory.
- Click
Finish.