Jetty Server10 Sep 2016
The Eclipse Jetty Web Server
The Web Server for Iselex is a Java HTTP server and container, running the database engine BaseX. It is a web server based around the user conception called REST, invented by Roy Field in the 1990sw, and which allows one to associate a programming algorithm to a URL.
When you access Isilex, it is ‘system ready’ on whatever platform you are using.
You simply have to start it up. You will see a small ruler icon appear in the system tray adjacent to the time icon. Click on ‘open Isilex’ and it is then up and running. You can begin to work with it straight away, i.e. you can start creating files, annotations, and a corpus.
Since it is programmed in Java, BaseX and its wrapper Web Isilex, work on any platform and do not need to be installed.
How to Use Isilex as a Web Server
By default, when the Eclipse Jetty Web Server it listens to TCP port 8984. To use Isilex as a Web Server, you need to reconfigure it to listen to TCP port 80 (the most frequently used TCP port). There are two ways of doing this:
- The first is to reconfigure Eclipse Jetty as your principal server. In that case, you need to modify the servlet container in the Web.xml configuration file with a tet editor. Change the port to port 80 and restart Isilex, which will now listen to port 80.
- The second is to be used if you are configured (and this often happens) to another more classic kind of Java HTTP server such as Apache or Nginx. In that case you have to instigate the redirection to p[ort 8984 within Apache or Nginx. You will find the instructions for how to do that for both Nginx and Apache virtual host systems here: here (Nginx) and there (Apache)
Isilex’s great strength is that it is a ready-to-use package. All the same, users who want to wor up their own particular applications to suit their research needs can do so very easily.
At the base-level of Isielx there is a repertory called “Webapp” which contains a file entitled “Additional.xqm”. |You can easily add REST (representation state tranfer) functions here in order to implement your own efforts (to find out more on the Xquery syntax to be used in REST. Consult http://docs.basex.org/wiki/Repository.
Isilex puts its users in touch with a small collection of functionality from its own in-built library. What does this consist of? Here is an example:
To create a page which says ‘”Hello World” you simply open the file “additional.xqm” (mentioned above), and add at the end of it the following lines of code:
1. declare %rest:path('/monAppli')
3. function isilex:monAppli()
5. isi:template('Hello World')
That is all that you need to do. Once you have saved that file, you can simply open your application at the address: http://localhost:8984/mon Appli and, as though by magic, the application launches.
The development of new XQM functionality is well documented on the web. You will find a description of the format of the URL which are anticipated by BaseX available at: http://docs.basex.org/wiki/Repository