Author: tv
Date: Mon Sep 9 15:17:24 2013
New Revision: 1521156
URL: http://svn.apache.org/r1521156
Log:
Add extended user having first name, last name, email and objectdata and derive
TurbineUser from it.
Added:
turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/entity/ExtendedUser.java
(with props)
Modified:
turbine/fulcrum/trunk/security/api/src/changes/changes.xml
turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/turbine/entity/TurbineUser.java
turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/turbine/entity/impl/TurbineUserImpl.java
turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.hbm.xml
turbine/fulcrum/trunk/security/nt/.settings/org.eclipse.jdt.core.prefs
turbine/fulcrum/trunk/security/torque/.classpath
turbine/fulcrum/trunk/security/torque/pom.xml
turbine/fulcrum/trunk/security/torque/schema/fulcrum-turbine-schema.xml
turbine/fulcrum/trunk/security/torque/src/test/fulcrum-turbine-schema.sql
Modified: turbine/fulcrum/trunk/security/api/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/api/src/changes/changes.xml?rev=1521156&r1=1521155&r2=1521156&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/api/src/changes/changes.xml (original)
+++ turbine/fulcrum/trunk/security/api/src/changes/changes.xml Mon Sep 9
15:17:24 2013
@@ -26,6 +26,13 @@
<body>
<release version="1.1.0" date="">
<action type="update" dev="tv">
+ Add extended user having first name, last name, email and objectdata
+ and derive TurbineUser from it.
+ </action>
+ <action type="update" dev="tv">
+ Update fulcrum-security-hibernate to test with HSQLDB
+ </action>
+ <action type="update" dev="tv">
Update fulcrum-security-torque to use Torque 4.0.
</action>
<action type="update" dev="tv">
Added:
turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/entity/ExtendedUser.java
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/entity/ExtendedUser.java?rev=1521156&view=auto
==============================================================================
---
turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/entity/ExtendedUser.java
(added)
+++
turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/entity/ExtendedUser.java
Mon Sep 9 15:17:24 2013
@@ -0,0 +1,89 @@
+package org.apache.fulcrum.security.entity;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * This interface represents the extended functionality of a user.
+ *
+ * @author <a href="mailto:[email protected]">Thomas Vandahl</a>
+ * @version $Id: User.java 1374616 2012-08-18 17:26:07Z tv $
+ */
+public interface ExtendedUser extends User
+{
+ /**
+ * Returns the first name for this user.
+ *
+ * @return A String with the user's first name.
+ */
+
+ String getFirstName();
+
+ /**
+ * Returns the last name for this user.
+ *
+ * @return A String with the user's last name.
+ */
+ String getLastName();
+
+ /**
+ * Returns the email address for this user.
+ *
+ * @return A String with the user's email address.
+ */
+ String getEmail();
+
+ /**
+ * Sets the first name for this user.
+ *
+ * @param firstName User's first name.
+ */
+ void setFirstName(String firstName);
+
+ /**
+ * Sets the last name for this user.
+ *
+ * @param lastName User's last name.
+ */
+ void setLastName(String lastName);
+
+ /**
+ * Sets the email address.
+ *
+ * @param address The email address.
+ */
+ void setEmail(String address);
+
+ /**
+ * Returns the value of the objectdata for this user.
+ * Objectdata is a storage area used
+ * to store the permanent storage table from the User
+ * object.
+ *
+ * @return The bytes in the objectdata for this user
+ */
+ byte[] getObjectdata();
+
+ /**
+ * Sets the value of the objectdata for the user
+ *
+ * @param objectdata The new permanent storage for the user
+ */
+ void setObjectdata(byte[] objectdata);
+}
Propchange:
turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/entity/ExtendedUser.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified:
turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/turbine/entity/TurbineUser.java
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/turbine/entity/TurbineUser.java?rev=1521156&r1=1521155&r2=1521156&view=diff
==============================================================================
---
turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/turbine/entity/TurbineUser.java
(original)
+++
turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/turbine/entity/TurbineUser.java
Mon Sep 9 15:17:24 2013
@@ -19,17 +19,17 @@ package org.apache.fulcrum.security.mode
* under the License.
*/
-import org.apache.fulcrum.security.entity.User;
+import org.apache.fulcrum.security.entity.ExtendedUser;
/**
* Represents the "turbine" model where permissions are in a many to many
* relationship to roles, roles are related to groups are related to users, all
* in many to many relationships.
- *
+ *
* @author <a href="mailto:[email protected]">Eric Pugh</a>
* @version $Id$
*/
-public interface TurbineUser extends User, TurbineUserGroupRoleEntity
+public interface TurbineUser extends ExtendedUser, TurbineUserGroupRoleEntity
{
// empty
}
Modified:
turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/turbine/entity/impl/TurbineUserImpl.java
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/turbine/entity/impl/TurbineUserImpl.java?rev=1521156&r1=1521155&r2=1521156&view=diff
==============================================================================
---
turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/turbine/entity/impl/TurbineUserImpl.java
(original)
+++
turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/turbine/entity/impl/TurbineUserImpl.java
Mon Sep 9 15:17:24 2013
@@ -26,7 +26,7 @@ import org.apache.fulcrum.security.model
* Represents the "turbine" model where permissions are in a many to many
* relationship to roles, roles are related to groups are related to users, all
* in many to many relationships.
- *
+ *
* @author <a href="mailto:[email protected]">Eric Pugh</a>
* @version $Id: TurbineUser.java 437451 2006-08-27 20:20:44Z tv $
*/
@@ -38,9 +38,15 @@ public class TurbineUserImpl extends Abs
private static final long serialVersionUID = -7309619325167081811L;
private String password;
+ private String firstName;
+ private String lastName;
+ private String email;
+ private byte[] objectData;
/**
- * @return
+ * Get the password
+ *
+ * @return the password
*/
public String getPassword()
{
@@ -48,7 +54,9 @@ public class TurbineUserImpl extends Abs
}
/**
- * @param password
+ * Set the password
+ *
+ * @param password the new password
*/
public void setPassword(String password)
{
@@ -56,13 +64,101 @@ public class TurbineUserImpl extends Abs
}
/**
+ * Returns the first name of the User
+ *
+ * @return The first name of the User
+ */
+ public String getFirstName()
+ {
+ return this.firstName;
+ }
+
+ /**
+ * Sets the first name of the User
+ *
+ * @param firstName The new first name of the User
+ */
+ public void setFirstName(String firstName)
+ {
+ this.firstName = firstName;
+ }
+
+ /**
+ * Returns the last name of the User
+ *
+ * @return The last name of the User
+ */
+ public String getLastName()
+ {
+ return this.lastName;
+ }
+
+ /**
+ * Sets the last name of User
+ *
+ * @param lastName The new last name of the User
+ */
+ public void setLastName(String lastName)
+ {
+ this.lastName = lastName;
+ }
+
+ /**
+ * Returns the email address of the user
+ *
+ * @return The email address of the user
+ */
+ public String getEmail()
+ {
+ return this.email;
+ }
+
+ /**
+ * Sets the new email address of the user
+ *
+ * @param email The new email address of the user
+ */
+ public void setEmail(String email)
+ {
+ this.email = email;
+ }
+
+ /**
+ * Returns the value of the objectdata for this user.
+ * Objectdata is a storage area used
+ * to store the permanent storage table from the User
+ * object.
+ *
+ * @return The bytes in the objectdata for this user
+ */
+ public byte[] getObjectdata()
+ {
+ return this.objectData;
+ }
+
+ /**
+ * Sets the value of the objectdata for the user
+ *
+ * @param objectdata The new permanent storage for the user
+ */
+ public void setObjectdata(byte[] objectdata)
+ {
+ this.objectData = objectdata;
+ }
+
+ /**
* Calculate a hash code for this object
- *
+ *
* @see
org.apache.fulcrum.security.entity.impl.SecurityEntityImpl#hashCode()
*/
@Override
public int hashCode()
{
- return new HashCodeBuilder(41,
15).append(getPassword()).appendSuper(super.hashCode()).toHashCode();
+ return new HashCodeBuilder(41, 15)
+ .append(getPassword())
+ .append(getFirstName())
+ .append(getLastName())
+ .append(getEmail())
+ .appendSuper(super.hashCode()).toHashCode();
}
}
Modified:
turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.hbm.xml
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.hbm.xml?rev=1521156&r1=1521155&r2=1521156&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.hbm.xml
(original)
+++ turbine/fulcrum/trunk/security/hibernate/src/test/TurbineHibernate.hbm.xml
Mon Sep 9 15:17:24 2013
@@ -71,6 +71,10 @@
</id>
<property name="name" column="USERNAME" type="string"/>
<property name="password" column="PASSWORD" type="string"/>
+ <property name="firstName" column="FIRST_NAME" type="string"/>
+ <property name="lastName" column="LAST_NAME" type="string"/>
+ <property name="email" column="EMAIL" type="string"/>
+ <property name="objectdata" column="OBJECTDATA" type="binary"/>
<set inverse="true" name="userGroupRoleSet">
<key column="user_id" />
<one-to-many
class="org.apache.fulcrum.security.model.turbine.entity.TurbineUserGroupRole" />
Modified: turbine/fulcrum/trunk/security/nt/.settings/org.eclipse.jdt.core.prefs
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/nt/.settings/org.eclipse.jdt.core.prefs?rev=1521156&r1=1521155&r2=1521156&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/nt/.settings/org.eclipse.jdt.core.prefs
(original)
+++ turbine/fulcrum/trunk/security/nt/.settings/org.eclipse.jdt.core.prefs Mon
Sep 9 15:17:24 2013
@@ -1,6 +1,9 @@
-#Thu Aug 16 20:16:17 CEST 2012
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.5
+#Mon Jul 08 12:01:20 CEST 2013
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.5
Modified: turbine/fulcrum/trunk/security/torque/.classpath
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/torque/.classpath?rev=1521156&r1=1521155&r2=1521156&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/torque/.classpath (original)
+++ turbine/fulcrum/trunk/security/torque/.classpath Mon Sep 9 15:17:24 2013
@@ -2,6 +2,7 @@
<classpath>
<classpathentry kind="src" output="target/classes" path="src/java"/>
<classpathentry kind="src" output="target/test-classes"
path="src/test"/>
+ <classpathentry kind="src" path="target/generated-sources"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con"
path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: turbine/fulcrum/trunk/security/torque/pom.xml
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/torque/pom.xml?rev=1521156&r1=1521155&r2=1521156&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/torque/pom.xml (original)
+++ turbine/fulcrum/trunk/security/torque/pom.xml Mon Sep 9 15:17:24 2013
@@ -183,6 +183,24 @@
</configuration>
</execution>
<execution>
+ <id>torque-sql-hsqldb</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+
<configPackage>org.apache.torque.templates.sql</configPackage>
+ <sourceDir>${project.basedir}/schema</sourceDir>
+
<defaultOutputDir>${project.build.directory}/generated-sql/torque/hsqldb</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>error</loglevel>
+ <options>
+ <torque.database>hsqldb</torque.database>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
<id>torque-sql-derby</id>
<phase>package</phase>
<goals>
@@ -274,6 +292,24 @@
</configuration>
</execution>
<execution>
+ <id>torque-idtable-hsqldb</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+
<configPackage>org.apache.torque.templates.idtable</configPackage>
+ <sourceDir>${project.basedir}/schema</sourceDir>
+
<defaultOutputDir>${project.build.directory}/generated-sql/torque/hsqldb</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>error</loglevel>
+ <options>
+ <torque.database>hsqldb</torque.database>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
<id>torque-idtable-derby</id>
<phase>package</phase>
<goals>
Modified:
turbine/fulcrum/trunk/security/torque/schema/fulcrum-turbine-schema.xml
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/torque/schema/fulcrum-turbine-schema.xml?rev=1521156&r1=1521155&r2=1521156&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/torque/schema/fulcrum-turbine-schema.xml
(original)
+++ turbine/fulcrum/trunk/security/torque/schema/fulcrum-turbine-schema.xml Mon
Sep 9 15:17:24 2013
@@ -71,16 +71,10 @@
<column name="USER_ID" required="true" primaryKey="true" type="INTEGER"
javaName="EntityId" javaType="object"/>
<column name="LOGIN_NAME" required="true" size="64" type="VARCHAR"
javaName="EntityName"/>
<column name="PASSWORD_VALUE" required="true" size="16" 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="CONFIRM_VALUE" size="16" type="VARCHAR"
javaName="Confirmed"/>
- <column name="MODIFIED" type="TIMESTAMP"/>
- <column name="CREATED" type="TIMESTAMP" javaName="CreateDate"/>
- <column name="LAST_LOGIN" type="TIMESTAMP"/>
- <column name="OBJECTDATA" type="VARBINARY"/>
--->
+ <column name="FIRST_NAME" size="64" type="VARCHAR" javaName="FirstName"/>
+ <column name="LAST_NAME" size="64" type="VARCHAR" javaName="LastName"/>
+ <column name="EMAIL" size="64" type="VARCHAR" javaName="Email"/>
+ <column name="OBJECTDATA" type="VARBINARY" javaName="Objectdata"/>
<unique>
<unique-column name="LOGIN_NAME"/>
</unique>
Modified:
turbine/fulcrum/trunk/security/torque/src/test/fulcrum-turbine-schema.sql
URL:
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/torque/src/test/fulcrum-turbine-schema.sql?rev=1521156&r1=1521155&r2=1521156&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/torque/src/test/fulcrum-turbine-schema.sql
(original)
+++ turbine/fulcrum/trunk/security/torque/src/test/fulcrum-turbine-schema.sql
Mon Sep 9 15:17:24 2013
@@ -67,6 +67,10 @@ CREATE TABLE FULCRUM_TURBINE_USER
USER_ID INTEGER NOT NULL,
LOGIN_NAME VARCHAR(64) NOT NULL,
PASSWORD_VALUE VARCHAR(16) NOT NULL,
+ FIRST_NAME VARCHAR(64),
+ LAST_NAME VARCHAR(64),
+ EMAIL VARCHAR(64),
+ OBJECTDATA VARBINARY,
PRIMARY KEY(USER_ID),
UNIQUE (LOGIN_NAME)
);