Introduction
The Tapestry5-Cayenne Integration Module is a Tapestry-IoC module that makes using Cayenne data objects in your Tapestry projects as simple as possible. It is very similar in scope to the Tapestry-Hibernate module.
Current Status
The integration module is admittedly in a very nascent state. It has, however, been used in production systems. The developers use the module on critical Web applications within their organizations. The project is available as open source software under the Apache Software License v2.
We will update this page as the module matures.
Features
- ObjectContext creation and binding to Application State Object for easy context retrieval
- ObjectContext may be obtained in one of several ways:
- Inject ObjectContextProvider service
- Pages and components may directly @Inject ObjectContext, optional using the OCType annotation to influence the creation of the context
- Can also use the @ApplicationState annotation to obtain a reference to the thread-bound context.
- ValueEncoder for all Persistent objects
- This should "just work": put a persistent entity into a page, action, or event link "context" and get it back in onActivate or event handlers.
- BeanModelSource implementation to hide Cayenne's "non-editable" fields
- This should also "just work": The t5cayenne BeanModelSource is aliased to BeanModelSource, so all of tapestry's built-in components will use it.
- Pluggable ID encoding strategies for URL generation in order to prevent data tampering
- Editors and viewers for Persistent objects, allowing Persistent objects to be used in BeanEditor and BeanDisplay with no effort
- toOne relationships can be both viewed and edited
- toMany relationships can be viewed
- Rich components and supporting services for making working with Persistent objects as simple as possible
- ValidationConstraint generator for auto-generating field constraints based on mapping data
- Required fields
- Max-length of text-based fields
- Auto-detection of "long" text-based fields so BeanEditor will use a textarea instead of a textfield component
- Bindings and coercions for using queries or even just object entity names as a GridDataSource
Additional Information
The module is available in two flavors, matching the two Cayenne flavors available: server (classic mode) and client (used for Remote Object Persistence). The feature set between the two is comparable with only minor differences as Cayenne mandates.