BaseJetspeedUser has a Hashtable to store fields that would go to/from
permanent storage. You should get set values there (using the
getPerm/setPerm method) in order your values to go to the DB.
For example, what we do is:
(In the extended user middle initial is a new name)

 public void setMiddleInitial(String initial) {
  initial = initial.trim();
  setPerm("MIDDLE_INITIAL", initial);
 }
 public String getMiddleInitial(){
  return (String) getPerm ("MIDDLE_INITIAL");
 }

(I think the key is the name of the column.)


----- Original Message -----
From: "Amin Lalji" <[EMAIL PROTECTED]>
To: "'Jetspeed Users List'" <[EMAIL PROTECTED]>
Sent: Thursday, June 26, 2003 5:51 PM
Subject: Extending User... some thoughts...


> Hello All,
>
> I recently posted a question regarding Extending JetspeedUser and
> CreateNewUserAnd Confirm...
>
> After some further research, here is my dilemma:
>
> I have modified the torque security-schema.xml to add my new columns
> I have generated OM objects to org.apache.jetspeed.om.security.turbine
> (default)
> I have updated my tables with newly created ddl's...
>
> The docs (http://jakarta.apache.org/jetspeed/site/security.html) say to
> extend JetspeedUser and cast to access additional columns...
>
> Here is the dilemma... JetspeedUser is located in
> org.apache.jetspeed.om.security... the object model that contains
> entries for the modified schema is
> org.apache.jetspeed.om.security.turbine.TurbineUser (and
> BaseTurbineUser) .... so if I cast JetspeedUser to MyJetspeedUser, set
> MyJetspeedUser.title = "mr." and then call MyJetspeedUser.save() ....
> the entry in the database is null, because the parent (JetspeedUser)
> object model does not contain any reference to the modified field!! (the
> reference is in TurbineUser)...
>
> Tried casting JetspeedUser to TurbineUser ... resulted in class cast
> exception ...
>
> Not quite sure where to go from here...
>
>
>
> -----Original Message-----
> From: Amin Lalji [mailto:[EMAIL PROTECTED]
> Sent: June 25, 2003 4:54 PM
> To: [EMAIL PROTECTED]
> Subject: Extending User and CreateNewUserAndConfirm.java
>
> Hello All,
>
>
>
> I have been struggling with trying to extend JetspeedUser:
>
>
>
> I have:
>
>
>
> 1)       modified torque-schema.xml
>
> 2)       generated new OM/SQL Scripts
>
> 3)       Updated database with new schemas
>
> 4)       Extended BaseJetspeedUser (MyJetspeedUser.class)
>
>
>
> --- SO FAR SO GOOD, EVERYTHING CONTINUES TO OPERATE AS NORMAL ---
>
>
>
> 5)       Within the createUser method of CreateNewUserAndConfirm I have
>
>
>
>   MyJetspeedUser myJetspeedUser = (MyJetspeedUser) user;
>
>         myJetspeedUser.setTitle("MR."); // trying to force MR. entry
> into db
>
>
>
>                   --> Tried: data.setUser(myJetspeedUser);
>
>                   --> Result after trying to add a new user using
> "create account link", account created, TITLE field in database NULL!
>
>
>
>                   -->Tried: myJetspeedUser.save();
>
>                   --> Result after trying to add a new user using
> "create account link", exception, user already exists..
>
>
>
> I would like clarification on the process to add additional fields to
> TURBINE_USER / new account creation:
>
>
>
> Do I have to replace the user object (currently JetspeedUser) with
> MyJetspeedUser entirely? It seems to defeat the purpose of subclassing.
>
>
>
>
>
> Your help is greatly appreciated!
>
>
>
> Amin
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to