Hi guys,
I am posting this here to capture any response on the mail archives.
I know that the security management has been moved to the
fulcrum-security service for Turbine 4.0 and I am digging deep into
learning how this works versus the old way in Turbine 2.3.x
Georg or Thomas, do you have any advice on how to migrate my extended
user classes to continue to work in Turbine 4.0? I only have a few
additional fields, but I really depend heavily on linking the primary
key from my custom user table into other tables within my Turbine
application.
If it is possible to do the foreign key maps for the default
TURBINE_USER in an easy way, I would be happy to just create an
additional table to store all the old "extended info" but I like the way
torque handles the foreign key enforcement.
Here is an example of my app's customer user and a logging table for
transactions. How would I do this now using Turbine 4.0? Thanks for any
advice or pointers to where this might already be documented.
I was used to doing the following and it worked nicely through turbine
2.3.3.
ExtendedUser eu = (ExtendedUser) data.getUser();
MyappUser user = (MyappUser) eu.getPersistentObj();
// Log the event
EventLog eLog = new EventLog();
eLog.setMyappUser(user);
eLog.setTransactionType(25);
eLog.setMessage("Updated vendor access to file");
eLog.setTxDate(new Date());
eLog.setNew(true);
eLog.save();
In my torque application schema XML I had....
<!-- extend the base user -->
<table name="MYAPP_USER" idMethod="native">
<!-- default turbine/torque user fields :: DO NOT CHANGE -->
<column name="USER_ID" required="true" primaryKey="true"
type="INTEGER"/>
<column name="LOGIN_NAME" required="true" size="64" type="VARCHAR"
javaName="UserName"/>
<column name="PASSWORD_VALUE" required="true" size="64"
type="VARCHAR" javaName="Password"/>
<column name="FIRST_NAME" required="true" size="64" type="VARCHAR"/>
<column name="LAST_NAME" required="true" size="64" type="VARCHAR"/>
<column name="EMAIL" size="64" type="VARCHAR"/>
<column name="PHONE" size="64" type="VARCHAR"/>
<column name="CONFIRM_VALUE" size="128" type="VARCHAR"
javaName="Confirmed"/>
<column name="MODIFIED" type="TIMESTAMP" javaName="ModifiedDate"/>
<column name="CREATED" type="TIMESTAMP" javaName="CreateDate"/>
<column name="LAST_LOGIN" type="TIMESTAMP"/>
<column name="OBJECTDATA" type="VARBINARY"/>
<!-- custom fields -->
<column name="VENDOR" type="BOOLEANINT" default="0"/>
<column name="ENABLED" type="BOOLEANINT" default="1"
javaName="Enabled"/>
<column name="LOGIN_ATTEMPT" type="INTEGER" default="1"
javaName="LoginAttempts"/>
<unique>
<unique-column name="LOGIN_NAME"/>
</unique>
</table>
<!-- transaction log -->
<table name="EVENT_LOG" idMethod="native">
<column name="LOG_ID" required="true"
primaryKey="true" type="INTEGER" autoIncrement="true"/>
<column name="USER_ID" required="true" type="INTEGER"/>
<column name="TRANSACTION_TYPE" type="INTEGER"/>
<column name="MESSAGE" type="VARCHAR" size="500"/>
<column name="TX_DATE" type="TIMESTAMP"/>
<foreign-key foreignTable="MYAPP_USER">
<reference local="USER_ID" foreign="USER_ID"></reference>
</foreign-key>
</table>
--
Jeff Painter
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]