roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r492013 - in /incubator/roller/trunk: src/org/apache/roller/pojos/FolderData.java src/org/apache/roller/pojos/WeblogCategoryData.java tests/org/apache/roller/business/PingsTest.java
Date Wed, 03 Jan 2007 02:21:14 GMT
Author: clr
Date: Tue Jan  2 18:21:13 2007
New Revision: 492013

URL: http://svn.apache.org/viewvc?view=rev&rev=492013
Log:
Manage relationships on both sides

Modified:
    incubator/roller/trunk/src/org/apache/roller/pojos/FolderData.java
    incubator/roller/trunk/src/org/apache/roller/pojos/WeblogCategoryData.java
    incubator/roller/trunk/tests/org/apache/roller/business/PingsTest.java

Modified: incubator/roller/trunk/src/org/apache/roller/pojos/FolderData.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/pojos/FolderData.java?view=diff&rev=492013&r1=492012&r2=492013
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/pojos/FolderData.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/pojos/FolderData.java Tue Jan  2 18:21:13
2007
@@ -84,6 +84,16 @@
         } else {
             this.path = parent.getPath() + "/" + name;
         }
+
+        this.parentFolder = parent;
+        // Relationships need to be maintained from both sides
+        if(parent != null) {
+            // The following triggers this.hashCode(), which is calculated 
+            // based on this.path
+            // It needs to happen after this.path is initialized
+            parent.childFolders.add(this);
+        }
+
     }
     
     

Modified: incubator/roller/trunk/src/org/apache/roller/pojos/WeblogCategoryData.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/pojos/WeblogCategoryData.java?view=diff&rev=492013&r1=492012&r2=492013
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/pojos/WeblogCategoryData.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/pojos/WeblogCategoryData.java Tue Jan  2
18:21:13 2007
@@ -71,8 +71,7 @@
         this.image = image;
         
         this.website = website;
-        this.parentCategory = parent;
-        
+
         // calculate path
         if(parent == null) {
             this.path = "/";
@@ -81,6 +80,16 @@
         } else {
             this.path = parent.getPath() + "/" + name;
         }
+
+        this.parentCategory = parent;
+        // Relationship needs to be maintained from both sides
+        if(parent != null) {
+            // Following triggers this.hashCode(), which is calculated 
+            // based on this.path
+            // It needs to happen after this.path is initialized
+            parent.childCategories.add(this);
+        }
+
     }
     
     

Modified: incubator/roller/trunk/tests/org/apache/roller/business/PingsTest.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/business/PingsTest.java?view=diff&rev=492013&r1=492012&r2=492013
==============================================================================
--- incubator/roller/trunk/tests/org/apache/roller/business/PingsTest.java (original)
+++ incubator/roller/trunk/tests/org/apache/roller/business/PingsTest.java Tue Jan  2 18:21:13
2007
@@ -314,7 +314,9 @@
         
         // remove a collection
         List autoPings = new ArrayList();
+        autoPing2 = mgr.getAutoPing(autoPing2.getId()); //Get managed version of autoPing2
         autoPings.add(autoPing2);
+        autoPing3 = mgr.getAutoPing(autoPing3.getId()); //Get managed version of autoPing2
         autoPings.add(autoPing3);
         mgr.removeAutoPings(autoPings);
         TestUtils.endSession(true);



Mime
View raw message