portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Santiago Gala <sg...@hisitech.com>
Subject Re: UpdateAccount Save Password Bug Fix
Date Mon, 30 Apr 2001 22:52:46 GMT
Jon Stevens wrote:

> on 4/30/01 2:29 PM, "Turpin, Jay" <jay.turpin@intel.com> wrote:
> 
> 
>> Thanks for the additional information. However, maybe you can clear up some
>> confusion on our part. Why use:
>> 
>> data.getUser().setPerm( org.apache.turbine.om.security.User.FIRST_NAME,
>> firstname );
>> 
>> instead of:
>> 
>> data.getUser().setFirstName(firstname);
> 
> 
> Right, you suggest the right way to do things. However, in Jetspeed, the
> history is to pick the wrong way. :-)
> 
> 
>> Maybe this question comes from my general confusion about the design. Based
>> on reading the documentation about Peers on the Turbine web site, I thought
>> TurbineUserPeer is used for interacting with the underlying data repository,
>> in this case, the TURBINE_USER table in the database. However, in the code
>> below, it looks like it is being used as "User" object for the application.
> 
> 
> TurbineUser is the implementation of the User interface.
> 
> 
>> I have a difficult time understanding the purpose of many of the features in
>> the User interface, particularly get- and setPerm(). How do these functions
>> differ from using the accessor methods in the TurbineUser class?
> 
> 
> Repeat: The TurbineUser class is the default implementation of the User
> interface.
> 
> 
>> I think of the system working this way, please educate me if I am mistaken:
>> * The app should use the TurbineUserPeer class to fetch a TurbineUser object
> 
> 
> No! The app should use the TurbineSecurity class to fetch a User object.
> This object could be a TurbineUser object or any other object that
> implements the User interface. You should *never* directly reference a
> TurbineUser class...you should *always* use TurbineSecurity.
> 
> 
>> * Use the data in the TurbineUser object to populate a form and store
>> updates made by the user
> 
> 
> Potentially.
> 
> 
>> * If the data needs to be made permanent, create a Criteria object using the
>> data in TurbineUser and save it to the database using TurbineUserPeer
> 
> 
> Nope. User.save()
> 
> 

  [javac] 
/usr/share/jakarta/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/UpdateAccount.java:216:

Method save() not found in interface org.apache.turbine.om.security.User.
[javac]                 data.getUser().save();
[javac]                                    ^

I get this when trying this approach. I think TurbineUser.saveUser( 
data.getUser() ) should work.

Yes, Jon. I was never involved with this code until yesterday. Once I 
committed I noticed that everything was possibly wrong. I have the 
changes outlined here in my local copy, and was waiting for further 
testing to commit them.

The reason they are done this way is because this code is fairly old, 
and nobody has tracked the evolution of Turbine User system in this 
code. Moreover, the User interface is less than two months old, IIRC.

Now it is the moment to update this, and I will do soon.

Thanks for ensuring me that it will work this way.

>> Is this viewpoint correct? Or am I missing something?
> 
> 
> Close...what you are missing is the level of abstraction that Turbine
> provides over the User/Role/Permission system.
> 
> -jon



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message