This web sample demonstrates DAS advanced features in the context of a simple web application using Ajax.
The application user can navigate the menu to see examples of different DAS features.
The application uses "dbConfig" utility to create canned Derby database with required tables and populate initial data in them. For refreshing database data to initial state, user can click on Refresh Button.
In future more features will get added.
There are two options for running this sample:
You need to download the Tuscany RDB DAS source distribution and run maven build to use this option. When you build using maven from the source root {SRC_ROOT} directory, the sample war file is created under {SRC_ROOT}/samples/sample-ajax-das/target. This sample application is deployed to an instance of Tomcat as part of our automated sample testing. For this, follow instructions from reademe.htm from {SRC_ROOT}/samples/testing/tomcat. This will in-effect run the htmlunit tests on the sample. The sample deployed on Tomcat instance will be ready this way and you can just point your browser to http://localhost:8080/sample-advanced-webapp/ to test further.
Alternatively, you can deploy the sample to your own configured Tomcat installation by following the instructions below.
These instructions assume that you have either :
<!-- Global Datasource for Derby ajaxdastest database --> <Resource name="jdbc/ajaxdastest" type="javax.sql.DataSource" auth="Container" description="Derby database for DAS Advanced sample" maxActive="100" maxIdle="30" maxWait="10000" username="" password="" driverClassName="org.apache.derby.jdbc.EmbeddedDriver" url="jdbc:derby:{absolute path}Databases/ajaxdastest;create=true"/>Requirement: You must include the absolute path to the Databases directory in the above url attribute.
<!-- Global Datasource for MySQL ajaxdastest database --> <Resource name="jdbc/ajaxdastest" type="javax.sql.DataSource" auth="Container" description="MySQL database for DAS Advanced sample" maxActive="100" maxIdle="30" maxWait="10000" username="dastest" password="dastest" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/ajaxdastest?createDatabaseIfNotExist=true"/>Requirement: MySQL service should be up with configured port open for TCPIP communication.
The design is modular and reusable by other web samples. There are java servlet, other java classes, jsp, javascript, xml, xsl, css and html files.
Used for menu/submenu rendering, is quite generic and can be used to display any menu.