Sphene's Hibernate Autoadmin

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools

Documentation

Documentation

Back to Snip <-- Previous Change

Diff Summary
Title
Date 2007-04-30 23:51:45 2007-05-01 00:04:55
Editor Herbert Poul Herbert Poul
Tags

2007-04-30 23:51:45 by Herbert Poul
2007-05-01 00:04:55 by Herbert Poul
f1# Getting Startedf1# Getting Started
22
3Please see the GettingStarted guide for step-by-st3Please 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.
44
tt5# Usage
6
7The 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:
8
9    ant dist
10
11This 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)
12
13Afterwards 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
14
15If 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.
16
17
18# Meta properties
19
20Sometimes 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.
21
22For example let's take a look at the Poll mapping 
 >file (contained in the '\AutoAdminTest' SVN reposi
 >tory):
23
24        <class name="Poll" table="poll">
25                <meta attribute="admin.toString">q
 >uestion + " (" + id + ")"</meta>
26                <id name="id" type="long">
27                        <generator class="native" 
 >/>
28                </id>
29                
30                <property name="question" type="st
 >ring" />
31                <property name="description" type=
 >"text" />
32                <property name="pubdate" type="dat
 >e" />
33        </class>
34
35This 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.


Powered by Sphene Community Tools