portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r326351 - in /portals/jetspeed-2/trunk/components: page-manager/src/java/JETSPEED-INF/ojb/ page-manager/src/java/org/apache/jetspeed/om/page/ page-manager/src/java/org/apache/jetspeed/om/page/impl/ page-manager/src/java/org/apache/jetspeed/...
Date Wed, 19 Oct 2005 03:15:01 GMT
Author: rwatler
Date: Tue Oct 18 20:14:45 2005
New Revision: 326351

URL: http://svn.apache.org/viewcvs?rev=326351&view=rev
Log:
- Move Content*Impl, AbstractPageManager, and DelegatingPageManager to top level packages
- Correct small DatabasePageManager implementation details


Added:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java
      - copied, changed from r326290, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentFragmentImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java
      - copied, changed from r326290, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentPageImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
      - copied, changed from r326290, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/AbstractPageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java
      - copied, changed from r326290, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DelegatingPageManager.java
Removed:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentFragmentImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentPageImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/AbstractPageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DelegatingPageManager.java
Modified:
    portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/OldDatabasePageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java
    portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/window/TestWindows.java

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml?rev=326351&r1=326350&r2=326351&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml
Tue Oct 18 20:14:45 2005
@@ -123,6 +123,7 @@
 
       <collection-descriptor
           name="fragments"
+          element-class-ref="org.apache.jetspeed.om.page.impl.FragmentImpl"
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
@@ -198,13 +199,13 @@
       />
 
       <field-descriptor
-         name="extLocatorName"
+         name="extendedLocatorName"
          column="EXT_LOCATOR_NAME"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="extLocatorValue"
+         name="extendedLocatorValue"
          column="EXT_LOCATOR_VALUE"
          jdbc-type="VARCHAR"
       />

Copied: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java
(from r326290, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentFragmentImpl.java)
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java?p2=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java&p1=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentFragmentImpl.java&r1=326290&r2=326351&rev=326351&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentFragmentImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java
Tue Oct 18 20:14:45 2005
@@ -1,4 +1,4 @@
-package org.apache.jetspeed.om.page.psml;
+package org.apache.jetspeed.om.page;
 
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -12,9 +12,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.aggregator.PortletContent;
 import org.apache.jetspeed.om.common.SecurityConstraints;
