Domain Objects
While generic data structures (such as components) are useful in certain situations, you often rather want to store your data in domain objects. The cool thing about Riot is that it allows you to manage this kind of data too.
This is done by defining forms via XML:
<form id="pet" bean-class="org.riotfamily.example.petstore.Pet">
<textfield bind="name" />
<media:image-upload bind="image" />
</form>
<textfield bind="name" />
<media:image-upload bind="image" />
</form>
Riot comes with a lot of predefined form elements, including select-boxes, radio-buttons, file uploads, richtext editors, color pickers, nested forms and nested lists, auto-complete fields and so on. You can of course also add your own custom elements. Riot also allows you to define lists in a similar way. You can control what columns should be displayed, how the list can be searched and filtered and what actions can be performed.
<list id="pets">
<dao class="org.riotfamily.riot.hibernate.dao.HqlDao">
<property name="entityClass" value="org.riotfamily.example.petstore.Pet"/>
</dao>
<columns>
<column property="name" />
<column property="image.variants[thumbnail]" />
<command id="edit" />
<command id="delete" />
</columns>
<command id="add" />
</list>
<dao class="org.riotfamily.riot.hibernate.dao.HqlDao">
<property name="entityClass" value="org.riotfamily.example.petstore.Pet"/>
</dao>
<columns>
<column property="name" />
<column property="image.variants[thumbnail]" />
<command id="edit" />
<command id="delete" />
</columns>
<command id="add" />
</list>