rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfrank...@apache.org
Subject svn commit: r1199419 - in /incubator/rave/trunk/rave-components/rave-core/src: main/java/org/apache/rave/portal/model/Person.java main/java/org/apache/rave/portal/model/User.java test/resources/test_data.sql
Date Tue, 08 Nov 2011 19:59:30 GMT
Author: mfranklin
Date: Tue Nov  8 19:59:29 2011
New Revision: 1199419

URL: http://svn.apache.org/viewvc?rev=1199419&view=rev
Log:
Updated User to extend from Person (Supports RAVE-342)

Modified:
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Person.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/User.java
    incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql

Modified: incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Person.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Person.java?rev=1199419&r1=1199418&r2=1199419&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Person.java
(original)
+++ incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Person.java
Tue Nov  8 19:59:29 2011
@@ -47,70 +47,70 @@ public class Person implements BasicEnti
     @GeneratedValue(strategy = GenerationType.TABLE, generator = "personIdGenerator")
     @TableGenerator(name = "personIdGenerator", table = "RAVE_PORTAL_SEQUENCES", pkColumnName
= "SEQ_NAME",
             valueColumnName = "SEQ_COUNT", pkColumnValue = "raveuser", allocationSize = 1,
initialValue = 1)
-    private Long entityId;
+    protected Long entityId;
 
     @Basic
     @Column(name = "username", unique = true)
-    private String username;
+    protected String username;
 
     @Basic
     @Column(name = "email", unique = true)
-    private String email;
+    protected String email;
 
     @Basic
     @Column(name = "display_name")
-    private String displayName;
+    protected String displayName;
 
     @Basic
     @Column(name = "additional_name", length = 255)
-    private String additionalName;
+    protected String additionalName;
 
     @Basic
     @Column(name = "family_name", length = 255)
-    private String familyName;
+    protected String familyName;
 
     @Basic
     @Column(name = "given_name", length = 255)
-    private String givenName;
+    protected String givenName;
 
     @Basic
     @Column(name = "honorific_prefix", length = 255)
-    private String honorificPrefix;
+    protected String honorificPrefix;
 
     @Basic
     @Column(name = "honorific_suffix", length = 255)
-    private String honorificSuffix;
+    protected String honorificSuffix;
 
     @Basic
     @Column(name = "preferred_name")
-    private String preferredName;
+    protected String preferredName;
 
     @Basic
     @Column(name = "about_me")
-    private String aboutMe;
+    protected String aboutMe;
 
     @Basic
     @Column(name = "status")
-    private String status;
+    protected String status;
 
     @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
     @JoinTable(name = "person_address_join",
             joinColumns = @JoinColumn(name = "address_id", referencedColumnName = "entity_id"),
             inverseJoinColumns = @JoinColumn(name="person_id", referencedColumnName = "entity_id"))
-    private List<Address> addresses;
+    protected List<Address> addresses;
 
     @OneToMany(targetEntity = PersonProperty.class)
     @JoinColumn(name = "person_id", referencedColumnName = "entity_id")
-    private List<PersonProperty> properties;
+    protected List<PersonProperty> properties;
 
     @ManyToMany(fetch = FetchType.LAZY)
     @JoinTable(name = "person_friends_jn",
             joinColumns = @JoinColumn(name = "follower_id", referencedColumnName = "entity_id"),
             inverseJoinColumns = @JoinColumn(name = "followed_id", referencedColumnName =
"entity_id"))
-    private List<Person> friends;
+    protected List<Person> friends;
 
     @Transient
-    private Map<String, List<PersonProperty>> mappedProperties;
+    protected Map<String, List<PersonProperty>> mappedProperties;
 
     public Long getEntityId() {
         return entityId;

Modified: incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/User.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/User.java?rev=1199419&r1=1199418&r2=1199419&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/User.java
(original)
+++ incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/User.java
Tue Nov  8 19:59:29 2011
@@ -63,7 +63,7 @@ import java.util.Collections;
                 "where lower(u.username) like :"+User.PARAM_SEARCHTERM+" or lower(u.email)
like :"+User.PARAM_SEARCHTERM)
 
 })
