OpenXava Demo Installation


Prerequisites


Eclipse

The instructions below explain how to install into the Eclipse IDE (or equivalent, such as Spring Source Tool Suite).  You can adapt these instructions to work with different IDEs.


Install OpenXava and verify operation

Install OpenXava and verify that the installed sample executes, using OpenXava instructions.

BusLogicDemoOpenXava

Download the BusLogicDemoOpenXava project, and expand the zip.  We suggest you place it inside the OpenXava installation (parallel to Tomcat and the Workspace).

This contains the prerequisites for the application, including the hsql database and jdbc drivers, hibernate, etc.  We do recommend you separately download the full Automated Business Logic install, although that is not required to run this demo.


Quick Installation

BusLogicDemoOpenXava is delivered as a zipped project you can import as described below.

Import Project into OpenXava workspace

Copy BusLogicDemoOpenXava.zip into the OpenXava workspace folder, and expand it as shown below.


Now import the project into Eclipse, as follows:
  1. Open Eclipse, specifying the workspace folder shown above

  2. From the Eclipse File > Import > Existing Project, and select the BusLogicDemoOpenXava folder located inside the workspace folder

Clean Project

Use Project > Clean to rebuild all the class and properties files.

Configure Project

Most of the configuration has been supplied in the imported project.  However, you must still perform the steps outlined in the sub-sections below.  Use the screen shot below as a reference.


Create Tomcat Server

Access Servers View (add it via Window > Show View if it is not already present), and right click in the view for New > Add Server; in the ensuing wizards:
  1. Define a New Server
    1. Server Type: Tomcat V6
    2. Server Name -- default is fine: Tomcat v6.0 Server at localhost
    3. Click Next
  2. Tomcat Server - Specify the installation directory
    1. Select the Tomcat supplied in the OpenXava install (parallel folder to the workspace)
  3. Add and Remove
    1. Add BusLogicDemoOpenXava to the server
    2. Click Finish

Configure the Tomcat Data Source: context.xml in Servers project

In the Servers project in your workspace, edit the URL in the context.xml file (see diagram above) to indicate the location of your BusLogicIntroOpenXava/data folder (or, copy this to a desired location).  

Note: On Windows, consider using the ../ notation.  

<Resource 
       name="jdbc/BusLogicDemoOpenXavaDS" 
       auth="Container" 
       type="javax.sql.DataSource"
       maxActive="20" 
       maxIdle="5" 
       maxWait="10000"
       username="sa" 
       password="" 
       driverClassName="org.hsqldb.jdbcDriver"
       url="jdbc:hsqldb:file:/Users/val/Documents/ABLDev/Frameworks/OpenXava/openxava-4.2.3/tomcat/data/BusLogicDemo.db"
/>


Manual Installation

As an alternative to the Quick Installation above, you can manually create the BusLogicDemoOpenXava project, using OpenXava guidelines for running under Eclipse (click the book, and please refer to Chapter 4). 

Execution

Verify Operation

Verify that your project is running
  1. Start the server (Server View - select Tomcat V6.0 OX, right click and execute Debug)
  2. Set a breakpoint in CustomerLogic (line 11)
  3. Run the application using http://localhost:8080/BusLogicDemoOpenXava/modules/Customer
    1. You won't see much in the Debugger Variables panel, since the logic is specified in the annotation, not a Java method
    2. Alternatively, you can specify Constraints using Java or Groovy methods, which you may find easier to debug:
      1. This approach will also require an Instance Variable
      2. Such instance variables contain valuable debug information
  4. Navigate to the first Order, and alter the Paid flag
  5. Verify the breakpoint is hit

ċ
BusLogicDemoOpenXava.zip
(30570k)
Val Huber,
May 17, 2012, 10:23 PM
ċ
BusLogicDemoOpenXava471.zip
(23890k)
Val Huber,
Jun 27, 2013, 9:50 PM
Comments