Generating Code

Generating Code

Applications developed using Nexacro Platform are based on HTML5. The applications are divided into two types by operating environments: Runtime and HTML5. The Runtime version runs applications on Nexacro Platform Runner, and the HTML5 version runs applications on a web browser.

When you run Nexacro Platform applications on Nexacro Studio, you will go through a process to generate code. This process is automatically started when executing QuickView or creating archive files. You can explicitly work on any forms or any projects using the Build menu.

Internally, nexacrogenerator.exe converts files such as *.xadl and *.xfdl to JavaScript files.

In the distribution and operation stages that follow development and a series of tests, files sent to users need to be minimized and, in some cases, be obfuscated. Those functions can be performed through the options provided by nexacrocompressor.exe.

The generated script files are stored on the client. If necessary, the files can be moved to another location to be executed on the web server. If the web server is running on the client, you can designate the local web server path on Nexacro Studio to access generated files.

The following table lists the (target) files and resulting converted (code-generated) files in this process

컴파일 전 후 파일명

Target File

Generated File

Description


index.html

Basic HTML file to execute applications


QuickView.html

HTML file to run QuickView

*.xadl

*.xadl.js

ADL file

*.xadl.quickview.js

ADL file to run QuickView

/Service/*.xfdl

/Service/*.xfdl.js

FDL(screen) file

default.xtheme

_theme_/default/theme.css

_theme_/default/theme.css.js

_theme_/default/images

Theme and image file folder

/nexacro14lib

/nexacro14lib

Merged if the relevant option is checked

nexacrogenerator.exe

nexacrogenerator.exe can be directly used in a console with the options described in the following table.

Options

nexacrogenerator.exe -A -O [args...]
XHTML5Compiler.exe의 옵션

Option

Description

-A <Target ADL Path>

Specifiy the targeted ADL path of Application to generate.

This option must be entered.

-O <Output Path>

Specify the output path where generated files are stored.

Automatically generate a route if the specified path does not exist.

This option must be entered.

-P <Project Name>

Specify the name of a project where generated files are saved.

The project name will be added to the output directory to serve as a path for saving files.

If a project name is not entered, the XADL file name entered in the target ADL path is used automatically.

-B <library Path>

Specify the path to the library files needed to generate files.

If the path is not entered, the default library files in the path where "nexacro.exe" is installed are used.

-M

Apply the Merge option when conducting generation process.

-AO

Only used to generate XADL files

Can be changed to the application(ADL) path of the nexacro executable files

Note : Can not be used in combination with -S, -F, -T.

-MO

Used to generate only module files.

Merging can be conducted depending on the setting of the –M option.

Note : Can not be used in combination with -AO, -S, -F, -T.

-S <Service ID>

Specify the Service Prefix ID to generate.

Can specify only Service Prefix IDs defined in TypeDefinition

Note : Can not be used in combination with -AO, -F, -T.

-F <path1>,[<path2>,…]

Specify a list of paths of files to generate.

Separated by a comma or semicolon when multiple inputs exist

Note : Can not be used in combination with -AO, -S, -T.

-T <themeid1>,[<themeid2>,…]

Specify the Theme ID to generate.

Separated by a comma or semicolon when multiple inputs exist

Note : Can not be used in combination with -AO, -S, -F.

-TABORDER

Generate components according to their tab order.

In not designated, components will be generated according to Z-order.

-L <Path>

Specify the log file path to save the generator process.

Automatically generate a route if the specified path does not exist.

Creating a log file may increase generator processing time.

-H

Provide the help for "nexacrogenerator.exe".

The -H option supports Korean, English, and Japanese depending on user system settings.

Examples

Generating Entire Application

Generate an application based on C:\TestGenerate\TestGenerate.xadl file and output the result to E:\ResultGenerate.
Also generate executable files, theme files and module files required to run the application.
nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate"
E:\ResultGenerate\TestGenerate\index.html
E:\ResultGenerate\TestGenerate\QuickView.html
E:\ResultGenerate\TestGenerate\popup.html
E:\ResultGenerate\TestGenerate\start.json
E:\ResultGenerate\TestGenerate\TestGenerate.xadl.js
E:\ResultGenerate\TestGenerate\TestGenerate.xadl.quickview.js
E:\ResultGenerate\TestGenerate\_theme\…
E:\ResultGenerate\TestGenerate\Base\…
…
E:\ResultGenerate\TestGenerate\nexacro14lib\framework\Platform.js
E:\ResultGenerate\TestGenerate\nexacro14lib\framework\Systembase.js
…
E:\ResultGenerate\TestGenerate\nexacro14lib\component\ComComp\Button.js
E:\ResultGenerate\TestGenerate\nexacro14lib\component\ComComp\Combo.js
…

If you add "-M" option, the generator does not create module files for each component or another object. Instead, it creates compressed module files for each group.

nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -M
E:\ResultGenerate\TestGenerate\index.html
E:\ResultGenerate\TestGenerate\QuickView.html
E:\ResultGenerate\TestGenerate\popup.html
E:\ResultGenerate\TestGenerate\start.json
E:\ResultGenerate\TestGenerate\TestGenerate.xadl.js
E:\ResultGenerate\TestGenerate\TestGenerate.xadl.quickview.js
E:\ResultGenerate\TestGenerate\_theme\…
E:\ResultGenerate\TestGenerate\Base\…
…
E:\ResultGenerate\TestGenerate\nexacro14lib\framework\Framework.js
E:\ResultGenerate\TestGenerate\nexacro14lib\component\ComCom.js
E:\ResultGenerate\TestGenerate\nexacro14lib\component\CompBase.js
…

Assigning Output Path User-specified Name Instead of XADL Name

Change the project path name to "TestGenerate2" and output the result to E:\ResultGenerate when generating an application based on C:\TestGenerate\TestGenerate.xadl file.
Also generate executable files and theme files required to run the application.
nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -P "TestGenerate2"
E:\ResultGenerate\TestGenerate2\index.html
E:\ResultGenerate\TestGenerate2\QuickView.html
E:\ResultGenerate\TestGenerate2\popup.html
E:\ResultGenerate\TestGenerate2\start.json
E:\ResultGenerate\TestGenerate2\TestGenerate.xadl.js
E:\ResultGenerate\TestGenerate2\TestGenerate.xadl.quickview.js
E:\ResultGenerate\TestGenerate2\_theme\…
E:\ResultGenerate\TestGenerate2\Base\…
…

Specifying Separate Library Path

Designate C:\nexacro14lib as a library path and output the result to E:\ResultGenerate when generating an application based on  C:\TestGenerate\TestGenerate.xadl file.
If a library path is not specified, the default library files in the path where "nexacro.exe" is installed are used .
nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -B "C:\nexacro14lib"
E:\ResultGenerate\TestGenerate\index.html
E:\ResultGenerate\TestGenerate\QuickView.html
E:\ResultGenerate\TestGenerate\popup.html
E:\ResultGenerate\TestGenerate\start.json
E:\ResultGenerate\TestGenerate\TestGenerate.xadl.js
E:\ResultGenerate\TestGenerate\TestGenerate.xadl.quickview.js
E:\ResultGenerate\TestGenerate\_theme\…
E:\ResultGenerate\TestGenerate\Base\…
…

Generating XADL File Independently

Generate only C:\TestGenerate\TestGenerate.xadl file and output the result to E:\ResultGenerate.
Also generate executable files required to run the application, but not theme files.
-T, -S, -F, -AO options cannot be used simultaneously.
nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -AO
E:\ResultGenerate\TestGenerate\index.html
E:\ResultGenerate\TestGenerate\QuickView.html
E:\ResultGenerate\TestGenerate\popup.html
E:\ResultGenerate\TestGenerate\start.json
E:\ResultGenerate\TestGenerate\TestGenerate.xadl.js
E:\ResultGenerate\TestGenerate\TestGenerate.xadl.quickview.js

Generating Specific Service Path

Generate a Service Prefix ID defined in TypeDefinition based on C:\TestGenerate\TestGenerate.xadl file and output the result to E:\ResultGenerate.
Only one service ID can be entered.
The input value for the -S option must agree with the relevant Service Prefix ID defined in TypeDefinition.
-T, -S, -F, -AO options cannot be used simultaneously.
nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -S "Base"
E:\ResultGenerate\TestGenerate\Base\…
E:\ResultGenerate\TestGenerate\Base\…
…

Generating Specific Files

Generate C:\TestGenerate\Base\form1.xfdl and C:\TestGenerate\Base\form2.xfdl files based on C:\TestGenerate\TestGenerate.xadl file and output the result to E:\ResultGenerate.
One or multiple files can be entered.
However, XADL and XTHEME files cannot be input values for the -F option.
-T, -S, -F, -AO options cannot be used simultaneously.
nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -F "C:\TestGenerate\Base\form1.xfdl", "C:\TestGenerate\Base\form2.xfdl"
E:\ResultGenerate\TestGenerate\Base\form1.xfdl.js
E:\ResultGenerate\TestGenerate\Base\form2.xfdl.js

Generating Specific Theme

case 1) Theme registered in the cache folder

Generate %USERAPP%\Cache\Theme\Gray.xtheme file based on C:\TestGenerate\TestGenerate.xadl file and output the result to E:\ResultGenerate
When generating a theme registered in the cache folder, enter just a theme name such as "Gray.xtheme."
(i.e. The generator recognizes the input as a theme registered in the cache folder when just a theme name is entered without specifying a relative path.)
nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -T "Gray.xtheme"
E:\ResultGenerate\TestGenerate\_theme_\Gray\theme.css.js
E:\ResultGenerate\TestGenerate\_theme_\Gray\images\...
…

case 2) Theme registered in a relative path or Prefix path, based on an XADL file

Generate C:\TestGenerate\Themes\NewTheme1.xtheme file based on C:\TestGenerate\TestGenerate.xadl file and output the result to E:\ResultGenerate.
Enter a relative path or Prefix path based on an XADL file in order to generate a theme in an user-specified path
nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -T "Themes\NewTheme1.xtheme"
E:\ResultGenerate\TestGenerate\_theme_\Themes\NewTheme1\theme.css.js
E:\ResultGenerate\TestGenerate\_theme_\Themes\NewTheme1\images\...
…

case 3) Combination of case 1 and case 2

Generate %USERAPP%\Cache\Theme\Gray.xtheme file and C:\TestGenerate\Themes\NewTheme1.xtheme file based on C:\TestGenerate\TestGenerate.xadl file and output the result to E:\ResultGenerate.

nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -T "Gray.xtheme,Themes\NewTheme1.xtheme"
E:\ResultGenerate\TestGenerate\_theme_\Gray\theme.css.js
E:\ResultGenerate\TestGenerate\_theme_\Gray\images\...
…
E:\ResultGenerate\TestGenerate\_theme_\Themes\NewTheme1\theme.css.js
E:\ResultGenerate\TestGenerate\_theme_\Themes\NewTheme1\images\...
…

Generating Module Files

case 1) Merge option not applied

Generate the module files in the nexacro14lib folder based on the C:\TestGenerate\TestGenerate.xadl file.
nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -MO
E:\ResultGenerate\TestGenerate\nexacro14lib\framework\Platform.js
E:\ResultGenerate\TestGenerate\nexacro14lib\framework\Systembase.js
…
E:\ResultGenerate\TestGenerate\nexacro14lib\component\ComComp\Button.js
E:\ResultGenerate\TestGenerate\nexacro14lib\component\ComComp\Combo.js
…

case 2) Generate module files in the specified path

Generate module files based on the path specified by the -B option.
nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -MO  -B "C:\nexacro14lib"
E:\ResultGenerate\TestGenerate\nexacro14lib\framework\Platform.js
E:\ResultGenerate\TestGenerate\nexacro14lib\framework\Systembase.js
…
E:\ResultGenerate\TestGenerate\nexacro14lib\component\ComComp\Button.js
E:\ResultGenerate\TestGenerate\nexacro14lib\component\ComComp\Combo.js
…

case 3) Merge option applied

Generate the module files in the nexacro14lib folder and compress them into several files based on the C:\TestGenerate\TestGenerate.xadl file.
nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -MO -M
E:\ResultGenerate\TestGenerate\nexacro14lib\framework\Framework.js
E:\ResultGenerate\TestGenerate\nexacro14lib\component\ComCom.js
E:\ResultGenerate\TestGenerate\nexacro14lib\component\CompBase.js
…

Generate XFDL Files after Rearranging Components according to Tab Order

Generate the application based on the C:\TestGenerate\TestGenerate.xadl file and put out resulting files to the E:\ResultGenerate path.
Rearrange the components according to tab order when generating xfdl files.
You can apply the -TABORDER option while you use the -S or -F option.
nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -TABORDER
E:\ResultGenerate\TestGenerate\index.html
E:\ResultGenerate\TestGenerate\QuickView.html
E:\ResultGenerate\TestGenerate\popup.html
E:\ResultGenerate\TestGenerate\start.json
E:\ResultGenerate\TestGenerate\TestGenerate.xadl.js
E:\ResultGenerate\TestGenerate\TestGenerate.xadl.quickview.js
E:\ResultGenerate\TestGenerate\_theme\…
E:\ResultGenerate\TestGenerate\Base\…
…

Saving Generation Result as Log File

Generate an application based on C:\TestGenerate\TestGenerate.xadl file and output the result to E:\ResultGenerate. Then, save the details of the generation in the form of the E:\ResultGenerate\Log\TestGenerate_1.1.01.txt file.

nexacrogenerator.exe -A "C:\TestGenerate\TestGenerate.xadl" -O "E:\ResultGenerate" -L "E:\ResultGenerate\Log\TestGenerate_1.1.01.txt"
E:\ResultGenerate\TestGenerate\index.html
E:\ResultGenerate\TestGenerate\QuickView.html
E:\ResultGenerate\TestGenerate\popup.html
E:\ResultGenerate\TestGenerate\start.json
E:\ResultGenerate\TestGenerate\TestGenerate.xadl.js
E:\ResultGenerate\TestGenerate\TestGenerate.xadl.quickview.js
E:\ResultGenerate\TestGenerate\_theme\…
E:\ResultGenerate\TestGenerate\Base\…
…
E:\ResultGenerate\Log\TestGenerate_1.1.01.txt

nexacrocompressor.exe

nexacrocompressor.exe can be directly executed in the console by using the options described in the below table.

Options

nexacrocompressor.exe -F -O [args...]
nexacrocompressor.exe -P -O [args...]
XHTML5Compiler.exe의 옵션

Option

Description

'-F <file1>,[<file2>,…]

Specify the path of files to compress.

Separated by a comma or semicolon when multiple inputs exist

-F or -P option must be entered, but both options can not overlap.

Note: -F and -O must have the same order and number of files.

-P <directory>

Specify a target directory to compress.

-F or -P option must be entered, but both options can not overlap.

Note : Only one directory must be specified for -O and -P respectively.

-O <file1>,[<file2>,…]

-F used

Specify the output path to save compressed files.

Separated by a comma or semicolon when multiple inputs exist

Note : If -F is used, -F and -O must have the same order and number of files.

-O <directory>

-P used

Specify the output path to save compressed files.

Note : If -P is used, only one directory must be specified for -O and -P respectively.

Automatically generate a route if the specified path does not exist.

This option must be entered.

Note : If -F is used, -F and -O must have the same order and number of files.

-S <string>

Specify the suffix in the name of a compressed file.

-Shrink

Obfuscate a variable name.

A function will not be obfuscated if it contains an eval statement.

-IgnoreEval

Obfuscate JS file regardless of eval function (not recommend)

Note: To use this option, the -Shrink option must be used first.

-Compile

This option is used to convert files into an encrypted format available only in the Nexacro Runtime environment.

※ Files produced with this option can be used only in the Nexacro Runtime environment.

Add a path following this option in order to specify a particular location for saving compiled files.

If you do not add a path, compiled files will be saved into the path specified by the –O option.

-Compile [<file1>,<file2>,...]

When specifying files through the -F option

The -F option will specify the output paths to save encrypted files.

You can use a comma (,) or semicolon (;) as a delimiter when specifying multiple files.

※ The number and order of files must coincide between -F and -Compile.

※ With the -F option, XML files (whose extensions are .xml) also can be compiled.

-Compile [<directory>]

When specifying a directory through the -P option

The -P option will specify the output path to save encrypted files.

※ With the -P option, the number of designated directories must be one for -P and -Compile each.

-Ignorecompress <.ignorecompress>

Specify path for the .ignorecompress file, which stores a list of files that are not subject to compression

Note: this option is available only while the –P option is applied.

-H

Provide the help for "nexacrocompressor.exe".

Examples

Compressing Specific JS Files

Compress C:\JS\test1.js and C:\JS\childdir\test3.js files and output them as  E:\JS\test1.js and E:\JS\childdir\test3.js respectively.
Footnotes and spaces are removed.
nexacrocompressor.exe -F "C:\JS\test1.js,C:\JS\childdir\test3.js" -O "E:\JS\test1.js,E:\JS\childdir\test3.js"
E:\JS\test1.js
E:\JS\childdir\test3.js

Compressing JS Files in Specific Directory

Compress the JS files in C:\JS directory and output them to E:\JS directory.
Footnotes and spaces are removed.
nexacrocompressor.exe -P "C:\JS" -O "E:\JS"
E:\JS\test.js
E:\JS\test1.js
E:\JS\test2.js
E:\JS\childdir\test3.js
E:\JS\childdir\test4.js

Specifying Suffix in Compressed File's Name.

Add the suffix  "_2014100601" when compressing C:\JS\test1.js file and outputting it as E:\JS\test1.js.
Footnotes and spaces are removed.
nexacrocompressor.exe -F "C:\JS\test1.js" -O "E:\JS\test1.js" -S "_2014100601"
E:\JS\test1_2014100601.js

Obfuscating Variables for Compressed File

Obfuscate variables when compressing C:\JS\test1.js file and outputting it as E:\JS\test1.js.
Footnotes and spaces are removed.
However, a function will not be obfuscated if it contains an eval statement.
nexacrocompressor.exe -F "C:\JS\test1.js" -O "E:\JS\test1.js" -Shrink
E:\JS\test1.js

Obfuscating Variables for Compressed File regardless of Eval Function

Obfuscate variables except for the ones inside the eval function when compressing C:\JS\test1.js file and outputting it as E:\JS\test1.js.
Footnotes and spaces are removed.
Obfuscate the entire JS file regardless of eval() functions.
nexacrocompressor.exe -F "C:\JS\test1.js" -O "E:\JS\test1.js" -Shrink -IgnoreEval
E:\JS\test1.js

Excluding Specific Files when Compressing JS Files

Compress the JS files located in the C:\JS directory and output the results to the E:\JS directory. In this process, files defined in the .IgnoreCompress file, which is added as the -IgnoreCompress option, will be excluded.
Footnotes and spaces are removed. (Those contained in the .IgnoreCompress file are excluded.)
nexacrocompressor.exe -P "C:\JS" -O "E:\JS" -IgnoreCompress "C:\nexacro14\Project\.IgnoreCompress"
<?xml version="1.0" encoding="utf-8"?>
<CompressConfigue version="1.0">
	<IgnoreCompress>
		<File path=".\test1.js"/>
		<File path=".\Childdir\test4.js"/>
	</IgnoreCompress>
</CompressConfigue>
E:\JS\test.js
E:\JS\test1.js (Not compressed)
E:\JS\test2.js
E:\JS\childdir\test3.js
E:\JS\childdir\test4.js (Not compressed)