Skip to content

Ref AppletCompiler

Justin Fyfe edited this page Jan 28, 2018 · 1 revision

Applet Compiler

The applet compiler is a tool which will bundle your AngularJS controllers, views, models, business rules, protocols, reports, and other assets into a single compressed PAK file for distribution.

The applet compiler will also optionally sign the package using your signing key.

1.0 Command Line Options

Tool: appletcompiler.exe

The following parameters are supported by the applet compiler:

Option Description Example
deploy Deployes the rendered applet files to an HTTP server location --deploy=/srv/www/htdocs
lang The language to pre-render deployed output files in --lang=en
c Instructs the compiler to clean the output directory
source The source files / directory to include in the applet --source=c:\myapplet
output The destination PAK file that should be created --output=myapplet.pak
help Display application help and exit
include Includes / references files from another applet pak file --include=org.openiz.core.pak
optimize When provided, instructs the applet compiler to minify javascript and css files
keyFile Specifies the location of your signing key (in PFX format) --keyFile=mykey.pfx
keyPassword Specifies a file where the password to unlock your private key can be found --keyPassword=mykey.password
compile Instructs the applet compiler to compile the --source directory into --output pak flie
sign Instructs the applet compiler to sign an exsiting --source pak file and output it to --output pak file
embedCert Instructs the applet compiler to embed a copy of the public key into the PAK file (recommended for deployments)
compression Changes the compression algorithm from DEFLATE to an alternate method (lzma, gzip, bzip2, defalte) --compression=lzma

2.0 Publishing Your Applet

To publish your applet it is recommended you first obtain a code signing certificate (PFX file) either from MEDIC or generate your own steps here.

Creating an Unsigned Applet (Debugging Only)

To create an unsigned applet:

  1. Ensure your manifest.xml file is accurate including version, package id, etc.
  2. Run the applet compiler as follows:
    appletcompiler --source=C:\myapp --output=myapp.pak
    
  3. Upload myapp.pak to your OpenIZ IMS server
  4. Join your OpenIZ IMS server with the disconnected client
    1. Your IMS server may not start or may refuse to load unsigned applets. If this is the case either configure your IMS server to allow unsigned applets or sign your applet
    2. Notice that your disconnected client will warn you that the package is not signed
    3. Note that contents of the file can be accessed by using DisconnectedClient --debug , no minifcation has occurred.

Creating a Production Applet

To create a production (optimized) applet:

  1. Ensure your manifest.xml file is accurate including version, packagte id, etc.
  2. Run the applet compiler as follows:
    appletcompiler --source=C:\myapp --output=myapp.pak --optimize --keyFile=C:\keys\mykey.pfx --embedCert
    
  3. When prompted enter the private key password for your PFX file
    1. Alternately you can save the password in a file and use --keyPassword parameter (make sure the key password file and PFX file are kept out of source control)
  4. Upload myapp.pak to your OpenIZ IMS server
  5. Join your OpenIZ IMS server with the disconnected client
    1. Your IMS server may not start or may refuse to applets signed from third party keys. If this is the case add the thumbprint of your signing key to <trustedPublishers>
    2. The disconnected client may warn that the application is from an unknown publisher
    3. Note that contents of the controller files are minified, so running DisconnectedClient --debug will require un-minification tools to debug.

Clone this wiki locally