You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Scott Eade <se...@backstagetech.com.au> on 2002/01/04 12:35:30 UTC
How to extend TURBINE_USER - a solution to the documented problem
About a month ago I revisited the work I did earlier on
extending turbine_user. My goal was to overcome the
problem I had identified and documented about 3/4 of
the way down the extend-user-howto under the heading
"Additional Information (Added 12 Nov 2001)". To
summarise, after going through all of the effort to extend
turbine_user, the implementation is incomplete because
user.save() fails to save any related objects you may have
added using the generated user.addXXX() methods.
By making some small changes to torque's Object.vm
template it is possible to have the code necessary to
save the related objects generated in the OM class
for the turbine_user alias. This solution is reasonably
small and it works well (I am using it in a production
site).
The only trouble with this solution is that it seems a
bit like a hack because it mixes non-turbine security
objects with turbine security objects - you can include
the user.save() in a transaction, but the saving of the
actual turbine_user record will not be part of the
transaction because the turbine db security
implementation does not allow for this.
Anyway, I have a solution that works. My question
is, should I submit a patch to Object.vm that could
be considered to be a hack or should I just outline the
hack in a patch to extend-user-howto so that interested
users can apply the patch themselves?
BTW: Anyone that has extended turbine_user will love
this change. With it you can use data.getUser() just
like any other OM class (after casting it to your alias
class).
Any thoughts?
Scott
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>