f | # Getting Started | f | # Getting Started |
| | | |
| Please see the GettingStarted guide for step-by-st | | Please see the GettingStarted guide for step-by-st |
| ep instructions on how to download, compile and co | | ep instructions on how to download, compile and co |
| nfigure Sphene's Hibernate Autoadmin for the \Auto | | nfigure Sphene's Hibernate Autoadmin for the \Auto |
| adminTest example mapping. | | adminTest example mapping. |
| | | |
t | | t | # Usage
|
| | |
|
| | | The easiest usage is probably to simply download ( |
| | | see [Downloads] - the project \HibernateAutoadmin) |
| | | the sources (since there is no release yet) chang |
| | | e into the directory 'meta' and run:
|
| | |
|
| | | ant dist
|
| | |
|
| | | This will result in a \HibernateAutoadmin.war file |
| | | which is ready to be deployed. After deployment y |
| | | ou should add your hibernate configuration file to |
| | | the classpath (probably WEB-INF/lib) as well as y |
| | | our mapping classes. (And all dependencies - like |
| | | JDBC drivers & co)
|
| | |
|
| | | Afterwards you have to tell Sphene's Hibernate Aut |
| | | oadmin where in the classpath to find the hibernat |
| | | e.cfg.xml file - to do so set the java environment |
| | | variable net.sphene.hibernate.cfg
|
| | |
|
| | | If anything is unclear please see the GettingStart |
| | | ed guide which explains most things in greater det |
| | | ails, or visit the [Forums](http://hibernate.sphen |
| | | e.net/board/show/0/) and post your problems.
|
| | |
|
| | |
|
| | | # Meta properties
|
| | |
|
| | | Sometimes the mapping information alone is not eno |
| | | ugh to create some kind of useful admin interface. |
| | | Therefore Sphene's Hibernate Autoadmin introduces |
| | | a few meta properties which can be set for class |
| | | mappings.
|
| | |
|
| | | For example let's take a look at the Poll mapping |
| | | file (contained in the '\AutoAdminTest' SVN reposi |
| | | tory):
|
| | |
|
| | | <class name="Poll" table="poll">
|
| | | <meta attribute="admin.toString">q |
| | | uestion + " (" + id + ")"</meta>
|
| | | <id name="id" type="long">
|
| | | <generator class="native" |
| | | />
|
| | | </id>
|
| | |
|
| | | <property name="question" type="st |
| | | ring" />
|
| | | <property name="description" type= |
| | | "text" />
|
| | | <property name="pubdate" type="dat |
| | | e" />
|
| | | </class>
|
| | |
|
| | | This uses the meta attribute 'admin.toString' to d |
| | | efine a [OGNL](http://www.opensymphony.com/ognl/) |
| | | expression which is evaluated to be displayed as a |
| | | string representation of the object (e.g. for man |
| | | y-to-one relation ships) - If this is not defined |
| | | it will simply call the 'toString()' method of the |
| | | object.
|