Author: rmannibucau
Date: Mon May 14 22:27:00 2012
New Revision: 1338461
URL: http://svn.apache.org/viewvc?rev=1338461&view=rev
Log:
TOMEE-191 adding readme
Added:
openejb/trunk/openejb/examples/realm-in-tomee/README.md
Added: openejb/trunk/openejb/examples/realm-in-tomee/README.md
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/examples/realm-in-tomee/README.md?rev=1338461&view=auto
==============================================================================
--- openejb/trunk/openejb/examples/realm-in-tomee/README.md (added)
+++ openejb/trunk/openejb/examples/realm-in-tomee/README.md Mon May 14 22:27:00
2012
@@ -0,0 +1,34 @@
+Title: DataSourceRealm and TomEE DataSource
+
+## Quick start
+
+To test it:
+
+ mvn clean package tomee:run
+
+## How does it work?
+
+A datasource is defined in tomee.xml:
+
+ <Resource id="myDataSource" type="DataSource" /> <!-- standard properties
-->
+
+Then this datasource is referenced in server.xml:
+
+ <Realm
+ className="org.apache.catalina.realm.DataSourceRealm"
+ dataSourceName="myDataSource"
+ userTable="users"
+ userNameCol="user_name"
+ userCredCol="user_pass"
+ userRoleTable="user_roles"
+ roleNameCol="role_name"/>
+
+To initialize the datasource (for the test) we used the TomEE hook which
consists in providing
+a file import-<datasource name>.sql. It should be in the classpath of the
datasource so here it is
+the TomEE classpath so we added it to lib (by default in the classloader). It
simply contains the
+table creations and the insertion of the "admin" "tomee" with the password
"tomee".
+
+## Test it
+
+Go to http://localhost:8080/realm-in-tomee-1.1-SNAPSHOT/, then connect using
+the login/password tomee/tomee. You should see "Home".