You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Glen Stampoultzis <gs...@iinet.net.au> on 2003/10/29 02:14:02 UTC
Tapestry-Hibernate Integration
I just had an idea and was wondering whether anyone though it might be
feasible.
Would it be possible to create hibernate aware versions of some of the
components. For example a HibernateTextField that would lookup the type
information and the max length details and automatically limit what the
user could enter. Or a HibernateSelect component that could lookup the
one-to-many relationship automatically?
Regards,
Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry-Hibernate Integration
Posted by Glen Stampoultzis <gs...@iinet.net.au>.
Sounds like you put together a nice little system.
I'm thinking of this from the point of view of avoiding silly bugs not just
any labor saving advantages (or lack of). One thing I'm trying to avoid is
the situation where a change is made in the database (say a field becomes
mandatory or the length changes) and then the developer forgets to update
the details in the UI.
Anyway it sounds like it should be doable. I'm still coming up to speed
with the framework so I'm not sure if I want to plunge ahead and actually
try to do it yet.
Regards,
Glen
At 01:49 PM 29/10/2003, you wrote:
>Here's my two cents worth.... I haven't tried Hibernate but we did a
>similar thing with our old WebObjects components. We have a
>ValidationTextField, ValidationText, and a ValidationPopUpButton (what
>Tapestry would call a Select).
>
>The components automatically set their background color to beige to
>indicate a required item, one marked mandatory in the data model. I
>assume Hibernate allows programmatic querying of such metadata. They
>also would set the color to intense red after the submit, to indicate an
>erroneous or missing entry. (Yes, a developer selected the colors.)
>
>We didn't bother trying to set the maxLength automatically from the
>model. Perhaps because we started with a legacy database with some
>rather generous field lengths (lots of 255s and 4000s). It could
>certainly be done.
>
>Our users seem to like the features, but I wouldn't say they were a huge
>labor saver for the developers. The components ended up taking a rather
>large set of bindings, such as the entity and field names in the model
>and whether to override the colors when the model-derived color wasn't
>appropriate. By the time we added some other features, our simple
>TextField ended up with 23 bindings.
>
>Looking back on it, some of the other features were pretty cool. (I can
>say that without humility because I wasn't the one who added them.)
>
>- AutoExpandCurrency, if enabled, decorated the number with a dollar
>sign and commas when the user left the text field.
>- CheckSpelling did just that on a field-by-field basis.
>- ExpansionDictionaryName allowed a user to enter shorthand like "4y"
>that got expanded to "4 Years".
>- HelpString supplied a tool-tip.
>
>Gotta love reusable components! Pretty soon we'll be re-implementing
>all that in Tapestry. (Where "pretty soon" means next year after the
>executives quit thinking of features to add to the old apps. If all
>those customers would only go away... :-)
>
>
>----- Original Message -----
>From: "Glen Stampoultzis" <gs...@iinet.net.au>
>To: <ta...@jakarta.apache.org>
>Sent: Tuesday, October 28, 2003 8:14 PM
>Subject: Tapestry-Hibernate Integration
>
>
> >
> > I just had an idea and was wondering whether anyone though it might be
> > feasible.
> >
> > Would it be possible to create hibernate aware versions of some of the
> > components. For example a HibernateTextField that would lookup the
>type
> > information and the max length details and automatically limit what
>the
> > user could enter. Or a HibernateSelect component that could lookup
>the
> > one-to-many relationship automatically?
> >
> > Regards,
> >
> >
> > Glen Stampoultzis
> > gstamp@iinet.net.au
> > http://members.iinet.net.au/~gstamp/glen/
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/
Re: Tapestry-Hibernate Integration
Posted by Bryan Lewis <br...@maine.rr.com>.
Here's my two cents worth.... I haven't tried Hibernate but we did a
similar thing with our old WebObjects components. We have a
ValidationTextField, ValidationText, and a ValidationPopUpButton (what
Tapestry would call a Select).
The components automatically set their background color to beige to
indicate a required item, one marked mandatory in the data model. I
assume Hibernate allows programmatic querying of such metadata. They
also would set the color to intense red after the submit, to indicate an
erroneous or missing entry. (Yes, a developer selected the colors.)
We didn't bother trying to set the maxLength automatically from the
model. Perhaps because we started with a legacy database with some
rather generous field lengths (lots of 255s and 4000s). It could
certainly be done.
Our users seem to like the features, but I wouldn't say they were a huge
labor saver for the developers. The components ended up taking a rather
large set of bindings, such as the entity and field names in the model
and whether to override the colors when the model-derived color wasn't
appropriate. By the time we added some other features, our simple
TextField ended up with 23 bindings.
Looking back on it, some of the other features were pretty cool. (I can
say that without humility because I wasn't the one who added them.)
- AutoExpandCurrency, if enabled, decorated the number with a dollar
sign and commas when the user left the text field.
- CheckSpelling did just that on a field-by-field basis.
- ExpansionDictionaryName allowed a user to enter shorthand like "4y"
that got expanded to "4 Years".
- HelpString supplied a tool-tip.
Gotta love reusable components! Pretty soon we'll be re-implementing
all that in Tapestry. (Where "pretty soon" means next year after the
executives quit thinking of features to add to the old apps. If all
those customers would only go away... :-)
----- Original Message -----
From: "Glen Stampoultzis" <gs...@iinet.net.au>
To: <ta...@jakarta.apache.org>
Sent: Tuesday, October 28, 2003 8:14 PM
Subject: Tapestry-Hibernate Integration
>
> I just had an idea and was wondering whether anyone though it might be
> feasible.
>
> Would it be possible to create hibernate aware versions of some of the
> components. For example a HibernateTextField that would lookup the
type
> information and the max length details and automatically limit what
the
> user could enter. Or a HibernateSelect component that could lookup
the
> one-to-many relationship automatically?
>
> Regards,
>
>
> Glen Stampoultzis
> gstamp@iinet.net.au
> http://members.iinet.net.au/~gstamp/glen/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry-Hibernate Integration
Posted by Marilen Corciovei <le...@nemesisit.rdsnet.ro>.
After some reflection here is an addition to my last mail. I think that
beside each component integration with hibernate there is the need for
some global integration at page level since you do not want for instance
that each component save it's content if there are 4 other on the same
page which show data for the same entity since it whould result in an
unoptimized database access (5 sql's instead of 1). That is why I
mentioned the add, update and detail page which I thought are
representative for entity manipulation. On the top there is also a
Hibernate aware page (HPage) which uses the Global object to store the
HibernateFactory. In this way I could use only one session per page and
let the the detach of the HPage take care of closing it (obs: of course
you do not want the session to end up serialized). A different approach
I took with the ListPage since due to the complexity of the table and
the need to use more than 1 table in some occasions. So I encapsulated
all the needed functionality in the HTable component of course with the
posibility of addding other things such as another select button. For
the table the easy part was the model since pagging and sorting are easy
done with hibernate (note: did not loaded all data and sorted/pagged in
memory) and the hard part was giving a user friendly look with
selection, actions etc.
A third thing was the User module also integrated with hibernate and
with acces roles per application page but on this subject there are a
lot of other approaches.
Len
On Wed, 2003-10-29 at 03:14, Glen Stampoultzis wrote:
> I just had an idea and was wondering whether anyone though it might be
> feasible.
>
> Would it be possible to create hibernate aware versions of some of the
> components. For example a HibernateTextField that would lookup the type
> information and the max length details and automatically limit what the
> user could enter. Or a HibernateSelect component that could lookup the
> one-to-many relationship automatically?
>
> Regards,
>
>
> Glen Stampoultzis
> gstamp@iinet.net.au
> http://members.iinet.net.au/~gstamp/glen/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
Re: Tapestry-Hibernate Integration
Posted by Marilen Corciovei <le...@nemesisit.rdsnet.ro>.
On Wed, 2003-10-29 at 09:50, Glen Stampoultzis wrote:
> Look like you've done some good work there. Not exactly what I had in mind
> but definitely useful and probably a big time saver.
Thanks, indeed. Just hope I'll have all the projects to justify the work :)
> I'm assuming here after you've got your model specified you do a one way
> generate then customize the results by hand?
Yes, partialy. There are 2 aspects:
- I realized that tapestry makes very easy to add some extra to a
generated page with all the code elsewhere in a component so the
generator allows for some things to be regenerated without loss of work.
- for more complicated pages of course you can not regenerate.
You know what? I can provide you with temporary access to a more
customized results than those screenshots, which where only generated,
if you are interested.
Len
> Regards,
>
> Glen
>
> At 04:38 PM 29/10/2003, you wrote:
> >Hi,
> >
> >I have been working on something like that for the last few months but
> >with a somehow different approach. Starting with an UML model I generate
> >both the hibernate part and basic Tapestry parts. For example a take an
> >UML class with attributes this results in a coresponding hibernate table
> >and the add, update and list pages with Tapestry. For an attribute
> >depending on it's type I create a valid field, valid area, date picker,
> >select etc.
> >For this to work I needed a lot of hibernate aware components for
> >instance a OneToMultiLink which is generated for a detail page of a
> >class if a one to multi relation exists or is inserted in the table.
> >Since yes, the table is the most complicated part. I am not very proud
> >of my current table implementation but it can represent the paginated
> >results of a query, basic selection, add, delete, detail buttons and the
> >posibility to add new ops.
> >
> >Here are some links: http://nemesisit.rdsnet.ro/opendocs/mda/ (the
> >idea), http://nemesisit.rdsnet.ro/len/autoSmart/,
> >http://nemesisit.rdsnet.ro/len/erpagenda/ (first 2 apps).
> >
> >I can give you more details if interested.
> >
> >Len
> >
> >On Wed, 2003-10-29 at 03:14, Glen Stampoultzis wrote:
> >
> > > I just had an idea and was wondering whether anyone though it might be
> > > feasible.
> > >
> > > Would it be possible to create hibernate aware versions of some of the
> > > components. For example a HibernateTextField that would lookup the type
> > > information and the max length details and automatically limit what the
> > > user could enter. Or a HibernateSelect component that could lookup the
> > > one-to-many relationship automatically?
> > >
> > > Regards,
> > >
> > >
> > > Glen Stampoultzis
> > > gstamp@iinet.net.au
> > > http://members.iinet.net.au/~gstamp/glen/
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >
> > >
>
>
> Glen Stampoultzis
> gstamp@iinet.net.au
> http://members.iinet.net.au/~gstamp/glen/
Re: Tapestry-Hibernate Integration
Posted by Glen Stampoultzis <gs...@iinet.net.au>.
Look like you've done some good work there. Not exactly what I had in mind
but definitely useful and probably a big time saver.
I'm assuming here after you've got your model specified you do a one way
generate then customize the results by hand?
Regards,
Glen
At 04:38 PM 29/10/2003, you wrote:
>Hi,
>
>I have been working on something like that for the last few months but
>with a somehow different approach. Starting with an UML model I generate
>both the hibernate part and basic Tapestry parts. For example a take an
>UML class with attributes this results in a coresponding hibernate table
>and the add, update and list pages with Tapestry. For an attribute
>depending on it's type I create a valid field, valid area, date picker,
>select etc.
>For this to work I needed a lot of hibernate aware components for
>instance a OneToMultiLink which is generated for a detail page of a
>class if a one to multi relation exists or is inserted in the table.
>Since yes, the table is the most complicated part. I am not very proud
>of my current table implementation but it can represent the paginated
>results of a query, basic selection, add, delete, detail buttons and the
>posibility to add new ops.
>
>Here are some links: http://nemesisit.rdsnet.ro/opendocs/mda/ (the
>idea), http://nemesisit.rdsnet.ro/len/autoSmart/,
>http://nemesisit.rdsnet.ro/len/erpagenda/ (first 2 apps).
>
>I can give you more details if interested.
>
>Len
>
>On Wed, 2003-10-29 at 03:14, Glen Stampoultzis wrote:
>
> > I just had an idea and was wondering whether anyone though it might be
> > feasible.
> >
> > Would it be possible to create hibernate aware versions of some of the
> > components. For example a HibernateTextField that would lookup the type
> > information and the max length details and automatically limit what the
> > user could enter. Or a HibernateSelect component that could lookup the
> > one-to-many relationship automatically?
> >
> > Regards,
> >
> >
> > Glen Stampoultzis
> > gstamp@iinet.net.au
> > http://members.iinet.net.au/~gstamp/glen/
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/
Re: Tapestry-Hibernate Integration
Posted by Marilen Corciovei <le...@nemesisit.rdsnet.ro>.
Hi,
I have been working on something like that for the last few months but
with a somehow different approach. Starting with an UML model I generate
both the hibernate part and basic Tapestry parts. For example a take an
UML class with attributes this results in a coresponding hibernate table
and the add, update and list pages with Tapestry. For an attribute
depending on it's type I create a valid field, valid area, date picker,
select etc.
For this to work I needed a lot of hibernate aware components for
instance a OneToMultiLink which is generated for a detail page of a
class if a one to multi relation exists or is inserted in the table.
Since yes, the table is the most complicated part. I am not very proud
of my current table implementation but it can represent the paginated
results of a query, basic selection, add, delete, detail buttons and the
posibility to add new ops.
Here are some links: http://nemesisit.rdsnet.ro/opendocs/mda/ (the
idea), http://nemesisit.rdsnet.ro/len/autoSmart/,
http://nemesisit.rdsnet.ro/len/erpagenda/ (first 2 apps).
I can give you more details if interested.
Len
On Wed, 2003-10-29 at 03:14, Glen Stampoultzis wrote:
> I just had an idea and was wondering whether anyone though it might be
> feasible.
>
> Would it be possible to create hibernate aware versions of some of the
> components. For example a HibernateTextField that would lookup the type
> information and the max length details and automatically limit what the
> user could enter. Or a HibernateSelect component that could lookup the
> one-to-many relationship automatically?
>
> Regards,
>
>
> Glen Stampoultzis
> gstamp@iinet.net.au
> http://members.iinet.net.au/~gstamp/glen/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>