rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject svn commit: r1171119 [1/3] - in /incubator/rave/trunk: rave-commons/src/main/java/org/apache/rave/persistence/ rave-commons/src/main/java/org/apache/rave/persistence/jpa/ rave-commons/src/test/java/org/apache/rave/persistence/jpa/ rave-portal/src/main/...
Date Thu, 15 Sep 2011 14:48:37 GMT
Author: jasha
Date: Thu Sep 15 14:48:35 2011
New Revision: 1171119

URL: http://svn.apache.org/viewvc?rev=1171119&view=rev
Log:
RAVE-260 rename (get/set)id from BasicEntity to (get/set)entityId because of return type collision
with Shindig interfaces

Modified:
    incubator/rave/trunk/rave-commons/src/main/java/org/apache/rave/persistence/BasicEntity.java
    incubator/rave/trunk/rave-commons/src/main/java/org/apache/rave/persistence/jpa/AbstractJpaRepository.java
    incubator/rave/trunk/rave-commons/src/test/java/org/apache/rave/persistence/jpa/AbstractJpaRepositoryTest.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Page.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/PageLayout.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Region.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/RegionWidget.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/RegionWidgetPreference.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/User.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Widget.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/service/impl/DefaultPageService.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/PageController.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/opensocial/service/impl/EncryptedBlobSecurityTokenService.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/opensocial/web/renderer/OpenSocialWidgetRenderer.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/w3c/service/impl/WookieWidgetService.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/w3c/web/renderer/W3cWidgetRenderer.java
    incubator/rave/trunk/rave-portal/src/main/resources/initial_data.sql
    incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/home.jsp
    incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/store.jsp
    incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/widget.jsp
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/portal/model/PageTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/portal/model/UserTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/portal/model/WidgetTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/portal/repository/AbstractJpaRepositoryTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/portal/repository/JpaPageRepositoryTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/portal/repository/JpaRegionRepositoryTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/portal/repository/JpaRegionWidgetRepositoryTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/portal/repository/JpaUserRepositoryTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/portal/repository/JpaWidgetRepositoryTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/portal/service/PageServiceTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/portal/service/WidgetServiceTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/portal/web/controller/WidgetStoreControllerTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/portal/web/renderer/RenderServiceIntegrationTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/provider/opensocial/web/renderer/OpenSocialWidgetRendererTest.java
    incubator/rave/trunk/rave-portal/src/test/java/org/apache/rave/provider/w3c/web/renderer/W3cWidgetRendererTest.java
    incubator/rave/trunk/rave-portal/src/test/resources/portal_test_data.sql
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/gadgets/oauth/model/OAuthConsumerStore.java
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/gadgets/oauth/model/OAuthTokenInfo.java
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Account.java
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Address.java
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Group.java
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Organization.java
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Person.java
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/PersonAssociation.java
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/PersonProperty.java
    incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/repository/impl/JpaPersonRepository.java
    incubator/rave/trunk/rave-shindig/src/main/resources/initial_data.sql
    incubator/rave/trunk/rave-shindig/src/test/java/org/apache/rave/opensocial/service/PersonServiceTest.java
    incubator/rave/trunk/rave-shindig/src/test/resources/test_data.sql

Modified: incubator/rave/trunk/rave-commons/src/main/java/org/apache/rave/persistence/BasicEntity.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-commons/src/main/java/org/apache/rave/persistence/BasicEntity.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-commons/src/main/java/org/apache/rave/persistence/BasicEntity.java
(original)
+++ incubator/rave/trunk/rave-commons/src/main/java/org/apache/rave/persistence/BasicEntity.java
Thu Sep 15 14:48:35 2011
@@ -23,6 +23,6 @@ package org.apache.rave.persistence;
  * Defines common properties implemented by Entities in the model
  */
 public interface BasicEntity {
-    Long getId();
-    void setId(Long id);
+    Long getEntityId();
+    void setEntityId(Long entityId);
 }

Modified: incubator/rave/trunk/rave-commons/src/main/java/org/apache/rave/persistence/jpa/AbstractJpaRepository.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-commons/src/main/java/org/apache/rave/persistence/jpa/AbstractJpaRepository.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-commons/src/main/java/org/apache/rave/persistence/jpa/AbstractJpaRepository.java
(original)
+++ incubator/rave/trunk/rave-commons/src/main/java/org/apache/rave/persistence/jpa/AbstractJpaRepository.java
Thu Sep 15 14:48:35 2011
@@ -55,7 +55,7 @@ public abstract class AbstractJpaReposit
     @Override
     @Transactional
     public T save(T item) {
-        return saveOrUpdate(item.getId(), manager, item);
+        return saveOrUpdate(item.getEntityId(), manager, item);
     }
 
     @Override

