You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by claudio santana <cl...@santana.net> on 2001/08/21 21:33:12 UTC

Extending Turbine User with my own class...

Hello guys,

    I'm trying to extend the Turbine default user with my own  user 
 with some extrainfo. I tryed to follow the Email with subject "[HOWTO] 
Extend TurbineUser with your own class..." from Jon Stevens 
<jo...@latchkey.com> issued on Sun, 12 Aug 2001 21:17:54 -0700. I defined 
my own schema in my schema.xml file,  I  created an interface with the 
same classname extending User and then ran "ant init" to make Torque 
create the implementation of my extended user. I'm supposed to get a 
Base class but I don't get anything, even I don't get any error message 
or warninig. Any idea What am I doing wrong? I would really appreciate 
your help with this issue.

Claudio.

These are the lines I added to the Schema.xml file.

<table name="SOCRATES_USER2" javaName="SocratesUser2Impl" 
alias="TurbineUser"
    baseClass="org.apache.fulcrum.security.impl.db.entity.TurbineUser"
    basePeer="org.apache.fulcrum.security.impl.db.entity.TurbineUserPeer">
   
    <column name="USER_ID" primaryKey="true" required="true" 
type="INTEGER"/>
    <column name="STATUS" size="99" type="VARCHAR"/>
   
</table>


My new interface looks like this:

package mx.com.socrates.om;

import org.apache.turbine.om.security.User;

public interface SocratesUser2 extends User
{

    /** ACTIVE status constant for user status. */
    public static final String ACTIVE = "ACTIVE";

    /** INACTIVE status constant for user status. */
    public static final String INACTIVE = "INACTIVE";

    /**
     * Gets the status of this User. It can be Active or Inactive
     *
     * @return String with the current status of the User.
     */
    public String getStatus();
   
    /**
     * Sets the status of this User. It can be Active or Inactive
     *
      * @param value New status value    
     */
    public void setStatus(String status);



}





---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Extending Turbine User with my own class...

Posted by John McNally <jm...@collab.net>.
The alias table is meant to point to a table defined in another schema. 
you cannot add columns in the new schema (feel free to submit patches). 
You should add the columns in the schema where the table is created.

john mcnally

claudio santana wrote:
> 
> Hello guys,
> 
>     I'm trying to extend the Turbine default user with my own  user
>  with some extrainfo. I tryed to follow the Email with subject "[HOWTO]
> Extend TurbineUser with your own class..." from Jon Stevens
> <jo...@latchkey.com> issued on Sun, 12 Aug 2001 21:17:54 -0700. I defined
> my own schema in my schema.xml file,  I  created an interface with the
> same classname extending User and then ran "ant init" to make Torque
> create the implementation of my extended user. I'm supposed to get a
> Base class but I don't get anything, even I don't get any error message
> or warninig. Any idea What am I doing wrong? I would really appreciate
> your help with this issue.
> 
> Claudio.
> 
> These are the lines I added to the Schema.xml file.
> 
> <table name="SOCRATES_USER2" javaName="SocratesUser2Impl"
> alias="TurbineUser"
>     baseClass="org.apache.fulcrum.security.impl.db.entity.TurbineUser"
>     basePeer="org.apache.fulcrum.security.impl.db.entity.TurbineUserPeer">
> 
>     <column name="USER_ID" primaryKey="true" required="true"
> type="INTEGER"/>
>     <column name="STATUS" size="99" type="VARCHAR"/>
> 
> </table>
> 
> My new interface looks like this:
> 
> package mx.com.socrates.om;
> 
> import org.apache.turbine.om.security.User;
> 
> public interface SocratesUser2 extends User
> {
> 
>     /** ACTIVE status constant for user status. */
>     public static final String ACTIVE = "ACTIVE";
> 
>     /** INACTIVE status constant for user status. */
>     public static final String INACTIVE = "INACTIVE";
> 
>     /**
>      * Gets the status of this User. It can be Active or Inactive
>      *
>      * @return String with the current status of the User.
>      */
>     public String getStatus();
> 
>     /**
>      * Sets the status of this User. It can be Active or Inactive
>      *
>       * @param value New status value
>      */
>     public void setStatus(String status);
> 
> }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org