At 09:25 PM 9/4/01 -0700, you wrote:
>Hi Atul,
>
>At first, I thought there was a problem with "USER_ID" being the primary
>key.
>But it appears to be a ID field, which is misleading, since it had me
>thinking that it was the foreign key between the TURBINE_USER table and this
>table. I'd recommend a dependent relationship between TURBINE_USER and
>JETSPEED_USER_PROFILE (cascading deletes), which means adding another column
>for the foreign key - at that point you will have a column name conflict (i
>don't like naming common columns differently across tables), so maybe all of
>your primary keys could be called PSML_ID, which is also less confusing.
>Likewise for TURBINE_GROUP AND JETSPEED_GROUP_PROFILE, and TURBINE_ROLE and
>JETSPEED_ROLE_PROFILE.
>Questions I have are:
>- does Torque support cascading deletes?
>- all databases don't support cascading deletes. Will Torque compensate?
We had initially given a thought over making USER_ID/PSML_ID field as a
foreign key from TURBINE_USER table. But we had to decide against it, due
to couple of reasons, one cascading deletes are not supported by all the
databases and another we felt Turbine had to be changed to accommodate the
cascading deletes. Also, initially, Torque was not in the picture.
I went thro' org.apache.turbine.om.peer.BasePeer.java class which is
supposed to be the super class for all the peer classes generated by
Torque. Method "doDelete" in BasePeer class does support Cascading deletes,
if Criteria for delete is set like that. So Turbine code has to set the
delete as Cascade in Criteria object and then it will work fine (so may be
then we have to touch Turbine code as well). I am saying this by looking at
the BasePeer.java code. **Some one has to confirm this.***
My question is:
Once we decide to use TURBINE tables as foreign key tables for respective
tables in JETSPEED PSML, then,
do we have to chnage the XML Database schema file for TURBINE to include
all the Jetspeed Psml related Tables?
Basically, point is do we have to regenerate Torque/Peer classes for
Turbine? Or will TurbineMapBuilder figure that out, at run time, if all the
tables exist in same database?
>There should be some search keys defined. Taking the JETSPEED_USER_PROFILE,
>here are some common use cases :
>
>- lookup the PSML page for the current user + the current request
>parameters:
>LOGIN_NAME + MEDIA_TYPE + LANGUAGE + COUNTRY
>
>- lookup the PSML page by name for the current user + current request
>parameters:
>LOGIN_NAME + MEDIA_TYPE + LANGUAGE + COUNTRY + PAGE
>
>One index would handle both above:
>LOGIN_NAME + MEDIA_TYPE + LANGUAGE + COUNTRY + PAGE
>
>Another case I can think of is find all PSML for the given user, sometimes
>restricted by media type.
>Again, the above index covers that.
Yes, makes sense to index all those columns.
>I believe country codes and language codes are always 2 characters wide, but
>definately not these two:
I am changing Country and Language to 2 characters.
> > <column name="MEDIA_TYPE" size="99" type="VARCHAR"/>
> > <column name="PAGE" size="99" type="VARCHAR"/>
Yes.
>Im not very familiar with Torque anymore, but the "99" looks very numeric
>too me, esp. for fields like media_type and page, which would normally
>contain strings. If you are restricting the COUNTRY and LANGUAGE to numeric,
No, they are VARCHARs.
-Atul
>then thats a problem too. Guess I need to re-readup on Torque,
>
>David
>
>
>
> > -----Original Message-----
> > From: Atul Dambalkar [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, September 04, 2001 2:15 PM
> > To: [EMAIL PROTECTED]
> > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED];
> > [EMAIL PROTECTED]
> > Subject: XML Database schema for DatabasePsmlManager Implementation
> >
> >
> > Hi Jon, David,
> >
> > Here is the XML Database schema for putting PSML information
> > along with
> > user/role/group profile. Please review it.
> > =======================================================
> > <app-data>
> >
> > <database defaultIdMethod="idbroker"
> > basePeer="org.apache.turbine.om.peer.BasePeer" >
> >
> > <table name="JETSPEED_USER_PROFILE" idMethod="idbroker">
> >
> > <column name="USER_ID" required="true" autoIncrement="true"
> > primaryKey="true" type="INTEGER"/>
> > <column name="LOGIN_NAME" required="true" size="32"
> > type="VARCHAR"/>
> > <column name="MEDIA_TYPE" size="99" type="VARCHAR"/>
> > <column name="LANGUAGE" size="99" type="VARCHAR"/>
> > <column name="COUNTRY" size="99" type="VARCHAR"/>
> > <column name="PAGE" size="99" type="VARCHAR"/>
> > <column name="PROFILE" type="VARBINARY"/>
> >
> > <unique>
> > <unique-column name="LOGIN_NAME" />
> > </unique>
> >
> > </table>
> >
> > <table name="JETSPEED_GROUP_PROFILE" idMethod="idbroker">
> >
> > <column name="GROUP_ID" required="true" autoIncrement="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="99" type="VARCHAR"/>
> > <column name="COUNTRY" size="99" type="VARCHAR"/>
> > <column name="PAGE" size="99" type="VARCHAR"/>
> > <column name="PROFILE" type="VARBINARY"/>
> > <unique>
> > <unique-column name="GROUP_NAME" />
> > </unique>
> >
> > </table>
> >
> > <table name="JETSPEED_ROLE_PROFILE" idMethod="idbroker">
> >
> > <column name="ROLE_ID" required="true" autoIncrement="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="99" type="VARCHAR"/>
> > <column name="COUNTRY" size="99" type="VARCHAR"/>
> > <column name="PAGE" size="99" type="VARCHAR"/>
> > <column name="PROFILE" type="VARBINARY"/>
> >
> > <unique>
> > <unique-column name="ROLE_NAME" />
> > </unique>
> >
> > </table>
> >
> > </database>
> > ===============================================================
> >
> > I could generate all the peer classes, but "torque" fails if
> > I try to use
> > "native" as idMethod. So I have to use "idbroker".
> >
> > Questions:
> > 1. The generated package name, I decided as:
> > "org.apache.jetspeed.om.dbpsml" Is that okay?
> > 2. The basePeer for generated peer classes is
> > org.apache.turbine.om.peer.BasePeer. Hope that's correct...
> >
> > Also, how could we automate the process of generating
> > database specific
> > peer classes, when some one decides to use it for let's say
> > MSSQL? Right
> > now I am trying it with Oracle.. Currently I have generated
> > all the peer
> > classes with stand-alone version of Torque and manually
> > copied them under
> > Jetspeed cources, and got all compiled.
> >
> > Christopher, now, you don't have to define a separate schema
> > in MSSQL, the
> > above Torque schema will handle all the different database cases.
> >
> > -Atul
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]