Modified: incubator/rave/trunk/rave-commons/src/test/java/org/apache/rave/persistence/jpa/AbstractJpaRepositoryTest.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-commons/src/test/java/org/apache/rave/persistence/jpa/AbstractJpaRepositoryTest.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-commons/src/test/java/org/apache/rave/persistence/jpa/AbstractJpaRepositoryTest.java
(original)
+++ incubator/rave/trunk/rave-commons/src/test/java/org/apache/rave/persistence/jpa/AbstractJpaRepositoryTest.java
Thu Sep 15 14:48:35 2011
@@ -26,8 +26,15 @@ import org.junit.Test;
 
 import javax.persistence.EntityManager;
 
-import static org.easymock.EasyMock.*;
-import static org.hamcrest.CoreMatchers.*;
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.sameInstance;
 import static org.junit.Assert.assertThat;
 
 /**
@@ -55,7 +62,7 @@ public class AbstractJpaRepositoryTest {
         replay(manager);
 
         TestEntity entity = repository.get(ID);
-        assertThat(entity.getId(), is(equalTo(ID)));
+        assertThat(entity.getEntityId(), is(equalTo(ID)));
         verify(manager);
     }
 
@@ -105,20 +112,20 @@ public class AbstractJpaRepositoryTest {
     }
 
     private class TestEntity implements BasicEntity{
-        private Long id;
+        private Long entityId;
 
-        private TestEntity(Long id) {
-            this.id = id;
+        private TestEntity(Long entityId) {
+            this.entityId = entityId;
         }
 
         @Override
-        public Long getId() {
-            return id;
+        public Long getEntityId() {
+            return entityId;
         }
 
         @Override
-        public void setId(Long id) {
-            this.id = id;
+        public void setEntityId(Long entityId) {
+            this.entityId = entityId;
         }
     }
 }

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Page.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Page.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Page.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Page.java
Thu Sep 15 14:48:35 2011
@@ -55,17 +55,17 @@ import java.util.List;
 @Entity
 @Table(name="page", uniqueConstraints={@UniqueConstraint(columnNames={"owner_id","name"})})
 @NamedQueries({
-        @NamedQuery(name = "Page.getByUserId", query="SELECT p FROM Page p WHERE p.owner.id
= :userId ORDER BY p.renderSequence")
+        @NamedQuery(name = "Page.getByUserId", query="SELECT p FROM Page p WHERE p.owner.entityId
= :userId ORDER BY p.renderSequence")
 })
 @Access(AccessType.FIELD)
 public class Page implements BasicEntity, Serializable {
     private static final long serialVersionUID = 1L;
       
-    @Id @Column(name="id")
+    @Id @Column(name="entity_id")
     @GeneratedValue(strategy = GenerationType.TABLE, generator = "pageIdGenerator")
     @TableGenerator(name = "pageIdGenerator", table = "RAVE_PORTAL_SEQUENCES", pkColumnName
= "SEQ_NAME",
             valueColumnName = "SEQ_COUNT", pkColumnValue = "page", allocationSize = 1, initialValue
= 1)
-    private Long id;
+    private Long entityId;
 
     @Basic(optional=false) @Column(name="name")
     private String name;
@@ -88,12 +88,12 @@ public class Page implements BasicEntity
     public Page() {
     }
     
-    public Page(Long id) {
-        this.id = id;
+    public Page(Long entityId) {
+        this.entityId = entityId;
     }
 
-    public Page(Long id, User owner) {
-        this.id = id;
+    public Page(Long entityId, User owner) {
+        this.entityId = entityId;
         this.owner = owner;
     }
 
@@ -103,13 +103,13 @@ public class Page implements BasicEntity
      * @return id The ID of persisted object; null if not persisted
      */
     @Override
