You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Pierre Henry <ph...@proconcept.ch> on 2002/11/21 16:13:15 UTC

Extending user

Hi!
I extended the JetspeedUser to MyUser with another table name and a new
field Title.
I already :
-generated the Peer classes with torque (with the JavaName param for the
table, so that I can keep the same class name)
-extended the JetspeedUser with MyUser and the BaseJetspeedUser with
MyUserImpl to add the getTitle and SetTitle methods
-changed the services.JetspeedSecurity.user.class parameter in all
JetspeedSecurity.* files to point to MyUserImpl

Now I try to use it in MyHelloUserPortlet. I filled the titles values in the
DB by hand. I do this to get the title :
MyUser user =(MyUser)rundata.getUser();
String title = user.getTitle();

but this returns me null for title.

>From what I have found, the key TITLE doesn't exist in user.perm .

The sql queries are done correctly (including TITLE) as registered in the
logs.

The problem seems to be that when the user object is constructed in
TurbineUserPeer.row2UserObject(...), it is done in a for loop :

   for( int i=0; i<columnNames.length; i++ )
   {
      put the value into the Hashtable with columnNames[j] as key
   }

but TITLE IS NOT IN columnNames.

I don't understand why, it should be since columnNames is initialized by

    private static Schema schema = initTableSchema(TABLE_NAME);
    private static com.workingdogs.village.Column[] columns = 
        initTableColumns(schema);
    public static String[] columnNames = initColumnNames(columns);

and TABLE_NAME is right and points to the new table, not the old one...

Somebody, an idea ? any help greatly apreciated !

Pierre

RE: Extending user

Posted by David Sean Taylor <da...@bluesunrise.com>.

> -----Original Message-----
> From: Pierre Henry [mailto:phenry@proconcept.ch]
> Sent: Thursday, November 21, 2002 7:13 AM
> To: Jetspeed User List (E-mail)
> Cc: James Somers
> Subject: Extending user
>
>
> Hi!
> I extended the JetspeedUser to MyUser with another table name and a new
> field Title.
> I already :
> -generated the Peer classes with torque (with the JavaName param for the
> table, so that I can keep the same class name)
> -extended the JetspeedUser with MyUser and the BaseJetspeedUser with
> MyUserImpl to add the getTitle and SetTitle methods
> -changed the services.JetspeedSecurity.user.class parameter in all
> JetspeedSecurity.* files to point to MyUserImpl
>

Sounds like you did everything right.
Could you send in your torque schema, MyUser, MyUserImpl files and I'll give
it a try here
Are you at the cvs head or 1.4b1?



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>