rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject svn commit: r1204852 - in /incubator/rave/trunk: rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ rave-portal-resources/src/main/webapp/WEB-INF/db/ rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/
Date Tue, 22 Nov 2011 08:16:56 GMT
Author: jasha
Date: Tue Nov 22 08:16:54 2011
New Revision: 1204852

URL: http://svn.apache.org/viewvc?rev=1204852&view=rev
Log:
RAVE-357 if the display name is present, use it for the greeting on the homepage. Thanks Ankur
Goyal for the patch

Modified:
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Person.java
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp

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=1204852&r1=1204851&r2=1204852&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 22 08:16:54 2011
@@ -20,7 +20,23 @@ package org.apache.rave.portal.model;
 
 import org.apache.rave.persistence.BasicEntity;
 
-import javax.persistence.*;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import javax.persistence.Transient;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -60,7 +76,7 @@ public class Person implements BasicEnti
     protected String email;
 
     @Basic
-    @Column(name = "display_name")
+    @Column(name = "display_name", length = 255)
     protected String displayName;
 
     @Basic

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql?rev=1204852&r1=1204851&r2=1204852&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql
(original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql
Tue Nov 22 08:16:54 2011
@@ -88,33 +88,33 @@ 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 person (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');
+insert into person (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype, display_name)
+values (@user_id_1, 'canonical', 'b97fd0fa25ba8a504309be2b6651ac6dee167ded', FALSE, FALSE,
TRUE,'canonical@example.com', @three_col_id, 'User', 'Canonical 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 person (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');
+insert into person (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype, display_name)
+values (@user_id_2, 'john.doe', '49e5f5c7c7ae8372af9b3063c493f080d16411f5', FALSE, FALSE,
TRUE,'john.doe@example.com', @three_col_id, 'User', 'John Doe');
 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 person (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');
+insert into person (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype, display_name)
+values (@user_id_3, 'jane.doe', '30dd37e81704bbbd4e235c22990802ae25b187da', FALSE, FALSE,
TRUE,'jane.doe@example.net', @three_col_id, 'User', 'Jane Doe');
 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 person (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');
+insert into person (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype, display_name)
+values (@user_id_4, 'george.doe', '452802e3f2ff8b7b28785f50dfaaaaf80fc1430f', FALSE, FALSE,
TRUE,'george.doe@example.org', @three_col_id, 'User', 'George Doe');
 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 person (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');
+insert into person (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype, display_name)
+values (@user_id_5,'mario.rossi', '8aadae9f6e73a479cb8a565bcfa6e8de2b074e89', FALSE, FALSE,
TRUE,'mario.rossi@example.com', @three_col_id, 'User', 'Mario Rossi');
 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 person (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');
+insert into person (entity_id, username, password, expired, locked, enabled, email, default_page_layout_id,
dtype, display_name)
+values (@user_id_6, 'maija.m', '18550acca1b36af6cfa41c82e1caab12073475a1', FALSE, FALSE,
TRUE,'maijam@example.com', @three_col_id, 'User', 'Maija M');
 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);
@@ -788,4 +788,4 @@ values (@next_portal_preference_id, 'pag
 INSERT INTO portalpreference_values
 values (@next_portal_preference_id, '10');
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @portal_preference_seq;
--- end portal preferences
\ No newline at end of file
+-- end portal preferences

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp?rev=1204852&r1=1204851&r2=1204852&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp
(original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp
Tue Nov 22 08:16:54 2011
@@ -43,7 +43,12 @@
         </ul>
     </nav>
   <h1>
-      <fmt:message key="page.home.welcome"><fmt:param><c:out value="${page.owner.username}"/></fmt:param></fmt:message>
+      <fmt:message key="page.home.welcome"><fmt:param>
+          <c:choose>
+              <c:when test="${not empty page.owner.displayName}"><c:out value="${page.owner.displayName}"/></c:when>
+              <c:otherwise><c:out value="${page.owner.username}"/></c:otherwise>
+          </c:choose>
+      </fmt:param></fmt:message>
   </h1>
 </header>
 <input id="currentPageId" type="hidden" value="${page.entityId}" />
@@ -223,4 +228,4 @@
         rave.initUI();
         rave.layout.init();
     });
-</script>
\ No newline at end of file
+</script>



Mime
View raw message