The build descriptor option genProject places
the output of Java™ generation into a Workbench project and automates
tasks that are required for Java runtime setup. For details on that
setup and on the benefits of using genProject, see Generation
of Java code
into a project.
To use
genProject, specify the project name.
EGL then ignores the build descriptor options
buildPlan,
genDirectory,
and
prep, and preparation occurs in either of two
cases:
- Whenever you rebuild the project
- Whenever you generate the source files; but only if you checked the workbench
preference Perform build automatically on resource modification
If you set the option
genProject to the name
of a project that does not exist in the workbench, EGL uses the name to create
a Java project,
except in these cases:
- If you are generating a PageHandler and specify a project different from
the one that contains the related JSP and if that other project does not exist,
EGL creates an EGL Web project. (However, it is recommended that you generate
the PageHandler into the project that contains the related JSP.)
- A second exception concerns EJB processing and occurs if you are generating
a Java wrapper
when the linkage options part, callLink element, type property
is ejbCall (for the call from the wrapper to the EGL-generated program). In
that case, EGL uses the value of genProject to create
an EJB project and creates a new enterprise application project (if necessary)
with a name that is the same as the EJB project name plus the letters EAR.
In addition to creating a project, EGL does as follows:
- EGL creates folders in the project. The package structure begins under
the top-level JavaSource folder, which is within the project's Java Resources
folder. You may change the name JavaSource by right-clicking on the folder
name and selecting Refactor.
- If a JRE definition is specified in the preferences page for Java (installed
JREs), EGL adds the classpath variable JRE_LIB. That variable contains the
path to the runtime JAR files for the JRE currently in use.
When you are generating in the Workbench or from the Workbench batch interface,
the following rules apply:
- For Java generation
- If you are generating Java code for iSeries™, you are required to specify genProject.
Otherwise, you are not required to specify either genProject or genDirectory.
If neither is specified, Java output is generated into the project
that contains the EGL source file being generated.
If you are generating
a PageHandler, and the project specified exists, then the project must be
an EGL Web project. If you are generating a session EJB, and the project
specified exists, then the project must be an EJB project.
- For COBOL generation
- You must specify genDirectory, and in most cases
EGL ignores any setting for genProject. If the COBOL
program of type VGWebTransaction presents a Web page, however, these statements
apply:
- You may specify genProject, which indicates
a location for the associated Java-based objects that run in the Web application
server
- If you do not specify genProject, all output
is placed in the location identified in genDirectory
If you are generating from the EGL SDK, the following rules apply:
- You must specify genDirectory
- An error results if you specify genProject
- You cannot generate Java code for iSeries