----- Original Message -----
From: "Jon Stevens" <[EMAIL PROTECTED]>
To: "jetspeed-dev" <[EMAIL PROTECTED]>
Sent: Friday, September 07, 2001 12:59 PM
Subject: Re: XML Database schema for DatabasePsmlManager Implementation


> on 9/7/01 10:24 AM, "Atul Dambalkar" <[EMAIL PROTECTED]> wrote:
>
> > I am getting little confused about "extending-user" and
"referencing-user
> > as a foreign key"...I guess, what we want to do here is just use
> > TURBINE_USER table as a foreign table and use it's USER_ID as foreign
> > key.  We don't want to override TURBIE_USER table with
JETSPEED_USER_PROFILE.
>
> Why not? Don't you want to simply extend Turbine's User/ACL system instead
> of inventing your own?
>

Its a one-to-many relationship. One user can have multiple profiles.
I believe that we don't want to extend the TURBINE_USER table, we need to
create a new table JETSPEED_USER_PROFILE,
which is related to the TURBINE_USER table on the primary key of
TURBINE_USER.
Perhaps there is another way to do this in Torque?

> > I have created new schema, please review it. I am a bit skeptical about
> > it's correctness, in using TURBINE_USER.USER_ID as foreign key... For
the
> > given schema, I generated Torque OR classes, and it also generated
classes
> > for TurbineUser, TurbineRole, TurbineGroup, which I don't think are
needed
> > as, I guess, I would be really using Turbine API TurbineUser/Role/Group
> > classes.
>
> You really need to look at the document I pointed out earlier as well as
> Scarab's way of doing things.
>

Could you be more specific.

>Look at Scarab and also read:
>    extend-user-howto.xml
> In the jakarta-turbine-2/xdocs/howto directory.

Looking at the link above, I believe Atul has the foreign key declarations
correct.
How is this done differently in Scarab?


> >  <table name="JETSPEED_GROUP_PROFILE">
> >
> >    <column name="PSML_ID" required="true" primaryKey="true"
type="INTEGER"/>
> >    <column name="GROUP_NAME" required="true" size="99" type="VARCHAR"/>
> >    <column name="MEDIA_TYPE" size="99" type="VARCHAR"/>
> >    <column name="LANGUAGE" size="2" type="VARCHAR"/>
> >    <column name="COUNTRY" size="2" type="VARCHAR"/>
> >    <column name="PAGE" size="99" type="VARCHAR"/>
> >    <column name="PROFILE" required="true" type="VARBINARY"/>
> >
> >    <foreign-key foreignTable="TURBINE_GROUP">
> >      <reference local="PSML_ID" foreign="GROUP_ID" />
> >    </foreign-key>
> >
> >    <index name="JETSPEED_GROUP_PROFILE_INDEX">
> >      <index-column name="GROUP_NAME" />
> >      <index-column name="MEDIA_TYPE" />
> >      <index-column name="LANGUAGE" />
> >      <index-column name="COUNTRY" />
> >      <index-column name="PAGE" />
> >    </index>
> >
> >  </table>
>
> What is the point of this table and its columns?

to store profiles for roles

>
> >  <table name="JETSPEED_ROLE_PROFILE">
> >
> >    <column name="PSML_ID" required="true" primaryKey="true"
type="INTEGER"/>
> >    <column name="ROLE_NAME" required="true" size="99" type="VARCHAR"/>
> >    <column name="MEDIA_TYPE" size="99" type="VARCHAR"/>
> >    <column name="LANGUAGE" size="2" type="VARCHAR"/>
> >    <column name="COUNTRY" size="2" type="VARCHAR"/>
> >    <column name="PAGE" size="99" type="VARCHAR"/>
> >    <column name="PROFILE" required="true" type="VARBINARY"/>
> >
> >    <foreign-key foreignTable="TURBINE_ROLE">
> >      <reference local="PSML_ID" foreign="ROLE_ID" />
> >    </foreign-key>
> >
> >    <index name="JETSPEED_ROLE_PROFILE_INDEX">
> >      <index-column name="ROLE_NAME" />
> >      <index-column name="MEDIA_TYPE" />
> >      <index-column name="LANGUAGE" />
> >      <index-column name="COUNTRY" />
> >      <index-column name="PAGE" />
> >    </index>
> >
> >  </table>
>
> What is the point of this table and its columns?

To store profiles for groups.

>
> Do you understand what a Group and what a Role/Permission is?

We have the concept of groups in Jetspeed, and we are using the TURBINE_GROU
P table to store the groups.
In the Turbine model, there is the USER_GROUP_ROLE table which holds the
relationship that a user is in a group under a given role.
Permissions are defined on a per role basic, defined in the
TURBINE_ROLE_PERMISSION table.
I haven't checked recently, but Ive heard that the GROUP table will be
renamed in the next version of Turbine.


>
> >  <table name="TURBINE_USER" alias="TurbineUser" >
> >
> >    <column name="USER_ID" primaryKey="true" required="true"
type="INTEGER"/>
> >
> >  </table>
> >
> >  <table name="TURBINE_ROLE" alias="TurbineRole" >
> >
> >    <column name="ROLE_ID" primaryKey="true" required="true"
type="INTEGER"/>
> >
> >  </table>
> >
> >  <table name="TURBINE_GROUP" alias="TurbineGroup" >
> >
> >    <column name="GROUP_ID" primaryKey="true" required="true"
type="INTEGER"/>
> >
> >  </table>
>
> Why are these defined here?
?
>
> > ====================================================================
> >
> > I couldn't find meaningful documentation about "alias" attribute. I just
> > figured out that if "alias" is used, then Torque doesn't generate SQL
for
> > creating database table. But it created TurbineUser/Role/Group classes
and
> > peer classes in the generated Java code, which made me think, as to why
are
> > those needed?
>
> You defined them, it is going to create them.
>
> -jon
>
>
> ---------------------------------------------------------------------
> 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