-public class User implements UserDetails, BasicEntity, Serializable {
+public class User extends Person implements UserDetails, BasicEntity, Serializable {
     private static final long serialVersionUID = 1L;
 
     public static final String USER_GET_BY_USERNAME = "User.getByUsername";
@@ -79,16 +79,6 @@ public class User implements UserDetails
     public static final String PARAM_SEARCHTERM = "searchTerm";
     public static final String PARAM_WIDGET_ID = "widgetId";
 
-    @Id
-    @Column(name = "entity_id")
-    @GeneratedValue(strategy = GenerationType.TABLE, generator = "raveuserIdGenerator")
-    @TableGenerator(name = "raveuserIdGenerator", table = "RAVE_PORTAL_SEQUENCES", pkColumnName
= "SEQ_NAME",
-            valueColumnName = "SEQ_COUNT", pkColumnValue = "raveuser", allocationSize = 1,
initialValue = 1)
-    private Long entityId;
-
-    @Basic
-    @Column(name = "username", unique = true)
-    private String username;
 
     @Basic
     @Column(name = "password")
@@ -107,10 +97,6 @@ public class User implements UserDetails
     private boolean enabled;
 
     @Basic
-    @Column(name = "email", unique = true)
-    private String email;
-
-    @Basic
     @Column(name = "openid")
     private String openId;       
     

Modified: incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql?rev=1199419&r1=1199418&r2=1199419&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql (original)
+++ incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql Tue Nov
 8 19:59:29 2011
@@ -87,69 +87,69 @@ UPDATE RAVE_PORTAL_SEQUENCES SET seq_cou
   -- ***********************************************************************************
   --- start user data ---
 set @user_id_1 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @user_seq);
-insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id)
-values (@user_id_1, 'canonical', 'b97fd0fa25ba8a504309be2b6651ac6dee167ded', FALSE, FALSE,
TRUE,'canonical@example.com', @three_col_id);
+insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype)
+values (@user_id_1, 'canonical', 'b97fd0fa25ba8a504309be2b6651ac6dee167ded', FALSE, FALSE,
TRUE,'canonical@example.com', @three_col_id, 'User');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @user_seq;
 
 set @user_id_2 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @user_seq);
-insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id)
-values (@user_id_2, 'john.doe', '49e5f5c7c7ae8372af9b3063c493f080d16411f5', FALSE, FALSE,
TRUE,'john.doe@example.com', @three_col_id);
+insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype)
+values (@user_id_2, 'john.doe', '49e5f5c7c7ae8372af9b3063c493f080d16411f5', FALSE, FALSE,
TRUE,'john.doe@example.com', @three_col_id, 'User');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @user_seq;
 
 set @user_id_3 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @user_seq);
-insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id)
-values (@user_id_3, 'jane.doe', '30dd37e81704bbbd4e235c22990802ae25b187da', FALSE, FALSE,
TRUE,'jane.doe@example.net', @three_col_id);
+insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype)
+values (@user_id_3, 'jane.doe', '30dd37e81704bbbd4e235c22990802ae25b187da', FALSE, FALSE,
TRUE,'jane.doe@example.net', @three_col_id, 'User');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @user_seq;
 
 set @user_id_4 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @user_seq);
-insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id)
-values (@user_id_4, 'george.doe', '452802e3f2ff8b7b28785f50dfaaaaf80fc1430f', FALSE, FALSE,
TRUE,'george.doe@example.org', @three_col_id);
+insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype)
+values (@user_id_4, 'george.doe', '452802e3f2ff8b7b28785f50dfaaaaf80fc1430f', FALSE, FALSE,
TRUE,'george.doe@example.org', @three_col_id, 'User');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @user_seq;
 
 set @user_id_5 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @user_seq);
-insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id)
-values (@user_id_5,'mario.rossi', '8aadae9f6e73a479cb8a565bcfa6e8de2b074e89', FALSE, FALSE,
TRUE,'mario.rossi@example.com', @three_col_id);
+insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype)
+values (@user_id_5,'mario.rossi', '8aadae9f6e73a479cb8a565bcfa6e8de2b074e89', FALSE, FALSE,
TRUE,'mario.rossi@example.com', @three_col_id, 'User');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @user_seq;
 
 set @user_id_6 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @user_seq);
-insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id)
-values (@user_id_6, 'maija.m', '18550acca1b36af6cfa41c82e1caab12073475a1', FALSE, FALSE,
TRUE,'maijam@example.com', @three_col_id);
+insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype)
+values (@user_id_6, 'maija.m', '18550acca1b36af6cfa41c82e1caab12073475a1', FALSE, FALSE,
TRUE,'maijam@example.com', @three_col_id, 'User');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @user_seq;
 
 set @user_id_7 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @user_seq);
-insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id)
-values (@user_id_7, 'one.col', '07acee6193e84ba9ae2f7b2bf26538f2d6e4b0a1', FALSE, FALSE,
TRUE,'one.col@example.com', @three_col_id);
+insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype)
+values (@user_id_7, 'one.col', '07acee6193e84ba9ae2f7b2bf26538f2d6e4b0a1', FALSE, FALSE,
TRUE,'one.col@example.com', @three_col_id, 'User');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @user_seq;
 
 set @user_id_8 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @user_seq);
-insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id)
-values (@user_id_8, 'twown.col', '24159ea43cbcecb50021cd14a1d41a8079fd9714', FALSE, FALSE,
TRUE,'twown.col@example.com', @three_col_id);
+insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype)
+values (@user_id_8, 'twown.col', '24159ea43cbcecb50021cd14a1d41a8079fd9714', FALSE, FALSE,
TRUE,'twown.col@example.com', @three_col_id, 'User');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @user_seq;
 
 set @user_id_9 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @user_seq);
-insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id)
-values (@user_id_9, 'three.col', 'c736434430af90772bfd4351bffa3da04cec0403', FALSE, FALSE,
TRUE,'three.col@example.com', @three_col_id);
+insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype)
+values (@user_id_9, 'three.col', 'c736434430af90772bfd4351bffa3da04cec0403', FALSE, FALSE,
TRUE,'three.col@example.com', @three_col_id, 'User');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @user_seq;
 
 set @user_id_10 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @user_seq);
-insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id)
-values (@user_id_10, 'threewn.col', 'ad67065a5bc25f86036508971a09a58e9c9131e8', FALSE, FALSE,
TRUE,'threewn.col@example.com', @three_col_id);
+insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype)
+values (@user_id_10, 'threewn.col', 'ad67065a5bc25f86036508971a09a58e9c9131e8', FALSE, FALSE,
TRUE,'threewn.col@example.com', @three_col_id, 'User');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @user_seq;
 
 set @user_id_11 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @user_seq);
-insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id)
-values (@user_id_11, 'four.col', 'c875ce4416fc56cd34c01bd366a3af5468137155', FALSE, FALSE,
TRUE,'four.col@example.com', @three_col_id);
+insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype)
+values (@user_id_11, 'four.col', 'c875ce4416fc56cd34c01bd366a3af5468137155', FALSE, FALSE,
TRUE,'four.col@example.com', @three_col_id, 'User');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @user_seq;
 
 set @user_id_12 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @user_seq);
-insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id)
-values (@user_id_12, 'fourwn.col', 'eb0b450eff79a33027a41a05051f5609a83667e8', FALSE, FALSE,
TRUE,'fourwn.col@example.com', @three_col_id);
+insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype)
+values (@user_id_12, 'fourwn.col', 'eb0b450eff79a33027a41a05051f5609a83667e8', FALSE, FALSE,
TRUE,'fourwn.col@example.com', @three_col_id, 'User');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @user_seq;
 
 -- duplicate user id!!
 set @user_id_13 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @user_seq);
-insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id)
-values (@user_id_13, 'http://rave2011.myopenid.com/', 'cdf15c184b7d2539b0cfc29ee9f10bad62793d50',
FALSE, FALSE, TRUE,'rave2011_openid@example.org', @three_col_id);
+insert into raveuser (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype)
+values (@user_id_13, 'http://rave2011.myopenid.com/', 'cdf15c184b7d2539b0cfc29ee9f10bad62793d50',
FALSE, FALSE, TRUE,'rave2011_openid@example.org', @three_col_id, 'User');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @user_seq;
 
 --- end user data ---



Mime
View raw message