Installing Nexacro-Xeni

Nexacro-Xeni is a server module that provides necessary features for clients to process data in file forms. It is designed to transfer data from a file to a grid or vice versa.

Nexacro-Xeni supports the following file formats and features.

File format

Extension

Features

Microsoft Excel 97-2003

xls

export / import

Microsoft Excel 2007/2010

xlsx

export / import

CSV format file

csv

import

Installation

Java-based Nexacro-Xeni requires JDK or JRE (1.8 or later version).

You can deploy the provided Web application ARchive (WAR) file. Otherwise, you can unzip the WAR file in your PC and then copy necessary files to the /WEB-INF/lib directory or to the defined class path.

Copying the above files to a server rather than deploying the WAR file may cause problems due to the disparity in library versions.

Nexacro-Xeni utilizes the Apache POI library. Click the following link for the details on Apache POI.

https://poi.apache.org/

To run Nexacro-Xeni, you must install X-APIs. To that end, please refer to Installing Nexacro Platform X-APIs.

If you copy JAR files to the existing context, you must add the below codes to the web.xml file.

<servlet>
	<servlet-name>XExportImport</servlet-name>
	<servlet-class>com.nexacro.xeni.services.GridExportImportServlet</servlet-class>
</servlet>	
<servlet>
	<servlet-name>XImport</servlet-name>
	<servlet-class>com.nexacro.xeni.services.GridExportImportServlet</servlet-class>
</servlet>	
	
<servlet-mapping>
	<servlet-name>XExportImport</servlet-name>
	<url-pattern>/XExportImport</url-pattern>
</servlet-mapping>	
<servlet-mapping>
	<servlet-name>XImport</servlet-name>
	<url-pattern>/XImport</url-pattern>
</servlet-mapping>	
    
<context-param>
	<param-name>export-path</param-name>
	<param-value>/export</param-value>
</context-param>	
<context-param>
	<param-name>import-path</param-name>
	<param-value>/import</param-value>
</context-param>	
<context-param>
	<param-name>monitor-enabled</param-name>
	<param-value>true</param-value>
</context-param>    
<context-param>
	<param-name>monitor-cycle-time</param-name>
	<param-value>30</param-value>
</context-param>	
<context-param>
	<param-name>file-storage-time</param-name>
	<param-value>10</param-value>
</context-param>

The JAR file list and codes of web.xml as described above represents the 1.1 version of Nexacro-Xeni. Those contents may change later in accordance with future updates.

Confirming Installation

To confirm the successful installation, open the below URL through a web browser.

http://127.0.0.1:8080/XExportImport

Then, check that the below message is returned.

The URL differs according to installation paths. If you deploy the WAR file rather than copying the inside files, the below URL will be given to you.

http://127.0.0.1:8080/nexacro-xeni-N/XExportImport

Settings

The below table presents the main parameters registered in the servlet context.

Name

Default value

Description

export-path

/export

Designates the path where downloaded files are temporarily saved.

import-path

/import

Designates the path to hold temporary files whose data is processed into grid components.

If the value of the monitor-enabled parameter is set to "true," the temporary files will be deleted right after the data processing.

monitor-enabled

true

Determines whether to run the file manager.

If "false," the file manager will not operate while the temporary files will not be deleted.

monitor-cycle-time

30

Sets the interval for deleting temporary downloaded files by minute.

At determined intervals, the file manager will operate, check the files that are subject to deletion, and finally remove those files.

file-stroage-time

10

Sets the period for storing temporary downloaded files by minute.

When the file manager operates, it deletes the files that have been stored longer than a determined period.

For further details, please refer to the readme.txt file included in the WAR file.

Example

This section explains simple examples of processing data using Nexacro-Xeni. Go to the below item in the help menu for the details on properties, methods and events

Objects > Misc. Objects > ExcelExportObject

Export

The process of exporting data begins with sending grid-bound data to the server. Next, the server creates a file based on the data to allow users to download the file. In the below sample script, users will download the file derived from the data bound to the Grid00 component.

this.Button00_onclick = function(obj:Button,  e:nexacro.ClickEventInfo)
{
	this.exportObj = new ExcelExportObject();
	var ret = this.exportObj.addExportItem(nexacro.ExportItemTypes.GRID, 
		this.Grid00, "Sheet1!A1");
	this.exportObj.set_exporturl("http://localhost:8080/XExportImport");   
	this.exportObj.exportData(); 
}

Import

At the beginning of the importing data process, users send their files to the server, which will convert those files into datasets. Afterward, the users will perform their tasks by downloading those datasets.

this.Button00_onclick = function(obj:Button,  e:nexacro.ClickEventInfo)
{
	this.importObj = new ExcelImportObject("Import00",this); 
    this.importObj.addEventHandler("onsuccess", this.Import_onsuccess, this);
	this.importObj.set_importurl("http://localhost:8080/XExportImport");
	this.importObj.importData("","output=ds","Dataset00=ds");
}

this.Import_onsuccess = function(obj,e) 
{
	this.Grid00.createFormat();
}