Basic Distribution Method

In the Runtime environment, you can release your Nexacro application through three distribution methods: plug-in, launcher and executable. If necessary, you can make a combination.

Plugin Distribution

The plug-in distribution is used when the applications run on the nexacro platform Runtime embedded in a web browser. By staying on the web browser, you can do your work while doing other tasks at the same time. You can access the applications at another time by adding the applications to the browser as bookmarks.

Your service administrator can manage the distribution through a directory structure as follows.

Path

File / Folder

Description

./

nexacroAX.html

Deployment page for Internet Explorer

./

nexacroPlugin.html

Deployment page for Chrome, Firefox, Safari and other web browsers

./

nexacro14_SetupEngine_N.cab

File designed to install the Nexacro Platform Runtime engine (ActiveX) for Internet Explorer

./

nexacro14_SetupEngine_N.exe

File designed to install the Nexacro Platform Runtime engine (plug-in) for Chrome, Firefox, Safari and other web browsers

./

nexacro14_client_license.xml

License file for Nexacro Platform

./Test/

SampleADL.xadl.js

ADL (JavaScript)

./Test/

start.json

Bootstrap file

./Test/

[nexacro14lib]

Component library folder (JavaScript)

./Test/

[_theme_]

Theme folder (JavaScript)

./Test/

[Base]

Application folder (JavaScript)

You must apply the "Deploy" feature rather than "Generate" to prepare files to be distributed. Go to the menu [Build > Deploy] in Nexacro Studio and select necessary items to form files to distribute.

Among the options available in the process of "Deploy," You must select "Merge JSON file."

The way of distributing the Nexacro Platform Runtime engine varies depending on web browsers. Therefore, you should write a script like the below one to check which browser is used and then lead to the appropriate page.

<html>
<head>
<script language="javascript">
function fn_onload()
{
	if ((navigator.userAgent.indexOf("MSIE") > -1) || 
		( navigator.userAgent.indexOf("Trident") != -1)) {
		window.location.href = "./nexacroAX.html";
	} else {
		window.location.href = "./nexacroPlugin.html";
	}
}
</script>
</head>
<body onload="fn_onload()">
</body>
</html>

Type of operating environment may affect the locations of an installation page and application execution page as well as the methods to move to those pages.

Deployment Page

A deployment page refers to the first HTML file that a web browser reads in order to run the Nexacro Platform engine. You can name the file whatever you like when you develop the relevant application.

nexacroAX.html

<HTML>
<HEAD>

<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<TITLE> Web Browser Embed nexacro platform Sample Page </TITLE>
<SCRIPT LANGUAGE="javascript">
function fn_load()
{
	// Specifies the path to the Bootstrap file for the service
	nexacroAXCtrl.bjson = "./Test/start.json";

	// Specifies the value of the key for the service
	// The key must be unique, never same as other keys under the same URL. 	
	nexacroAXCtrl.key = "nexacro_Sample";

	// Runs the Nexacro Platform engine
	nexacroAXCtrl.run();
}
</SCRIPT>

</HEAD>
<BODY onload="fn_load()">
<SCRIPT LANGUAGE="javascript">
document.write('<OBJECT ID="nexacroAXCtrl" width="50%" height="50%" CLASSID="CLSID:3CF3951B-34BD-4E22-933B-AE2BE0FA8941" CodeBase="./nexacro14_SetupEngine_N.cab#VERSION=2014,7,11,2"/>');
</SCRIPT>
</BODY>
</HTML>

When the engine is first distributed to users' computers, web browsers will pop up a message for installation. The installation process will begin when the users push the installation button.

nexacroPlugin.html

For web browsers other than Internet Explorer, you should write a script on your own for installing the plug-in. In the below script, the ExistPlugin function is used to check whether the plug-in has been installed. If it is not installed yet, the rest of the script will issue a message to lead users to download and execute the installation file.

<HTML>
<HEAD>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<TITLE> Web Browser Embed nexacro platform Sample Page </TITLE>
<SCRIPT LANGUAGE="javascript">
function fn_load()
{
    if (ExistPlugin() == false)
    {
        shtml = '<p><ul>';
        shtml += '<li>You do not have the plug-in used to display these contents.</li>';
        shtml += '<li>Click this link <a href="./nexacro14_SetupEngine.exe">[nexacro14_SetupEngine.exe]</a>to download and install the plug-in.</li>';
        shtml += '</ul></p>';
        document.writeln(shtml);
    }
    else
    {
        nexacroplugin.bjson = "./Test/start.json";
        nexacroplugin.key = "nexacro_Sample";
        nexacroplugin.launch();
    }
}