-import org.apache.jetspeed.om.page.ContentFragment;
-import org.apache.jetspeed.om.page.Fragment;
-import org.apache.jetspeed.om.page.Property;
 
 public class ContentFragmentImpl implements ContentFragment
 {

Copied: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java
(from r326290, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentPageImpl.java)
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java?p2=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java&p1=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentPageImpl.java&r1=326290&r2=326351&rev=326351&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentPageImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java
Tue Oct 18 20:14:45 2005
@@ -1,4 +1,4 @@
-package org.apache.jetspeed.om.page.psml;
+package org.apache.jetspeed.om.page;
 
 import java.util.HashMap;
 import java.util.List;
@@ -7,11 +7,6 @@
 
 import org.apache.jetspeed.om.common.GenericMetadata;
 import org.apache.jetspeed.om.common.SecurityConstraints;
-import org.apache.jetspeed.om.page.ContentFragment;
-import org.apache.jetspeed.om.page.ContentPage;
-import org.apache.jetspeed.om.page.Defaults;
-import org.apache.jetspeed.om.page.Fragment;
-import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.page.document.Node;
 
 public class ContentPageImpl implements ContentPage

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageImpl.java?rev=326351&r1=326350&r2=326351&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageImpl.java
Tue Oct 18 20:14:45 2005
@@ -34,6 +34,13 @@
     private String skin;
     private String decorator;
     private String defaultFragmentDecorator;
+    private String subsite;
+    private String principal;
+    private String principalType;
+    private String mediatype;
+    private String locale;
+    private String extendedLocatorName;
+    private String extendedLocatorValue;
 
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Page#getDefaultSkin()

Copied: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
(from r326290, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/AbstractPageManager.java)
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java?p2=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java&p1=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/AbstractPageManager.java&r1=326290&r2=326351&rev=326351&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/AbstractPageManager.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
Tue Oct 18 20:14:45 2005
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jetspeed.page.impl;
+package org.apache.jetspeed.page;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -37,9 +37,6 @@
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.Property;
-import org.apache.jetspeed.page.PageManager;
-import org.apache.jetspeed.page.PageManagerEventListener;
-import org.apache.jetspeed.page.PageNotUpdatedException;
 import org.apache.jetspeed.page.document.Node;
 import org.apache.jetspeed.portalsite.MenuElement;
 

Copied: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java
(from r326290, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DelegatingPageManager.java)
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java?p2=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java&p1=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DelegatingPageManager.java&r1=326290&r2=326351&rev=326351&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DelegatingPageManager.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/DelegatingPageManager.java
Tue Oct 18 20:14:45 2005
@@ -1,4 +1,4 @@
-package org.apache.jetspeed.page.impl;
+package org.apache.jetspeed.page;
 
 import java.util.Map;
 
@@ -10,13 +10,6 @@
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageSecurity;
-import org.apache.jetspeed.page.FolderNotRemovedException;
-import org.apache.jetspeed.page.FolderNotUpdatedException;
-import org.apache.jetspeed.page.LinkNotRemovedException;
-import org.apache.jetspeed.page.LinkNotUpdatedException;
-import org.apache.jetspeed.page.PageNotFoundException;
-import org.apache.jetspeed.page.PageNotRemovedException;
-import org.apache.jetspeed.page.PageNotUpdatedException;
 import org.apache.jetspeed.page.document.DocumentNotFoundException;
 import org.apache.jetspeed.page.document.NodeException;
 import org.apache.jetspeed.page.document.UnsupportedDocumentTypeException;
@@ -31,14 +24,14 @@
 
 public class DelegatingPageManager extends AbstractPageManager
 {
-
-    DelegatingPageManager(
+    public DelegatingPageManager(
             boolean isPermissionsSecurity, 
             boolean isConstraintsSecurity,
             Map modelClasses)
     {
         super(isPermissionsSecurity, isConstraintsSecurity, modelClasses);
     }
+
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getPage(java.lang.String)
      */

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java?rev=326351&r1=326350&r2=326351&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java
Tue Oct 18 20:14:45 2005
@@ -18,6 +18,7 @@
 import java.util.Locale;
 
 import org.apache.jetspeed.om.common.GenericMetadata;
+import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.page.impl.BaseElementImpl;
 import org.apache.jetspeed.page.document.Node;
 
@@ -32,6 +33,31 @@
     private NodeImpl parent;
     private String path;
 
+    /**
+     * setName
+     *
+     * @param name element name
+     */
+    public void setName(String name)
+    {
+        // set path based on name
+        if (name != null)
+        {
+            if (path != null)
+            {
+                if (!name.equals(Folder.PATH_SEPARATOR))
+                {
+                    path = path.substring(0, path.lastIndexOf(Folder.PATH_SEPARATOR) + 1)
+ name;
+                }
+                else
+                {
+                    path = Folder.PATH_SEPARATOR;
+                }
+            }
+            super.setName(name);
+        }
+    }
+
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.document.Node#getParent()
      */
@@ -61,7 +87,30 @@
      */
     public void setPath(String path)
     {
+        // cleanup paths
+        if ((path == null) || (path.length() == 0))
+        {
+            path = Folder.PATH_SEPARATOR;
+        }
+        if (!path.startsWith(Folder.PATH_SEPARATOR))
+        {
+            path = Folder.PATH_SEPARATOR + path;
+        }
+        if (path.endsWith(Folder.PATH_SEPARATOR) && !path.equals(Folder.PATH_SEPARATOR))
+        {
+            path = path.substring(0, path.length() - 1);
+        }
         this.path = path;
+
+        // set name based on path
+        if (!path.equals(Folder.PATH_SEPARATOR))
+        {
+            super.setName(path.substring(path.lastIndexOf(Folder.PATH_SEPARATOR) + 1));
+        }
+        else
+        {
+            super.setName(Folder.PATH_SEPARATOR);
+        }
     }
 
     /* (non-Javadoc)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java?rev=326351&r1=326350&r2=326351&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
Tue Oct 18 20:14:45 2005
@@ -24,6 +24,7 @@
 import org.apache.jetspeed.om.page.Property;
 import org.apache.jetspeed.om.page.impl.FragmentImpl;
 import org.apache.jetspeed.om.page.impl.PageImpl;
+import org.apache.jetspeed.page.DelegatingPageManager;
 import org.apache.jetspeed.page.FolderNotRemovedException;
 import org.apache.jetspeed.page.FolderNotUpdatedException;
 import org.apache.jetspeed.page.LinkNotRemovedException;
@@ -195,15 +196,15 @@
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getPage(java.lang.String)
      */
-    public Page getPage(String id) throws PageNotFoundException, NodeException
+    public Page getPage(String path) throws PageNotFoundException, NodeException
     {
-        Criteria filter = new Criteria();        
-        filter.addEqualTo("id", id);
+        Criteria filter = new Criteria();
+        filter.addEqualTo("path", path);
         QueryByCriteria query = QueryFactory.newQuery(PageImpl.class, filter);
         Page page = (Page) getPersistenceBrokerTemplate().getObjectByQuery(query);
         if (page == null)
         {
-            throw new PageNotFoundException("Page " + id + " not found.");
+            throw new PageNotFoundException("Page " + path + " not found.");
         }
         return page;
     }
@@ -246,8 +247,15 @@
     public Folder getFolder(String folderPath) throws FolderNotFoundException,
             InvalidFolderException, NodeException
     {
-        // TODO Auto-generated method stub
-        return null;
+        Criteria filter = new Criteria();
+        filter.addEqualTo("path", folderPath);
+        QueryByCriteria query = QueryFactory.newQuery(FolderImpl.class, filter);
+        Folder folder = (Folder) getPersistenceBrokerTemplate().getObjectByQuery(query);
+        if (folder == null)
+        {
+            throw new FolderNotFoundException("Folder " + folderPath + " not found.");
+        }
+        return folder;
     }
 
     /* (non-Javadoc)
@@ -267,8 +275,9 @@
     public void removePage(Page page) throws JetspeedException,
             PageNotRemovedException
     {
-        // TODO Auto-generated method stub
-
+        System.out.println("deleting page " + page.getPath());
+        getPersistenceBrokerTemplate().delete(page);
+        System.out.println("**** deleted page " + page.getPath());        
     }
 
     /* (non-Javadoc)
@@ -288,7 +297,9 @@
     public void removeFolder(Folder folder) throws JetspeedException,
             FolderNotRemovedException
     {
+        System.out.println("deleting folder " + folder.getPath());
         getPersistenceBrokerTemplate().delete(folder);
+        System.out.println("**** deleted folder " + folder.getPath());        
     }
 
     /* (non-Javadoc)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/OldDatabasePageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/OldDatabasePageManager.java?rev=326351&r1=326350&r2=326351&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/OldDatabasePageManager.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/OldDatabasePageManager.java
Tue Oct 18 20:14:45 2005
@@ -24,10 +24,11 @@
 import org.apache.jetspeed.exception.JetspeedException;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.page.ContentPage;
+import org.apache.jetspeed.om.page.ContentPageImpl;
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageSecurity;
-import org.apache.jetspeed.om.page.psml.ContentPageImpl;
+import org.apache.jetspeed.page.AbstractPageManager;
 import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.page.PageNotFoundException;
 import org.apache.jetspeed.page.PageNotRemovedException;

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java?rev=326351&r1=326350&r2=326351&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
Tue Oct 18 20:14:45 2005
@@ -39,17 +39,18 @@
 import org.apache.jetspeed.om.folder.psml.MenuOptionsDefinitionImpl;
 import org.apache.jetspeed.om.folder.psml.MenuSeparatorDefinitionImpl;
 import org.apache.jetspeed.om.page.ContentPage;
+import org.apache.jetspeed.om.page.ContentPageImpl;
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageSecurity;
-import org.apache.jetspeed.om.page.psml.ContentPageImpl;
 import org.apache.jetspeed.om.page.psml.FragmentImpl;
 import org.apache.jetspeed.om.page.psml.LinkImpl;
 import org.apache.jetspeed.om.page.psml.PageImpl;
 import org.apache.jetspeed.om.page.psml.PropertyImpl;
 import org.apache.jetspeed.om.page.psml.SecurityConstraintImpl;
 import org.apache.jetspeed.om.page.psml.SecurityConstraintsImpl;
+import org.apache.jetspeed.page.AbstractPageManager;
 import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.page.PageNotFoundException;
 import org.apache.jetspeed.page.document.DocumentHandlerFactory;
@@ -59,7 +60,6 @@
 import org.apache.jetspeed.page.document.NodeException;
 import org.apache.jetspeed.page.document.UnsupportedDocumentTypeException;
 import org.apache.jetspeed.page.document.psml.NodeSetImpl;
-import org.apache.jetspeed.page.impl.AbstractPageManager;
 
 /**
  * This service is responsible for loading and saving PSML pages serialized to

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=326351&r1=326350&r2=326351&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
Tue Oct 18 20:14:45 2005
@@ -17,6 +17,7 @@
 
 import org.apache.jetspeed.components.test.AbstractSpringTestCase;
 import org.apache.jetspeed.om.folder.Folder;
+import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.page.Page;
 
 import junit.framework.Test;
@@ -43,6 +44,13 @@
     {
         super.setUp();        
         pageManager = (PageManager)ctx.getBean("pageManager");        
+        createTestData();
+    }
+
+    protected void tearDown() throws Exception
+    {
+        dropTestData();
+        super.tearDown();
     }
     
     public static Test suite()
@@ -63,38 +71,40 @@
         { "test-repository-datasource-spring.xml" };
     }
 
-    public void testPages()
-    throws Exception
+    public void testPages() throws Exception
     {
-        System.out.println("************ creating test data");
-        createTestData();
+        boolean pageNotFound = false;
         try
         {
             Page page = pageManager.getPage("/notfound.psml");
         }
         catch (PageNotFoundException e)
         {
-            System.out.println("Page " + "/notfound.psml");
-            return;
+            pageNotFound = true;
         }
-        fail("should have got a page not found error");
+        assertTrue("should have got a page not found error", pageNotFound);
         
         try
         {
-            Folder folder = pageManager.getFolder("/");
+            Page page = pageManager.getPage("/default-page.psml");
         }
         catch (PageNotFoundException e)
         {
-            fail("should have found root page");                    
+            fail("should have found root default page");                    
         }
-        dropTestData();        
     }
     
-//    public void testFolders()
-//    throws Exception
-//    {
-//        Folder folder = pageManager.getFolder("/");
-//    }
+    public void testFolders() throws Exception
+    {
+        try
+        {
+            Folder folder = pageManager.getFolder("/");
+        }
+        catch (FolderNotFoundException e)
+        {
+            fail("should have found root folder");                    
+        }
+    }
     
     private void createTestData()
     {
@@ -103,10 +113,13 @@
             Folder folder = pageManager.newFolder("/");
             folder.setTitle("Root");
             pageManager.updateFolder(folder);
+            Page page = pageManager.newPage("/default-page.psml");
+            page.setTitle("Default Page");
+            pageManager.updatePage(page);
         }
         catch (Exception e)
         {
-            fail("could not add root folder: "+e);
+            fail("could not create test data: "+e);
         }
     }
     
@@ -114,14 +127,13 @@
     {
         try
         {
-            Folder root = pageManager.getFolder("/");
-            assertNotNull("folder should be found", root);
-            pageManager.removeFolder(root);
+            Folder folder = pageManager.getFolder("/");
+            assertNotNull("folder should be found", folder);
+            pageManager.removeFolder(folder);
         }
         catch (Exception e)
         {
-            fail("could not remove root folder: "+e);
+            fail("could not remove test data: "+e);
         }
-        
     }
 }

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java?rev=326351&r1=326350&r2=326351&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
Tue Oct 18 20:14:45 2005
@@ -34,7 +34,7 @@
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.Property;
-import org.apache.jetspeed.om.page.psml.ContentFragmentImpl;
+import org.apache.jetspeed.om.page.ContentFragmentImpl;
 import org.apache.jetspeed.request.RequestContext;
 
 /**

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java?rev=326351&r1=326350&r2=326351&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/profiler/impl/ProfilerValveImpl.java
Tue Oct 18 20:14:45 2005
@@ -26,7 +26,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.jetspeed.om.page.psml.ContentPageImpl;
+import org.apache.jetspeed.om.page.ContentPageImpl;
 import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.page.document.NodeNotFoundException;
 import org.apache.jetspeed.pipeline.PipelineException;

Modified: portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/window/TestWindows.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/window/TestWindows.java?rev=326351&r1=326350&r2=326351&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/window/TestWindows.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/window/TestWindows.java
Tue Oct 18 20:14:45 2005
@@ -29,7 +29,7 @@
 import org.apache.jetspeed.om.common.portlet.MutablePortletEntity;
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.om.page.Fragment;
-import org.apache.jetspeed.om.page.psml.ContentFragmentImpl;
+import org.apache.jetspeed.om.page.ContentFragmentImpl;
 import org.apache.pluto.om.window.PortletWindow;
 import org.apache.pluto.om.window.PortletWindowList;
 import org.apache.pluto.om.window.PortletWindowListCtrl;
@@ -169,4 +169,4 @@
         }
     }
 
-}
\ No newline at end of file
+}



---------------------------------------------------------------------
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