This document explains how to use the euroLCC Web archive and presents the euroLCC implementation.
In this document we assume that you have installed:
See the PageBox installation guide for more information about the PageBox installation.
euroLCC is a Web application that helps finding Low Cost Carrier (LCC) flights between origin and destination airports. euroLCC illustrates the use of the generic installation class. Starting with version 0.0.2 euroLCC is misnamed. The initialization files of euroLCC describe European, Australian, American and other countries airports and some LCCs and LCC routes.
For background information about Air Transport industry and specifically about Low Cost Carriers you may read our presentation of the Air Transport industry. European market of Low Cost carriers is especially interesting to study because:
For comparison we added two American LCCs (South West and Jet Blue) and two LCCs from Australia / New Zealand (Freedom Air and Virgin Blue). Though we took a rather close definition of LCC in our selection if you analyze the route.csv file with a spreadsheet you may find that we compare oranges and apples. There seems to be at least three kinds of LCCs:
To test euroLCC you need:
The PageBox must be configured:
You can use the same PageBox as for Pandora distributed.war and central.war. For more details about the database and the rules.xml setting you can look at the Pandora user guide. You can also use this document to understand how to subscribe your PageBox and publish euroLCC.
If you configured properly the PageBox, euroLCC.war should be properly installed.
You can check that the database tables were properly setup. For instance to check the euroLCC database run the mysql command.
The database is created by the PageBox and its name is made of the PageBox directory and of the archive name. Its name may be different in your case. In the case of euroLCC the generic installer creates two tables:
euroLCC includes three forms
Start your browser. If your PageBox is configured with the rules.xml listed in the Pandora user guide:
You can display the Airline list of euroLCC for an WSDP running locally on default port (8080) with http://localhost:8080/PageBox1/euroLCC/airline. You should get this:
This list contains the URLs of the sites of the European Low Cost Carriers considered in euroLCC.
You can click on the Airport codes link on the top right of the Airline list or go to http://localhost:8080/PageBox1/euroLCC/airportcode. You should get this:
Select an airport name on the drop down list and click the Get code button. Then the airport code is displayed.
You can click on the Routes link on the top right of the Airline list or go to http://localhost:8080/PageBox1/euroLCC/route. You should get this:
Select an origin airport on the Origin drop down list and a destination airport on the Destination drop down list. Then click on the Get route button. You should get a list like this.
The first displayed route is a direct flight. Other routes have a connection. For instance you can go from Nice to Barcelona using a Virgin Express flight to Geneva followed by an Easy Jet flight from Geneva to Barcelona.
euroLCC is made of the following components:
The generic Installation class:
The sqlinstall directory must be a subdirectory of the installation directory of the archive.
The sqlinstall directory must contain Comma Separated Value (.csv) files with the same number of fields on each line, in the following format:
Here is the beginning of the euroLCC’s route.csv:
Here is the beginning of the euroLCC’s airport.csv:
The generic installation class replaces the first <!--Install_wordir--> place holder in web.xml by the installation directory of the archive.
The generic Install class implements the InstallIF interface and is called by the PageBox once the archive has been installed on the target Application server and before the archive is dynamically deployed on the Application server. For more information about the Installation interface see the developer guide and the installation guide.
The install method is a method of the InstallIF interface called by PageBox to perform a post installation. The install method enumerates the files in the sqlinstall directory and for each file found calls a create method.
Then the install method calls an updateWebXml method to replace the first <!--Install_wordir--> place holder in web.xml by the installation directory of the archive.
The create method processes the creation and the population of a table described in a sqlinstall file. The create method first calls a readFile method to read and parse the file.
If the file describes a table but doesn’t contain data the file has only two lines. In this case and in case of archive update create does nothing in order to preserve the existing table content. Otherwise create drops and creates a table with the same name as the file (without extension) and calls a createData method to populate the table.
The readFile method reads and parses a csv file. readFile returns the number of lines in the file and setup the following variables:
For each array found in the rows ArrayList createData inserts a new row in the table.
The uninstall method is a method of the InstallIF interface. The uninstall method is called by PageBox to perform a de-installation. In case of de-installation for update uninstall does nothing. Otherwise the uninstall method enumerates the files in the sqlinstall directory and for each file found drops the table with the same name as the file (without extension).
updateWebXml updates the archive web.xml. The web.xml is expected to contain a workdir context parameter with an update placeholder:
updateWebXml replaces <!--Install_wordir--> by the archive directory.
Here is how it works. updateWebXml
Use in euroLCC
In case of euroLCC sqlinstall contains two files, route.csv and airport.csv. therefore the generic installation class creates two tables:
The AirlineBean class handles a TreeSet containing the carriers’ URLs.
The getAirlines method of AirlineBean is called by airline.jsp to format the carriers’ URLs in HTML table rows.
The Airline servlet has two main methods, initialize called in its doGet method and doGet called when the user queries the airline URL.
The AirportCodeBean class handles a TreeMap whose keys are airport names and values airport codes and the currently selected airport name.
The getNames method of AirportCodeBean is called by airportcode.jsp to format the airport names in HTML select options.
The AirportCode servlet has three main methods, initialize called in its doGet and doPost method, doGet called when the user queries the airline URL and doPost called when the user clicks on the Get code button.
The RouteBean class handles one origin AirportCodeBean, one destination AirportCodeBean and an ArrayList of the routes found between the selected origin and destination. A route can be made of one or two Segment objects. A Segment describes a flight origin, flight destination and carrier URL.
The getAirlines method of RouteBean is called by route.jsp to format the flight origins, flight destinations and carrier URLs in HTML table rows. getAirlines enumerates the route ArrayList and for each route the route Segments.
The Route servlet has four main methods, initialize called in its doGet and doPost method, doGet called when the user queries the airline URL, doPost called when the user clicks on the Get route button and findRoutes called by doPost to find routes.