function ExistPlugin() 
{
    var mimetype = navigator.mimeTypes["application/nexacro14-plugin"];
    if (mimetype) 
    {
        var enablePlugin = mimetype.enabledPlugin;
        if (enablePlugin)
            return true;
        else
            return false;
    }
    else 
    {
        return false;
    }
}
</SCRIPT>

</HEAD>
<BODY onload="fn_load()">
<SCRIPT LANGUAGE="javascript">
document.write('<EMBED ID="nexacroAXCtrl" type="application/nexacro14-plugin" width="50%" height="50%"/>');
</SCRIPT>
</BODY>
</HTML>

SampleADL.xadl

The SampleADL.xadl file contains the application program distribution and execution environment settings to run the sample application program. This file is managed by nexacro studio. An example follows.

<?xml version="1.0" encoding="utf-8"?>
<ADL version="1.2">
<TypeDefinition url="default_typedef.xml"/> 1
<GlobalVariables url="globalvars.xml"/> 2
<Application id="nexacro_Sample" codepage="utf-8" 
     licenseurl="./nexacro14_client_license.xml" …> 3
     <Layout> 4
          <MainFrame id="mainframe" …>
               <ChildFrame formurl="Base::SampleForm.xfdl"…/> 5
          </MainFrame>
     </Layout>
    <ScreenInfo/>
</Application>
<Script><![CDATA[ ]]></Script>
</ADL>

Here is what happens in this code.

Callout

Description

1

Component distribution information is defined in the file 'default_typedef.xml'

2

Global variables used in applications are defined in the file 'globalvars.xml'

3

Application ID is nexacro_Sample

4

An application model is a single frame type, having a ChildFrame under the MainFrame.

5

The first screen form on the screen is “SampleForm.xfdl”.

There is additional information about the application program besides what is shown here. The best practice is to not edit these yourself since these are already supervised by nexacro studio.

The license file is provided when you purchase Nexacro Platform. If you modify the file at your discretion, your application may fail to operate properly.

default_typedef.xml

The default_typedef.xml file contains component distribution information needed to run the sample application program. Also, it is used to distribute additional components developed by the developer.

The following is an example of the default_typedef.xml file.

<?xml version="1.0" encoding="utf-8"?>
<TypeDefinition version="1.1">
  <Modules defaultpath="">
    <Module url="CompBase.json"/>
    <Module url="ComComp.json"/>
    <Module url="Grid.json"/>
    <Module url="DeviceAPI.json"/>
  </Modules>
  <Components>
    <Component type="JavaScript" id="Div" classname="nexacro.Div"/>
    <Component type="JavaScript" id="Button" classname="nexacro.Button"/> 1
    <Component type="JavaScript" id="PopupDiv" classname="nexacro.PopupDiv"/>
    <Component type="JavaScript" id="Combo" classname="nexacro.Combo"/>
    <Component type="JavaScript" id="CheckBox" classname="nexacro.CheckBox"/>
...

</Components>
  <Services>
    <Service prefixid="Base" type="form" url="./Base/" 
       version="0" communicationversion="0"/> 2
  </Services>
</TypeDefinition>

Here is what occurs in the file.

  1. The XML file contains the information on the Button component.

    The below statements are some of the several details about the Button component.

    The Button component will be distributed.

    To use the Button component, You need Button.js, a JavaScript module defined as nexacro.Button.

  2. A service group is defined for form URLs.

    Accordingly, you can simply specify a form URL with the format "Base/form name”. Then, the URL will be automatically replaced with the format "http://127.0.0.1/Test/Base/form name".

The best practice is to not edit this file yourself as it is automatically produced by nexacro studio.

Launcher Distribution

The Launcher distribution uses an application on the Runtime-version nexacro platform without using a web browser. The difference from the exe distribution is that it uses Launcher rather than executing the nexacro platform Runtime directly.

A service administrator can manage the distribution with the following directory structure.

Path

File / Folder

Description

./

SampleStart.html

Page that allows Internet Explorer users to install the Nexacro Platform engine

./

SampleLaunch.html

Page that allows Internet Explorer users to execute a Nexacro Platform-based application

./

nexacro14_Launcher_N.cab

File designed to install the Nexacro Platform launcher (ActiveX) for Internet Explorer

./

