Generating Source Code
To generate the source code for the component defined, use the generate command as follows:
-
Windows
-
Browse to %TEMPLATE_ENGINE%
-
Run templates-console.bat; a command prompt opens in directory pointed to %TEMPLATE_ENGINE%.
-
Run the following command specifying the destination directory:
Usage
generate.bat -dest c:\development\CustomServices
Figure 1: Run templates-console.bat Run
generate.batwithout any arguments to see the help.
-
-
Linux
-
Browse to %TEMPLATE_ENGINE% in Linux console
-
Run the following command specifying the destination directory:
Usage
generate.sh -dest c:\development\CustomServicesusage
run [-language <name>] [-setting <name>] -dest <directory>-
-dest <directory> target directory where source files are Generated (same directory given while launching wizard)
-
-language <name>language (c, cpp, csharp, java, jca) in which source files are generated (default is java)
-
-setting <name> name of setting directory in etc folder
-
Run
generate.shwithout any arguments to see the help-
Executing
generate.shcommand generates the sources under src directory specified in the directory specified against –dest argument. It also creates necessary files to build and deploy the components. Below are the common files that are created irrespective of language:
-
-
build.properties
-
build.xml
-
common.xml
-
-
-
-
Refer the Characteristics and Design Choices section for an overview of Synchronous and Asynchronous components. This section enables decision making of the best suited design.
Code for Asynchronous (EDBC) Component
To generate code for asynchronous component, use generate command. Though, by default, it assumes that the code is generated for the asynchronous component, to specify particularly that the code generated should be for asynchronous component, use –language option with value java
Example
generate.bat -dest C:\development\CustomServices\EDBC\SampleEDBC -language java
The generated component code has the structure as shown in figure below; it shows the description/purpose of each file generated.
Code for Synchronous (BC) Component
To generate code for synchronous component, use generate command specifying the language using –language option followed by the value representing the language as shown in the below example.
Example
generate.bat -dest C:\development\CustomServices\EDBC\SampleEDBC -language jca
The generated component code has the structure as shown in figure below.
Code for C Component
To generate code for C component, use generate command specifying the language using -language option followed by the value representing the language, that is, 'c'.
Example
generate.bat/sh -dest C:\development\CustomServices\C\SampleC -language c
Figure below shows the structure of the code generated for an asynchronous component defined in C.
Code for C++ component
To generate code for C++ component, use generate command specifying the language using -language option followed by the value representing the language, that is, 'cpp'.
Example
generate.bat/sh -dest C:\development\CustomServices\cpp\SampleCpp -language cpp
Figure below shows the structure of the code generated for an asynchronous component defined in C++.
Code for C# Component
To generate code for C# component, use generate command specifying the language using -language option followed by the value representing the language, that is, 'csharp'.
Example
generate.bat/sh -dest C:\development\CustomServices\CSharp\CSSample -language csharp