2.2 The Sample Application

To get familiar with openXMA a sample application is provided as Eclipse project. It is called xma_simplesample and can be found at the openXMA Subversion repository (xma_simplesample). If you create a new openXMA application an Eclipse project with a structure similar to xma_simplesample is created (but of course without any sources). Be aware, when you first open the project it usually will not compile, as the needed libraries are yet to download from a public Maven repository.

To run the sample:

  1. get the xma_simplesample project and import it into your Eclipse workspace. You can download it (xma_simplesample.zip) or check it out from our source SVN (xma_simplesample/trunk).

  2. Adjust the path to the simulated database of this project. The database is found in hsqldb/testdatabase inside the project. So change c:/JavaDev to the directory of your workspace in the following line in file src/root.properties:

    dbUrl=jdbc:hsqldb:<yourPath>/xma_simplesample/hsqldb/testdatabase
  3. build the project with ant using the target all (it is not the default target). A first build of xma_simplesample also initializes your local Maven repository as all libraries needed for openXMA development are downloaded by the build. After this step the project should also compile within Eclipse (refresh and clean the project if it does not compile).

  4. start tomcat using the eclipse launch configuration start_xma_simplesampleServer defined in this project (this script is always called start_<projectName>Server in an openXMA project). Alternatively you can use a Tomcat Eclipse plugin for starting and deploying..

  5. If you added own libraries to the pom.xml: run the project's xma_simplesample mvn eclipse_eclipse.launch (this script is always called <projectname> mvn eclipse_eclipse.launch in an openXMA project) to update the project's .classpath file. It can be found at Menu Bar > Run > External Tools > Program.

  6. deploy it into tomcat using the ant target tomcat-deploy.

    If you use tomcat with other users than defined in Preconditions or on an other port than 8080, you can adjust this in your build.xml:

      <!-- tomcat specifics -->
      <!-- Configure properties to access the tomcat-Manager application -->
      <property name="tomcat_manager" value="http://localhost:8080/manager"/>
      <property name="tomcat_username" value="admin"/>
      <property name="tomcat_password" value="admin"/>

  7. For future builds of xma_simplesample, you can use its default ant target all_undeploy_deploy.

  8. start its client using the eclipse launch configuration start_xma_simplesample_AccountList defined in this project (To start an openXMA application from Eclipse is of course only practical for openXMA developers. End users will typical start an openXMA application by click on an URL in a web browser).