-    public Long getId() {
-        return id;
+    public Long getEntityId() {
+        return entityId;
     }
 
     @Override
-    public void setId(Long id) {
-        this.id = id;
+    public void setEntityId(Long entityId) {
+        this.entityId = entityId;
     }
 
     /**
@@ -188,7 +188,7 @@ public class Page implements BasicEntity
             return false;
         }
         final Page other = (Page) obj;
-        if (this.id != other.id && (this.id == null || !this.id.equals(other.id)))
{
+        if (this.entityId != other.entityId && (this.entityId == null || !this.entityId.equals(other.entityId)))
{
             return false;
         }
         return true;
@@ -197,12 +197,12 @@ public class Page implements BasicEntity
     @Override
     public int hashCode() {
         int hash = 7;
-        hash = 89 * hash + (this.id != null ? this.id.hashCode() : 0);
+        hash = 89 * hash + (this.entityId != null ? this.entityId.hashCode() : 0);
         return hash;
     }
 
     @Override
     public String toString() {
-        return "Page{" + "id=" + id + ", name=" + name + ", owner=" + owner + ", renderSequence="
+ renderSequence + ", pageLayout=" + pageLayout + ", regions=" + regions + '}';
+        return "Page{" + "entityId=" + entityId + ", name=" + name + ", owner=" + owner +
", renderSequence=" + renderSequence + ", pageLayout=" + pageLayout + ", regions=" + regions
+ '}';
     }    
 }
\ No newline at end of file

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/PageLayout.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/PageLayout.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/PageLayout.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/PageLayout.java
Thu Sep 15 14:48:35 2011
@@ -45,11 +45,11 @@ import java.io.Serializable;
 public class PageLayout implements BasicEntity, Serializable {
     private static final long serialVersionUID = 1L;
 
-    @Id @Column(name="id")
+    @Id @Column(name="entity_id")
     @GeneratedValue(strategy = GenerationType.TABLE, generator = "pageLayoutIdGenerator")
     @TableGenerator(name = "pageLayoutIdGenerator", table = "RAVE_PORTAL_SEQUENCES", pkColumnName
= "SEQ_NAME",
             valueColumnName = "SEQ_COUNT", pkColumnValue = "page_layout", allocationSize
= 1, initialValue = 1)
-    private Long id;
+    private Long entityId;
 
     @Basic @Column(name="code", unique = true)
     private String code;
@@ -63,13 +63,13 @@ public class PageLayout implements Basic
      * @return id The ID of persisted object; null if not persisted
      */
     @Override
-    public Long getId() {
-        return id;
+    public Long getEntityId() {
+        return entityId;
     }
 
     @Override
-    public void setId(Long id) {
-        this.id = id;
+    public void setEntityId(Long entityId) {
+        this.entityId = entityId;
     }
 
     /**
@@ -107,7 +107,7 @@ public class PageLayout implements Basic
             return false;
         }
         final PageLayout other = (PageLayout) obj;
-        if (this.id != other.id && (this.id == null || !this.id.equals(other.id)))
{
+        if (this.entityId != other.entityId && (this.entityId == null || !this.entityId.equals(other.entityId)))
{
             return false;
         }
         return true;
@@ -116,12 +116,12 @@ public class PageLayout implements Basic
     @Override
     public int hashCode() {
         int hash = 5;
-        hash = 97 * hash + (this.id != null ? this.id.hashCode() : 0);
+        hash = 97 * hash + (this.entityId != null ? this.entityId.hashCode() : 0);
         return hash;
     }
 
     @Override
     public String toString() {
-        return "PageLayout{" + "id=" + id + ", code=" + code + ", numberOfRegions=" + numberOfRegions
+ '}';
+        return "PageLayout{" + "entityId=" + entityId + ", code=" + code + ", numberOfRegions="
+ numberOfRegions + '}';
     }
 }
\ No newline at end of file

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Region.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Region.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Region.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Region.java
Thu Sep 15 14:48:35 2011
@@ -49,11 +49,11 @@ import java.util.List;
 public class Region implements BasicEntity, Serializable {
     private static final long serialVersionUID = 1L;
      
-    @Id @Column(name="id")
+    @Id @Column(name="entity_id")
     @GeneratedValue(strategy = GenerationType.TABLE, generator = "regionIdGenerator")
     @TableGenerator(name = "regionIdGenerator", table = "RAVE_PORTAL_SEQUENCES", pkColumnName
= "SEQ_NAME",
             valueColumnName = "SEQ_COUNT", pkColumnValue = "region", allocationSize = 1,
initialValue = 1)
-    private Long id;
+    private Long entityId;
 
     @ManyToOne
     @JoinColumn(name = "page_id")
@@ -67,12 +67,12 @@ public class Region implements BasicEnti
     public Region() {
     }
 
-    public Region(Long id) {
-        this.id = id;
+    public Region(Long entityId) {
+        this.entityId = entityId;
     }
 
-    public Region(Long id, Page page) {
-        this.id = id;
+    public Region(Long entityId, Page page) {
+        this.entityId = entityId;
         this.page = page;
     }
 
@@ -82,13 +82,13 @@ public class Region implements BasicEnti
      * @return id The ID of persisted object; null if not persisted
      */
     @Override
-    public Long getId() {
-        return id;
+    public Long getEntityId() {
+        return entityId;
     }
 
     @Override
-    public void setId(Long id) {
-        this.id = id;
+    public void setEntityId(Long entityId) {
+        this.entityId = entityId;
     }
 
     /**
@@ -128,7 +128,7 @@ public class Region implements BasicEnti
             return false;
         }
         final Region other = (Region) obj;
-        if (this.id != other.id && (this.id == null || !this.id.equals(other.id)))
{
+        if (this.entityId != other.entityId && (this.entityId == null || !this.entityId.equals(other.entityId)))
{
             return false;
         }
         return true;
@@ -137,12 +137,12 @@ public class Region implements BasicEnti
     @Override
     public int hashCode() {
         int hash = 3;
-        hash = 67 * hash + (this.id != null ? this.id.hashCode() : 0);
+        hash = 67 * hash + (this.entityId != null ? this.entityId.hashCode() : 0);
         return hash;
     }
 
     @Override
     public String toString() {
-        return "Region{" + "id=" + id + ", page=" + page + ", regionWidgets=" + regionWidgets
+ '}';
+        return "Region{" + "entityId=" + entityId + ", page=" + page + ", regionWidgets="
+ regionWidgets + '}';
     }
 }

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/RegionWidget.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/RegionWidget.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/RegionWidget.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/RegionWidget.java
Thu Sep 15 14:48:35 2011
@@ -46,11 +46,11 @@ public class RegionWidget implements Bas
     private static final long serialVersionUID = 1L;
     
     @Id
-    @Column(name = "id")
+    @Column(name = "entity_id")
     @GeneratedValue(strategy = GenerationType.TABLE, generator = "regionWidgetIdGenerator")
     @TableGenerator(name = "regionWidgetIdGenerator", table = "RAVE_PORTAL_SEQUENCES", pkColumnName
= "SEQ_NAME",
             valueColumnName = "SEQ_COUNT", pkColumnValue = "region_widget", allocationSize
= 1, initialValue = 1)
-    private Long id;
+    private Long entityId;
 
     @ManyToOne
     @JoinColumn(name = "widget_id")
@@ -73,25 +73,25 @@ public class RegionWidget implements Bas
     private boolean collapsed;
 
     @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
-    @JoinColumn(name = "region_widget_id", referencedColumnName = "id")
+    @JoinColumn(name = "region_widget_id", referencedColumnName = "entity_id")
     private List<RegionWidgetPreference> preferences;
 
     public RegionWidget() {
     }
 
-    public RegionWidget(Long id) {
-        this.id = id;
+    public RegionWidget(Long entityId) {
+        this.entityId = entityId;
     }
 
-    public RegionWidget(Long id, Widget widget, Region region, int renderOrder) {
-        this.id = id;
+    public RegionWidget(Long entityId, Widget widget, Region region, int renderOrder) {
+        this.entityId = entityId;
         this.widget = widget;
         this.region = region;
         this.renderOrder = renderOrder;
     }
 
-    public RegionWidget(Long id, Widget widget, Region region) {
-        this.id = id;
+    public RegionWidget(Long entityId, Widget widget, Region region) {
+        this.entityId = entityId;
         this.widget = widget;
         this.region = region;
     }
@@ -102,13 +102,13 @@ public class RegionWidget implements Bas
      * @return id The ID of persisted object; null if not persisted
      */
     @Override
-    public Long getId() {
-        return id;
+    public Long getEntityId() {
+        return entityId;
     }
 
     @Override
-    public void setId(Long id) {
-        this.id = id;
+    public void setEntityId(Long entityId) {
+        this.entityId = entityId;
     }
 
     /**
@@ -203,7 +203,7 @@ public class RegionWidget implements Bas
             return false;
         }
         final RegionWidget other = (RegionWidget) obj;
-        if (this.id != other.id && (this.id == null || !this.id.equals(other.id)))
{
+        if (this.entityId != other.entityId && (this.entityId == null || !this.entityId.equals(other.entityId)))
{
             return false;
         }
         return true;
@@ -212,7 +212,7 @@ public class RegionWidget implements Bas
     @Override
     public int hashCode() {
         int hash = 5;
-        hash = 23 * hash + (this.id != null ? this.id.hashCode() : 0);
+        hash = 23 * hash + (this.entityId != null ? this.entityId.hashCode() : 0);
         return hash;
     }
 
@@ -220,8 +220,8 @@ public class RegionWidget implements Bas
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("RegionWidget{");
-        sb.append("id=");
-        sb.append(id);
+        sb.append("entityId=");
+        sb.append(entityId);
         sb.append(",widget=");
         sb.append(widget);
         sb.append(",region=");

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/RegionWidgetPreference.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/RegionWidgetPreference.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/RegionWidgetPreference.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/RegionWidgetPreference.java
Thu Sep 15 14:48:35 2011
@@ -42,11 +42,11 @@ public class RegionWidgetPreference impl
     private static final long serialVersionUID = 1L;
     
     @Id
-    @Column(name = "id")
+    @Column(name = "entity_id")
     @GeneratedValue(strategy = GenerationType.TABLE, generator = "regionWidgetPreferenceIdGenerator")
     @TableGenerator(name = "regionWidgetPreferenceIdGenerator", table = "RAVE_PORTAL_SEQUENCES",
pkColumnName = "SEQ_NAME",
             valueColumnName = "SEQ_COUNT", pkColumnValue = "region_widget_preference", allocationSize
= 1, initialValue = 1)
-    private Long id;
+    private Long entityId;
 
     @Basic
     @Column(name = "region_widget_id")
@@ -63,8 +63,8 @@ public class RegionWidgetPreference impl
     public RegionWidgetPreference() {
     }
 
-    public RegionWidgetPreference(Long id, Long regionWidgetId, String name, String value)
{
-        this.id = id;
+    public RegionWidgetPreference(Long entityId, Long regionWidgetId, String name, String
value) {
+        this.entityId = entityId;
         this.regionWidgetId = regionWidgetId;
         this.name = name;
         this.value = value;
@@ -76,13 +76,13 @@ public class RegionWidgetPreference impl
      * @return id The ID of persisted object; null if not persisted
      */
     @Override
-    public Long getId() {
-        return id;
+    public Long getEntityId() {
+        return entityId;
     }
 
     @Override
-    public void setId(Long id) {
-        this.id = id;
+    public void setEntityId(Long entityId) {
+        this.entityId = entityId;
     }
 
     /**
@@ -132,7 +132,7 @@ public class RegionWidgetPreference impl
             return false;
         }
         final RegionWidgetPreference other = (RegionWidgetPreference) obj;
-        if (this.id != other.id && (this.id == null || !this.id.equals(other.id)))
{
+        if (this.entityId != other.entityId && (this.entityId == null || !this.entityId.equals(other.entityId)))
{
             return false;
         }
         return true;
@@ -141,14 +141,14 @@ public class RegionWidgetPreference impl
     @Override
     public int hashCode() {
         int hash = 7;
-        hash = 97 * hash + (this.id != null ? this.id.hashCode() : 0);
+        hash = 97 * hash + (this.entityId != null ? this.entityId.hashCode() : 0);
         return hash;
     }
 
     @Override
     public String toString() {
         return "RegionWidgetPreference{" +
-                "id=" + id +
+                "entityId=" + entityId +
                 ", name='" + name + '\'' +
                 ", value='" + value + '\'' +
                 '}';

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/User.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/User.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/User.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/User.java
Thu Sep 15 14:48:35 2011
@@ -42,7 +42,7 @@ import java.util.Collection;
  * A user of the system
  */
 @Entity
-// user can be a restricted name
+// user can be a restricted table name
 @Table(name = "raveuser")
 @NamedQueries({
     @NamedQuery(name="User.getByUsername", query = "select u from User u where u.username
= :username"),
@@ -51,11 +51,11 @@ import java.util.Collection;
 public class User implements UserDetails, BasicEntity, Serializable {
     private static final long serialVersionUID = 1L;
     
-    @Id @Column(name = "id")
+    @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 id;
+    private Long entityId;
 
     @Basic @Column(name = "username", unique = true)
     private String username;
@@ -84,12 +84,12 @@ public class User implements UserDetails
     public User() {
     }
 
-    public User(Long id) {
-        this.id = id;
+    public User(Long entityId) {
+        this.entityId = entityId;
     }
 
-    public User(Long id, String username) {
-        this.id = id;
+    public User(Long entityId, String username) {
+        this.entityId = entityId;
         this.username = username;
     }
 
@@ -99,13 +99,13 @@ public class User implements UserDetails
      * @return The unique identifier for this user.
      */
     @Override
-    public Long getId() {
-        return id;
+    public Long getEntityId() {
+        return entityId;
     }
 
     @Override
-    public void setId(Long id) {
-        this.id = id;
+    public void setEntityId(Long entityId) {
+        this.entityId = entityId;
     }
 
     //TODO RAVE-232: Add GrantedAuthorities to user
@@ -219,7 +219,7 @@ public class User implements UserDetails
             return false;
         }
         final User other = (User) obj;
-        if (this.id != other.id && (this.id == null || !this.id.equals(other.id)))
{
+        if (this.entityId != other.entityId && (this.entityId == null || !this.entityId.equals(other.entityId)))
{
             return false;
         }
         return true;
@@ -228,12 +228,12 @@ public class User implements UserDetails
     @Override
     public int hashCode() {
         int hash = 7;
-        hash = 67 * hash + (this.id != null ? this.id.hashCode() : 0);
+        hash = 67 * hash + (this.entityId != null ? this.entityId.hashCode() : 0);
         return hash;
     }
 
     @Override
     public String toString() {
-        return "User{" + "id=" + id + ", username=" + username + ", password=" + password
+ ", expired=" + expired + ", locked=" + locked + ", enabled=" + enabled + ", email=" + email
+ ", openId=" + openId + ", confirmPassword=" + confirmPassword + '}';
+        return "User{" + "entityId=" + entityId + ", username=" + username + ", password="
+ password + ", expired=" + expired + ", locked=" + locked + ", enabled=" + enabled + ", email="
+ email + ", openId=" + openId + ", confirmPassword=" + confirmPassword + '}';
     }
 }

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Widget.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Widget.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Widget.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/model/Widget.java
Thu Sep 15 14:48:35 2011
@@ -78,11 +78,11 @@ public class Widget implements BasicEnti
             "Widget.countByStatusAndFreeText";
     public static final String WIDGET_GET_BY_URL = "Widget.getByUrl";
 
-    @Id @Column(name="id")
+    @Id @Column(name="entity_id")
     @GeneratedValue(strategy = GenerationType.TABLE, generator = "widgetIdGenerator")
     @TableGenerator(name = "widgetIdGenerator", table = "RAVE_PORTAL_SEQUENCES", pkColumnName
= "SEQ_NAME",
             valueColumnName = "SEQ_COUNT", pkColumnValue = "widget", allocationSize = 1,
initialValue = 1)
-    private Long id;
+    private Long entityID;
 
     /*
         TODO RAVE-234: Figure out what the OpenJPA strategy is for functionality provided
by Eclisplink's @Convert
@@ -118,8 +118,8 @@ public class Widget implements BasicEnti
     public Widget() {
     }
 
-    public Widget(Long id, String url) {
-        this.id = id;
+    public Widget(Long entityID, String url) {
+        this.entityID = entityID;
         this.url = url;
     }
 
@@ -129,13 +129,13 @@ public class Widget implements BasicEnti
      * @return id The ID of persisted object; null if not persisted
      */
     @Override
-    public Long getId() {
-        return id;
+    public Long getEntityId() {
+        return entityID;
     }
 
     @Override
-    public void setId(Long id) {
-        this.id = id;
+    public void setEntityId(Long entityId) {
+        this.entityID = entityId;
     }
 
     //See TODO RAVE-234
@@ -221,7 +221,7 @@ public class Widget implements BasicEnti
             return false;
         }
         final Widget other = (Widget) obj;
-        if (this.id != other.id && (this.id == null || !this.id.equals(other.id)))
{
+        if (this.entityID != other.entityID && (this.entityID == null || !this.entityID.equals(other.entityID)))
{
             return false;
         }
         return true;
@@ -230,14 +230,14 @@ public class Widget implements BasicEnti
     @Override
     public int hashCode() {
         int hash = 7;
-        hash = 97 * hash + (this.id != null ? this.id.hashCode() : 0);
+        hash = 97 * hash + (this.entityID != null ? this.entityID.hashCode() : 0);
         return hash;
     }
 
     @Override
     public String toString() {
         return "Widget{" +
-                "id=" + id +
+                "entityId=" + entityID +
                 ", title='" + title + '\'' +
                 ", url='" + url + '\'' +
                 ", thumbnailUrl='" + thumbnailUrl + '\'' +

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/service/impl/DefaultPageService.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/service/impl/DefaultPageService.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/service/impl/DefaultPageService.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/service/impl/DefaultPageService.java
Thu Sep 15 14:48:35 2011
@@ -19,27 +19,27 @@
 
 package org.apache.rave.portal.service.impl;
 
-import java.util.ArrayList;
 import org.apache.rave.persistence.Repository;
 import org.apache.rave.portal.model.Page;
+import org.apache.rave.portal.model.PageLayout;
 import org.apache.rave.portal.model.Region;
 import org.apache.rave.portal.model.RegionWidget;
+import org.apache.rave.portal.model.User;
 import org.apache.rave.portal.model.Widget;
+import org.apache.rave.portal.repository.PageLayoutRepository;
 import org.apache.rave.portal.repository.PageRepository;
 import org.apache.rave.portal.repository.RegionRepository;
 import org.apache.rave.portal.repository.RegionWidgetRepository;
 import org.apache.rave.portal.repository.WidgetRepository;
 import org.apache.rave.portal.service.PageService;
+import org.apache.rave.portal.service.UserService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.ArrayList;
 import java.util.List;
-import org.apache.rave.portal.model.PageLayout;
-import org.apache.rave.portal.model.User;
-import org.apache.rave.portal.repository.PageLayoutRepository;
-import org.apache.rave.portal.service.UserService;
-import org.springframework.beans.factory.annotation.Value;
 
 @Service
 public class DefaultPageService implements PageService {
@@ -114,7 +114,7 @@ public class DefaultPageService implemen
 
         //TODO RAVE-237:  We should be able to delete these lines.  If there are gaps in
the sequence numbers, then it will still
         //TODO RAVE-237:  return values in the correct order.  We only need to update sequences
when there is a change in order
-        List<Page> pages = pageRepository.getAllPages(user.getId());
+        List<Page> pages = pageRepository.getAllPages(user.getEntityId());
         updatePageRenderSequences(pages);
     }    
     
@@ -136,7 +136,7 @@ public class DefaultPageService implemen
     public Region removeWidgetFromPage(long regionWidgetId) {
         RegionWidget widget = getFromRepository(regionWidgetId, regionWidgetRepository);
         regionWidgetRepository.delete(widget);
-        return getFromRepository(widget.getRegion().getId(), regionRepository);
+        return getFromRepository(widget.getRegion().getEntityId(), regionRepository);
     }
 
     @Override
@@ -201,7 +201,7 @@ public class DefaultPageService implemen
         }
 
         // Create a Page object and register it.
-        long renderSequence = getAllPages(user.getId()).size() + 1;
+        long renderSequence = getAllPages(user.getEntityId()).size() + 1;
         Page page = new Page();
         page.setName(pageName);       
         page.setOwner(user);
@@ -243,7 +243,7 @@ public class DefaultPageService implemen
         // get all of the user's pages
         // the pageRepository returns an un-modifiable list
         // so we need to create a modifyable arraylist
-        List<Page> pages = new ArrayList<Page>(pageRepository.getAllPages(user.getId()));
+        List<Page> pages = new ArrayList<Page>(pageRepository.getAllPages(user.getEntityId()));
 
         // first remove it from the list         
         if (!pages.remove(movingPage)) {
@@ -280,7 +280,7 @@ public class DefaultPageService implemen
 
     private static RegionWidget findRegionWidgetById(Long id, List<RegionWidget> regionWidgets)
{
         for (RegionWidget widget : regionWidgets) {
-            if (widget.getId().equals(id)) {
+            if (widget.getEntityId().equals(id)) {
                 return widget;
             }
         }

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/PageController.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/PageController.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/PageController.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/PageController.java
Thu Sep 15 14:48:35 2011
@@ -25,16 +25,16 @@ import org.apache.rave.portal.service.Us
 import org.apache.rave.portal.web.util.ModelKeys;
 import org.apache.rave.portal.web.util.ViewNames;
 import org.apache.rave.provider.opensocial.config.OpenSocialEnvironment;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 
 import java.util.List;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMethod;
 
 /**
  * Page Controller
@@ -62,7 +62,7 @@ public class PageController {
     @RequestMapping(value = {"/page/view", "/index.html"}, method = RequestMethod.GET)
     public String viewDefault(Model model) {
         User user = userService.getAuthenticatedUser();
-        List<Page> pages = pageService.getAllPages(user.getId());
+        List<Page> pages = pageService.getAllPages(user.getEntityId());
         model.addAttribute(ModelKeys.PAGE, pages.get(0));
         model.addAttribute(ModelKeys.PAGES, pages);
         model.addAttribute(ModelKeys.OPENSOCIAL_ENVIRONMENT, openSocialEnvironment);
@@ -74,7 +74,7 @@ public class PageController {
         User user = userService.getAuthenticatedUser();
         logger.debug("attempting to get pageId " + pageId + " for " + user);
         
-        List<Page> pages = pageService.getAllPages(user.getId());
+        List<Page> pages = pageService.getAllPages(user.getEntityId());
         Page page = pageService.getPageFromList(pageId, pages);
                
         model.addAttribute(ModelKeys.PAGE, page);

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/opensocial/service/impl/EncryptedBlobSecurityTokenService.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/opensocial/service/impl/EncryptedBlobSecurityTokenService.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/opensocial/service/impl/EncryptedBlobSecurityTokenService.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/opensocial/service/impl/EncryptedBlobSecurityTokenService.java
Thu Sep 15 14:48:35 2011
@@ -19,7 +19,11 @@
 
 package org.apache.rave.provider.opensocial.service.impl;
 
-import org.apache.rave.portal.model.*;
+import org.apache.rave.portal.model.Page;
+import org.apache.rave.portal.model.Region;
+import org.apache.rave.portal.model.RegionWidget;
+import org.apache.rave.portal.model.User;
+import org.apache.rave.portal.model.Widget;
 import org.apache.rave.portal.service.UserService;
 import org.apache.rave.provider.opensocial.exception.SecurityTokenException;
 import org.apache.rave.provider.opensocial.service.SecurityTokenService;
@@ -132,7 +136,7 @@ public class EncryptedBlobSecurityTokenS
         SecurityToken securityToken = this.decryptSecurityToken(encryptedSecurityToken);
 
         //Make sure the person is authorized to refresh this token
-        String userId = String.valueOf(userService.getAuthenticatedUser().getId());
+        String userId = String.valueOf(userService.getAuthenticatedUser().getEntityId());
         if (!securityToken.getViewerId().equalsIgnoreCase(userId)) {
             throw new SecurityTokenException("Illegal attempt by user " + userId +
                     " to refresh security token with a viewerId of " + securityToken.getViewerId());
@@ -153,9 +157,9 @@ public class EncryptedBlobSecurityTokenS
 
         BlobCrypterSecurityToken securityToken = new BlobCrypterSecurityToken(blobCrypter,
container, domain);
         securityToken.setAppUrl(regionWidget.getWidget().getUrl());
-        securityToken.setModuleId(regionWidget.getId());
-        securityToken.setOwnerId(String.valueOf(regionWidget.getRegion().getPage().getOwner().getId()));
-        securityToken.setViewerId(String.valueOf(user.getId()));
+        securityToken.setModuleId(regionWidget.getEntityId());
+        securityToken.setOwnerId(String.valueOf(regionWidget.getRegion().getPage().getOwner().getEntityId()));
+        securityToken.setViewerId(String.valueOf(user.getEntityId()));
         securityToken.setTrustedJson("");
 
         if (logger.isTraceEnabled()) {

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/opensocial/web/renderer/OpenSocialWidgetRenderer.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/opensocial/web/renderer/OpenSocialWidgetRenderer.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/opensocial/web/renderer/OpenSocialWidgetRenderer.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/opensocial/web/renderer/OpenSocialWidgetRenderer.java
Thu Sep 15 14:48:35 2011
@@ -91,7 +91,7 @@ public class OpenSocialWidgetRenderer im
             }
         }
 
-        return String.format(IFRAME_MARKUP, Constants.WIDGET_TYPE, item.getId(), item.getWidget().getUrl(),
+        return String.format(IFRAME_MARKUP, Constants.WIDGET_TYPE, item.getEntityId(), item.getWidget().getUrl(),
                 securityTokenService.getEncryptedSecurityToken(item),
                 openSocialService.getGadgetMetadata(item.getWidget().getUrl()), userPrefs.toString(),
item.isCollapsed());
     }

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/w3c/service/impl/WookieWidgetService.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/w3c/service/impl/WookieWidgetService.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/w3c/service/impl/WookieWidgetService.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/w3c/service/impl/WookieWidgetService.java
Thu Sep 15 14:48:35 2011
@@ -54,7 +54,7 @@ public class WookieWidgetService impleme
     private Widget getWidgetForViewer(Widget widget, String context, User viewer){
         try {
             connectorService = getWookieConnectorService(WOOKIE_SERVER_URL, WOOKIE_API_KEY,
context);
-            org.apache.wookie.connector.framework.User user = new org.apache.wookie.connector.framework.User(String.valueOf(viewer.getId()),
viewer.getUsername());
+            org.apache.wookie.connector.framework.User user = new org.apache.wookie.connector.framework.User(String.valueOf(viewer.getEntityId()),
viewer.getUsername());
             connectorService.setCurrentUser(user);
             
             System.out.println("Getting widget:"+widget.getUrl()+" from:" +connectorService.getConnection().getURL());

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/w3c/web/renderer/W3cWidgetRenderer.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/w3c/web/renderer/W3cWidgetRenderer.java?rev=1171119&r1=1171118&r2=1171119&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/w3c/web/renderer/W3cWidgetRenderer.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/provider/w3c/web/renderer/W3cWidgetRenderer.java
Thu Sep 15 14:48:35 2011
@@ -68,6 +68,6 @@ public class W3cWidgetRenderer implement
         }
         Widget contextualizedWidget = widgetService.getWidget(null, null, widget);
         String url = contextualizedWidget == null ? null : contextualizedWidget.getUrl();
-        return String.format(IFRAME_MARKUP, WIDGET_TYPE, item.getId(), url);
+        return String.format(IFRAME_MARKUP, WIDGET_TYPE, item.getEntityId(), url);
     }
 }



Mime
View raw message