Web Application Creation Tutorial
This document describes the processes needed to create and deploy a Presence Web Application.
For this tutorial you will need to install and run a Servlet Engine such as Tomcat:
Part one: Task Creation
For this example we will create a simple application that asks the user's name and then returns some information about the name. For this we will need two Tasks which:
- Display a page requesting the user's name
- Display a page showing information about the user's name
In a real world example both of these pages could be generated by a single Task, but we want to demonstrate multiple Tasks being used by a Web Application. The Tasks can be downloaded from here. Go ahead and extract the zip file then import the XML file into Presence.
Once imported, you can test the functionality by running the Presence HTTP Server then directing your web browser to the following URL:
http://[server name]:[http port]/task/requestName
Try it out. You won't be very impressed, but if you can submit the form and receive a suitable response then it is working which is the main thing.
Part two: Web Application Creation
The next step is to create our WAR file which we will later deploy to our Servlet Engine.
In the Presence Administration Client select Tools > Create Web Application from the top menu. You will then be presented with the first screen of the Web Application Wizard. Complete this information using the example below as a guide:
Click "Next >" to specify which Tasks you want to include in your Web Application. Drag the Category containing our two Tasks into the right-hand Table. Aliases will be autogenerated, but you can change them by right-clicking on a Task and selecting "Change Alias" from the pop-up menu:
Click "Next >" to view the Resources screen. This project doesn't require any external resources, but if you need to include things like images and style-sheets then this is the place to do it. Click Next again to proceed to the Libraries screen. Again, we shouldn't need any external libraries for this project so you can skip this screen as well and proceed to the "Create WAR File" screen:
We will call our WAR file "nameanalysis.war" and save it to the root of the C: drive. If you want to call it something else, or save it elsewhere, feel free to do so - just remember where you put it as you'll need it later.