portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r330470 - in /portals/jetspeed-2/trunk/components/page-manager/src: java/org/apache/jetspeed/page/document/impl/NodeAttributes.java test/org/apache/jetspeed/page/TestDatabasePageManager.java
Date Thu, 03 Nov 2005 05:46:39 GMT
Author: rwatler
Date: Wed Nov  2 21:46:32 2005
New Revision: 330470

URL: http://svn.apache.org/viewcvs?rev=330470&view=rev
Log:
correct subsite path/field mapping

Modified:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeAttributes.java
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeAttributes.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeAttributes.java?rev=330470&r1=330469&r2=330470&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeAttributes.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeAttributes.java
Wed Nov  2 21:46:32 2005
@@ -79,7 +79,8 @@
             StringBuffer newPath = new StringBuffer();
             if ((subsite != NONE) && (subsite.length() > 0))
             {
-                newPath.append(Folder.SUBSITE_FOLDER);
+                newPath.append(Folder.PATH_SEPARATOR);
+                newPath.append(Folder.RESERVED_SUBSITE_FOLDER_PREFIX);
                 newPath.append(subsite.toLowerCase());
             }
             if ((user != NONE) && (user.length() > 0))
@@ -231,20 +232,20 @@
                         locale = pathElement.toLowerCase();
                     }
                 }
-                else if (attributeName.startsWith(Folder.RESERVED_SUBSITE_FOLDER_PREFIX))
-                {
-                    subsite = pathElement.toLowerCase();
-                }
                 else if (attributeName.startsWith(Folder.RESERVED_FOLDER_PREFIX))
                 {
-                    extendedAttributeName = attributeName.substring(1);
+                    extendedAttributeName = attributeName.substring(Folder.RESERVED_FOLDER_PREFIX.length());
                     extendedAttributeValue = pathElement.toLowerCase();
                 }
 
                 // reset attribute name
                 attributeName = null;
             }
-            else if (pathElement.startsWith(Folder.RESERVED_FOLDER_PREFIX) || pathElement.startsWith(Folder.RESERVED_SUBSITE_FOLDER_PREFIX))
+            else if (pathElement.startsWith(Folder.RESERVED_SUBSITE_FOLDER_PREFIX))
+            {
+                subsite = pathElement.substring(Folder.RESERVED_SUBSITE_FOLDER_PREFIX.length()).toLowerCase();
+            }
+            else if (pathElement.startsWith(Folder.RESERVED_FOLDER_PREFIX))
             {
                 // save attribute name
                 attributeName = pathElement.toLowerCase();

Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java?rev=330470&r1=330469&r2=330470&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
Wed Nov  2 21:46:32 2005
@@ -118,7 +118,6 @@
             Folder folder = pageManager.newFolder("/");
             folder.setTitle("Root Folder");
             folder.setDefaultPage("default-page.psml");
-            folder.setDefaultTheme("Blue Theme");
             folder.setShortTitle("Root");
             GenericMetadata metadata = folder.getMetadata();
             metadata.addField(Locale.FRENCH, "title", "[fr] Root Folder");
@@ -192,8 +191,8 @@
             pageManager.removeFolder(folder);
 
             // test folder/page creation with attributes
-            String testAttributesPath = "/__custom/subsiteX/_user/userX/_role/roleX/_group/groupX/_mediatype/xhtml/_language/en/_country/us/_custom/customX";
-            String verifyTestAttributesPath = "/__subsite-root/subsitex/_user/userx/_role/rolex/_group/groupx/_mediatype/xhtml/_language/en/_country/us/_custom/customx";
+            String testAttributesPath = "/__subsite-rootX/_user/userX/_role/roleX/_group/groupX/_mediatype/xhtml/_language/en/_country/us/_custom/customX";
+            String verifyTestAttributesPath = "/__subsite-rootx/_user/userx/_role/rolex/_group/groupx/_mediatype/xhtml/_language/en/_country/us/_custom/customx";
             folder = pageManager.newFolder(testAttributesPath);
             pageManager.updateFolder(folder);
             assertNull(folder.getParent());



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message