nexacro14_SetupEngine_N.cab

File designed to install the Nexacro Platform Runtime engine (ActiveX) for Internet Explorer

./

nexacro14_client_license.xml

License file for Nexacro Platform

./Test/

SampleADL.xadl.js

ADL (JavaScript)

./Test/

start.json

Bootstrap file

./Test/

[nexacro14lib]

Component library folder (JavaScript)

./Test/

[_theme_]

Theme folder (JavaScript)

./Test/

[Base]

Application folder (JavaScript)

SampleStart.html

Unlike the plugin distribution, the SampleStart.html file is an HTML file exclusively used for the set up of nexacro platform. The name of this file can be designated by the developer.

The following is an example of this file.

<HTML>
<HEAD>
<TITLE> nexacro platform Install Sample Page </TITLE>
</HEAD>
<SCRIPT LANGUAGE=javascript FOR=nexacroAXCtrl EVENT="error(errcode,errmsg)">		
		alert("errcode: " + errcode + "\nerrmsg: " + errmsg);
</SCRIPT>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
document.write('<OBJECT ID="nexacroAXCtrl" '
+ 'CLASSID="CLSID:3CF3951B-34BD-4E22-933B-AE2BE0FA8941" width="0" height="0" '
+ '"CODEBASE="./nexacro14_SetupEngine_N.cab#VERSION=2014,7,11,2"  '
+ 'onError="fn_onError()"> '
+ '</OBJECT>');
</SCRIPT>
</BODY>
</HTML>

nexacro platform Engine is installed by registering <SCRIPT LANGUAGE="JavaScript"> ~ </SCRIPT> without any other special execution instructions.

SampleLaunch.html

The SampleLaunch.html file is an HTML file to drive Launcher. The name of the file can be designated by the developer.

The following is an example of this file.

<HTML>
<HEAD>
<TITLE> nexacroLauncher Sample page </TITLE>
<SCRIPT LANGUAGE="javascript">
function fn_load ()
{
	nexacroLauncher.bjson = "./Test/start.json"; 2
	nexacroLauncher.key = "nexacro_Sample"; 3
	nexacroLauncher.launch(); 4
}
</SCRIPT>
</HEAD>
<SCRIPT LANGUAGE=javascript FOR=nexacroLauncher EVENT="error(errcode,errmsg)">		
		alert("errcode: " + errcode + "\nerrmsg: " + errmsg);
</SCRIPT>
<BODY onload="fn_load()">
<SCRIPT LANGUAGE="javascript">
document.write('<OBJECT ID="nexacroLauncher" '
+ 'CLASSID="CLSID:812CB626-69B7-4FEB-B42F-E3BBFF53E23B" width="90%" height="90%" '
+ 'CODEBASE="./nexacro14_Launcher_N.cab#VERSION=2014,7,11,2"  '
+ 'onError="fn_onError()">' 1
+ '</OBJECT>');
</SCRIPT>
</BODY>
</HTML>


Callout

Description

1

Install Launcher

2

Set the key value of the service

(At the time of plugin distribution, it plays the same role as the key value designated for SampleStart.html.)

3

Designate the Bootstrap route

4

Run the nexacro platform Engine through Launcher

Integration of SampleLaunch.html and SampleStart.html

The SampleLaunch.html and SampleStart.html can be integrated into one file.

The following is an example of the integrated file.

<HTML>
<HEAD>
<TITLE> nexacro platform Launcher execution </TITLE>
<SCRIPT LANGUAGE="javascript">
function fn_load ()
{
	nexacroLauncher.bjson = "./Test/start.json";
	nexacroLauncher.key = "nexacro_Sample";
	nexacroLauncher.launch(); 3
}

</SCRIPT>
</HEAD>
<SCRIPT LANGUAGE=javascript FOR=nexacroAXCtrl EVENT="error(errcode,errmsg)">		
		alert("errcode: " + errcode + "\nerrmsg: " + errmsg);
</SCRIPT>
<SCRIPT LANGUAGE=javascript FOR=nexacroLauncher EVENT="error(errcode,errmsg)">		
		alert("errcode: " + errcode + "\nerrmsg: " + errmsg);
