Perfect sense. I clearly misunderstood the problem that you were describing.
> -----Original Message----- > From: Ivan [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 16, 2002 11:42 AM > To: Turbine Developers List > Subject: RE: Extending(?) Turbine User > > > "Extending" is not the problem, Quinton. The problem is when > one wants to use a *different* column name for one of the > basic columns. > > Example: In the database, suppose the user's username is > stored in a column called MEMBERNAME (and you're not allowed > to change it or use a view). You write an xTurbineMapBuilder > so that getUsername returns MEMBERNAME. Now you retrieve a > user from the db and xTurbineUserPeer.populateObject stuffs > the user's username into PermStorage under the key > MEMBERNAME. So far, so good. > > Now, the authenticate sequence calls accountExists(userobj), > which calls user.getUserName. TurbineUser.getUserName looks > in perm storage for the key "User.USERNAME". Oops. > User.USERNAME is public static final. Can't be changed. > > And it gets worse. All the User class get methods for the > basic columns like email, lastname, firstname, etc. are hard > coded to public static finals. So you can't conveniently > change the name of any of the core columns. If you try, your > perm storage will have no correlation with your database > table. (Unless you want to rewrite the whole TurbineUser > class - but that's no fun!) > > What I propose here is that TurbineUser ignore the public > static finals. Instead, I think we can get the current > MapBuilder from the TR props and use the real database column > names for all the core info stored in the perm storage. > > Make sense? > Ivan > > > > > ------------------------------------------ > On Mon, 16 Dec 2002, Quinton McCombs wrote: > > > You can change the column and table names. Take a look at > > org.apache.turbine.util.db.map.TurbineMapBuilder. That > class defines > > the table and column names used for the TURBINE_* tables. > > > > I have updated the howto for extending TurbineUser for T2.2. It is > > not quite ready to be put on the jakarta site though as it is still > > being reviewed. However, you might want to take a look at it. The > > URL (for the preview version) is > > http://blaze.qdog.org/preview/howto/extend-user-howto.html. > > > > -----Original Message----- > > From: Ivan Saltz [mailto:[EMAIL PROTECTED]] > > Sent: Monday, December 16, 2002 8:47 AM > > To: Turbine Developers List > > Subject: Extending(?) Turbine User > > > > > > We have a legacy table with users and lots of legacy > software that we > > don't want to change. We wanted to use the Turbine security scheme > > with a minimum amount of effort. Ergo, we wrote a custom > mapbuilder > > and peer class but apparently the base column names are > hard-coded in > > the TurbineUser class. Therefore, we can't _extend_ TurbineUser to > > make our own xTurbineUser class. > > > > So it looks as though our choices are: 1) Write an > xTurbineUser from > > scratch. 2) Fix TurbineUser so that it reads the TurbineMapBuilder > > for the column names. (The map builder class is already > set in the TR > > props file, so why not?) > > > > First question: Am I correct in assuming that one cannot easily > > change the column names? > > > > Second question: Would the project want a patch that makes > the column > > names dynamic? > > > > Third question: (If answer to 2 is yes,) Should I do this from > > rel-2.2-b3? > > > > Ivan > > > > > > -- > > To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > > -- > > To unsubscribe, e-mail: > <mailto:turbine-dev-> [EMAIL PROTECTED]> > > For > additional commands, > e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > > -- > To unsubscribe, e-mail: > <mailto:turbine-dev-> [EMAIL PROTECTED]> > For > additional commands, > e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
