HTTPS SSH

README

INTRODUCTION

There are two alternative procedures for building VocBench3: with Maven and with Npm. We suggest to follow the one with Maven since it does not require Npm to be installed (it is downloaded as a plugin dependency and run by Maven during the building process), requires less interaction steps and the content of its build is a superset of the one built by using Npm.

BUILDING WITH MAVEN

Prerequisites

Maven installed.

Building

Execute the command

mvn clean install

from the root of the project (/vocbench3, where the pom.xml file is located). This command will generate three folders:

  • /node_modules: contains the dependencies of the application;
  • /dist: contains the static assets of the front-end;
  • /target: contains the generated vocbench3-<versionnumber>.war web archive.

The directory /dist is the distribution that contains the static assets of the front-end generated by the npm build procedure. This distribution can be deployed on any http server. Alternatively, the war file can be deployed on the karaf server embedded with the Semantic Turkey system (inside the /deploy directory) or on any application server.

BUILDING WITH NPM

Prerequisites

Required Node.js and npm. Verify that you are running at least node v6.9.x and npm 3.x.x by running node -v and npm -v in a terminal/console window. Older versions may produce errors.

Installing the dependencies

Execute the command below:

npm install  # or just: npm i

Building

After having installed the dependencies, execute npm run build to create a dist folder, a distribution deployable in any http server (tested with Tomcat 7.0.52 and 8.0.27). In config/webpack.prod.js it is possible to change the name of the produced folder simply by changing the path property in the output object

output: {
    path: helpers.root('dist'),
    ...    
},

DEPLOYING AND RUNNING THE SYSTEM

Prerequisites

Semantic Turkey is necessary for VocBench to operate. VB3 is actually a web client for ST.

Different Deployments

In order to run VocBench 3, it is possible to:

  • deploy the war file produced through the Maven build procedure inside the /deploy directory of the Karaf distribution of Semantic Turkey. Then run Semantic Turkey and access VocBench at http://localhost:1979/vocbench3
  • deploy the dist directory (produced by any of the two described build procedures) on any HTTP server. Run Semantic Turkey and access VocBench at the address/port determined by the chosen HTTP server.
  • run without building, as detailed here below (still ST must be running)

In alternative to building a distribution for deployment in a web/application server, after installing the dependencies (as explained above), it is possible to serve the application directly from sources using a Node.js server (webpack-dev-server). To accomplish this, after the install command, execute the following command:

npm start

In this case the application will respond at

http://localhost:8080

unless you have changed the port in package.json "start": "webpack-dev-server --inline --progress --port 8080"

FURTHER CONFIGURATION

Prerequisites

The custom settings below are not possible when running VocBench from inside the Karaf container as in the standalone distribution. You might want to have VocBench installed as a separate web application in a dedicated server, as explained in the previous sections.

In vbconfis.js (under src/ of the source package, or under the root folder of the built distribution) it is possible to configure the SemanticTurkey host resolution. By default VocBench3 dynamically resolves the IP address of the SemanticTurkey server (by using the same IP address of the VocBench host machine) and the port number (by using the same port of the VocBench container). In case you have installed VocBench in a different container or in a dedicated server you might have to change the following configuration.

/**
 * IP address/logical host name of the machine which hosts SemanticTurkey.
 * By default it is resolved dynamically by using the same address of the *VocBench* host machine,
 * (if VocBench3 and SemanticTurkey are running on the same machine this can be left commented),
 * if you want to change the address you must uncomment the line and edit the value.
 */
// var st_host = "127.0.0.1";

/**
 * Port where SemanticTurkey server is listening.
 * By default it is resolved dynamically by using the same port of the *VocBench* host machine,
 * (if VocBench3 and SemanticTurkey are running on the same container this can be left commented),
 * if you want to change the port you must uncomment the line and edit the value.
 */
// var st_port = "1979";

It is also possible to change the path where SemanticTurkey server is listening and the protocol to use

/**   
 * Path where SemanticTurkey server is listening. If omitted, the sole host is considered.
 * Please note that the path of Semantic Turkey services is defined as in:
 *  http://semanticturkey.uniroma2.it/doc/user/web_api.jsf#services_address_structure
 *  This additional path information is considered to be the starting part of the path described above, 
 *  and is usually necessary in case Semantic Turkey is installed behind a proxy redirecting the ST URL.
 */ 
var st_path;

/**
 * Protocol - either http or https
 */
var st_protocol = "http";