</SCRIPT>
<BODY onload=" fn_load()">
<SCRIPT LANGUAGE="javascript">
document.write('<OBJECT ID="nexacroAXCtrl" '
+ 'CLASSID="CLSID:3CF3951B-34BD-4E22-933B-AE2BE0FA8941" width="0" height="0" '
+ '"CODEBASE="./nexacro14_SetupEngine_N.cab#VERSION=2014,7,11,2" >'
+ '</OBJECT>'); 1
document.write('<OBJECT ID="nexacroLauncher" '
+ 'CLASSID="CLSID:812CB626-69B7-4FEB-B42F-E3BBFF53E23B" width="0" height="0" '
+ '"CODEBASE="./nexacro14_Launcher_N.cab#VERSION=2014,7,11,2" >'
+ '</OBJECT>'); 2
</SCRIPT>
</BODY>
</HTML>

Callout

Description

1

Install nexacro platform Engine.

2

Install Launcher.

3

Run Launcher

exe Distribution

The exe distribution does not use a cab file. Instead, you need to install the nexacro platform engine manually and run an application.

exe is generally used when the application will be distributed on a CD or by downloading an execution file. However, the nexacro platform component for the screen output should be distributed by a HTTP server. Therefore, a separate HTTP server will be operated.

Context root




SampleADL.xadl.js

ADL (JavaScript)


start.json

Bootstrap file


[Component]

Component Library Folder (JavaScript)


[_theme_]

Theme Folder (JavaScript)


[Service Folder]

Application Folder (JavaScript)

Running nexacro platform on the Setup Command Prompt

Run the nexacro platform Engine from the MS Windows command prompt.

Type the following command on the command line, which is the same as running the nexacro platform engine through Launcher.

"C:\Program Files\nexacro\14\nexacro.exe" -K "nexacro_Sample" -S "http://127.0.0.1/Test/start.json"

Where:

-K

Specifies the Key value. At the time of plugin distribution, it plays the same role as the key value designated in the SampleStart.html file.

-S

Defines the Bootstrap path.

Shortcut Icon Distribution

This distribution method creates shortcut icons for users who connect through the web server for the first time. Thereafter, it is used when running application programs through shortcut icons. It is a combined form of Launcher distribution and exe distribution.

Context root




MakeShortcut.html

See the section MakeShortcut.html


SampleIconImage.ico



nexacro14_SetupEngine_N.cab



SampleADL.xadl.js

ADL (JavaScript)


start.json

Bootstrap file


[Component]

Component Library Folder (JavaScript)


[_theme_]

Theme Folder (JavaScript)


[Service Group]

Application Folder (JavaScript)

MakeShortcut.html

The MakeShortcut.html file contains the information for installing the nexacro platform Engine and creating a "shortcut" icon to run an application program. The file name can be designated by the developer.

The following is an example of the file.

<HTML>
<HEAD>
<TITLE>Make shortcut Sample Page </TITLE>
<SCRIPT LANGUAGE="javascript">
function fn_make_shortcut()
{
     nexacroLauncher.key = "nexacro_Sample";
     nexacroLauncher.bjson = " ./Test/start.json";
     nexacroLauncher.makeshortcut("shortcut",
          "./SampleIconImage.ico",
          "desktop", false);
}
</SCRIPT>
</HEAD>
<BODY onload="fn_make_shortcut()">
<SCRIPT LANGUAGE="javascript">
document.write('<OBJECT ID="nexacroAXCtrl" '
+ 'CLASSID="CLSID:3CF3951B-34BD-4E22-933B-AE2BE0FA8941" width="90%" height="90%" '
+ '"CODEBASE="./nexacro14_SetupEngine_N.cab#VERSION=2014,7,11,2" >'
+ '</OBJECT>');
document.write('<OBJECT ID="nexacroLauncher" '
+ 'CLASSID="CLSID:812CB626-69B7-4FEB-B42F-E3BBFF53E23B" '
+ '"CODEBASE="./nexacro14_SetupEngine_N.cab#VERSION=2014,7,11,2" >'
+ '</OBJECT>');
</SCRIPT>
</BODY>
</HTML>

When the user accesses this page from the browser, the shortcut icon is displayed. Clicking the icon executes the nexacro platform engine.

Distribution of 3rd Party Module

When distributing a 3rd party product with the nexacro platform Runtime, it must be distributed as a cab file.

Making the Distribution File

nexacro platform uses the same cab setup technique as for web browsers. Make the cab file for the 3rd party module as you would for running on a web browser.

However, please note that only cab files with the signature of a certified institution can be used.

Using the 3rd Party Module

Using your 3rd party module made as a cab file is simple. When developing a form in nexacro studio, register the URL of the cab file in the codebase property value of the OCX component.