Sorry, I must've missed your e-mail on the tapestry list.
Using the squeeze adapter is a matter of implementing the
two interfaces it requires. One is ObjectIdStorageProvider.
If you never use objects which are in state "NEW" in your pages,
then this interface is unimportant and you can have a "dummy"
implementation. Otherwise, what this interface is for is to
store (in memory) the (temporary) ObjectId object or a data object in
state NEW.
The other interface is the "DataContextProvider" (single method:
getValidDataContext()).
The purpose is to provide the squeezer with a "valid" d.c. for the current
thread.
Once you've implemented the interfaces...
If you're using tapestry 3.0.3, you'll have to subclass BaseEngine.
In your subclass, override createSqueezeAdapter with something like:
ISqueezeAdaptor[] adapters = {
new DataObjectAdaptor(new DataContextProviderImp(), new
ObjectIdStorageProviderImp())
};
return new DataSqueezer(getResourceResolver(), adapters);
If you're using tapestry 4.0.beta-xxx, then you can skip the subclassing
and just define the adapter in your hivemind config file.
There are many examples of how to do this posted throughout
the userlist archives, and I believe on the tapestry wiki, as well.
Robert
jaka lustek wrote:
>Hi,
>
>I posted similar question on Tapestry list, but did not get the answer
>so far. Can someone explain the steps to use CayenneDataSqueezer with
>Tapestry. I downloaded the squeezer from Tassel. I don't want to go
>statefull, is it possible to achieve this with CayenneSqueezer? I hope I
>am not asking silly questions.
>
>I have a tiny web app, just two pages, the first is collecting answers
>with radio group buttons, and the second is collecting user data. The
>model will use some three tables and some relationships. Simple model,
>simple web app, but as I am new to Cayenne Tapestry world I need some
>hints. I intend to present this app in my company as a proof of concept
>when will be ready (and this shold happen very soon).
>
>Thanks,
>Borut
>
>____________________
>http://www.email.si/
>
>
>
This archive was generated by hypermail 2.0.0 : Tue Oct 25 2005 - 08:59:14 EDT