portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r295120 - in /portals/jetspeed-2/trunk/components/page-manager: ./ src/java/JETSPEED-INF/ojb/ src/java/org/apache/jetspeed/page/impl/ src/test/ src/test/org/apache/jetspeed/page/
Date Wed, 05 Oct 2005 21:34:49 GMT
Author: taylor
Date: Wed Oct  5 14:34:46 2005
New Revision: 295120

URL: http://svn.apache.org/viewcvs?rev=295120&view=rev
Log:
starting back on (finally) the DB Page Manager 

Added:
    portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/
    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/page/impl/DelegatingPageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/OldDatabasePageManager.java
      - copied, changed from r292229, portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
Removed:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
Modified:
    portals/jetspeed-2/trunk/components/page-manager/maven.xml
    portals/jetspeed-2/trunk/components/page-manager/project.xml

Modified: portals/jetspeed-2/trunk/components/page-manager/maven.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/maven.xml?rev=295120&r1=295119&r2=295120&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/maven.xml (original)
+++ portals/jetspeed-2/trunk/components/page-manager/maven.xml Wed Oct  5 14:34:46 2005
@@ -16,7 +16,7 @@
 -->
 <project default="java:jar" xmlns:j="jelly:core" xmlns:define="jelly:define">
 
-    <property name='testcase' value='org.apache.jetspeed.components.portletentity.TestPortletEntityAccessComponent'
/>
+    <property name='testcase' value='org.apache.jetspeed.page.TestDatabasePageManager'
/>
 
     <preGoal name="test:test">
         <copy todir="target/testdata">

Modified: portals/jetspeed-2/trunk/components/page-manager/project.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/project.xml?rev=295120&r1=295119&r2=295120&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/project.xml (original)
+++ portals/jetspeed-2/trunk/components/page-manager/project.xml Wed Oct  5 14:34:46 2005
@@ -68,11 +68,64 @@
         <dependency>
             <id>jetspeed2:jetspeed-profiler</id>
             <version>${jetspeed.version}</version>
-        </dependency>
+        </dependency>        
         <!-- Testing only -->
         <dependency>
+            <id>jetspeed2:jetspeed-portal-site</id>
+            <version>${jetspeed.version}</version>
+        </dependency>
+        <dependency>
+          <id>jetspeed-cm</id>
+          <groupId>jetspeed2</groupId>
+          <version>${jetspeed.version}</version>
+        </dependency>  	  	                
+        <dependency>
             <id>jetspeed2:jetspeed-rdbms</id>
             <version>${jetspeed.version}</version>
         </dependency>
     </dependencies>
+    
+  <build>
+    <sourceDirectory>src/java</sourceDirectory>
+	<unitTestSourceDirectory>${basedir}/src/test</unitTestSourceDirectory>
+
+        <unitTest>
+            <resources>
+                <resource>
+                    <directory>${basedir}/src/test</directory>
+                    <excludes>
+                        <exclude>**/*.java</exclude>
+                    </excludes>
+                </resource>
+                <resource>
+                    <directory>${basedir}/src/java</directory>
+                    <excludes>
+                        <exclude>**/*.java</exclude>
+                        <exclude>**/JETSPEED-INF/**</exclude>
+                    </excludes>
+                </resource>
+                <resource>
+                    <directory>${basedir}/../../etc/log4j</directory>
+                </resource>
+                <resource>
+                    <directory>${basedir}/../../etc/db-ojb</directory>
+                </resource>
+                <resource>
+                    <directory>${basedir}/../../src/webapp/WEB-INF/assembly</directory>
+                </resource>
+            </resources>
+        </unitTest>
+    
+    
+    <resources>
+      <resource>
+        <directory>${basedir}/src/java</directory>
+        <excludes>
+          <exclude>**/*.java</exclude>
+        </excludes>
+      </resource>
+    </resources>
+    
+  </build>
+    
 </project>

Added: 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=295120&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml
(added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml
Wed Oct  5 14:34:46 2005
@@ -0,0 +1,71 @@
+<!--
+Copyright [year] The Apache Software Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!--
+    - Folder
+-->
+
+<descriptor-repository version="1.0">
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.folder.impl.FolderImpl"
+      table="FOLDER"
+   >
+      <field-descriptor
+         name="id"
+         column="FOLDER_ID"
+         jdbc-type="VARCHAR"
+         primarykey="true"
+         autoincrement="false"
+      />
+
+      <reference-descriptor
+          name="parent"
+          class-ref="org.apache.jetspeed.om.folder.impl.FolderImpl"
+          auto-delete="true"
+          auto-update = "false"
+          auto-retrieve = "false"
+          >
+         <foreignkey field-ref="parentId"/>
+      </reference-descriptor>
+
+      <field-descriptor
+         name="title"
+         column="TITLE"
+         jdbc-type="VARCHAR"
+      />
+    </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.psml.PageImpl"
+      table="PAGE"
+   >
+      <field-descriptor
+         name="id"
+         column="PAGE_ID"
+         jdbc-type="VARCHAR"
+         primarykey="true"
+         autoincrement="false"
+      />
+
+      <field-descriptor
+         name="title"
+         column="TITLE"
+         jdbc-type="VARCHAR"
+      />
+    </class-descriptor>
+
+
+</descriptor-repository>

Added: 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/impl/DelegatingPageManager.java?rev=295120&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DelegatingPageManager.java
(added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DelegatingPageManager.java
Wed Oct  5 14:34:46 2005
@@ -0,0 +1,152 @@
+package org.apache.jetspeed.page.impl;
+
+import org.apache.jetspeed.exception.JetspeedException;
+import org.apache.jetspeed.idgenerator.IdGenerator;
+import org.apache.jetspeed.om.folder.Folder;
+import org.apache.jetspeed.om.folder.FolderNotFoundException;
+import org.apache.jetspeed.om.folder.InvalidFolderException;
+import org.apache.jetspeed.om.page.ContentPage;
+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;
+
+
+/**
+ * DelegatingPageManager
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+
+public class DelegatingPageManager extends AbstractPageManager
+{
+
+    DelegatingPageManager(
+            IdGenerator generator, 
+            boolean isPermissionsSecurity, 
+            boolean isConstraintsSecurity)
+    {
+        super(generator, isPermissionsSecurity, isConstraintsSecurity);
+    }
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#getPage(java.lang.String)
+     */
+    public Page getPage(String id) throws PageNotFoundException, NodeException
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#getContentPage(java.lang.String)
+     */
+    public ContentPage getContentPage(String path)
+            throws PageNotFoundException, NodeException
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#getLink(java.lang.String)
+     */
+    public Link getLink(String name) throws DocumentNotFoundException,
+            UnsupportedDocumentTypeException, FolderNotFoundException,
+            NodeException
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#getPageSecurity()
+     */
+    public PageSecurity getPageSecurity() throws DocumentNotFoundException,
+            UnsupportedDocumentTypeException, FolderNotFoundException,
+            NodeException
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#getFolder(java.lang.String)
+     */
+    public Folder getFolder(String folderPath) throws FolderNotFoundException,
+            InvalidFolderException, NodeException
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#updatePage(org.apache.jetspeed.om.page.Page)
+     */
+    public void updatePage(Page page) throws JetspeedException,
+            PageNotUpdatedException
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#removePage(org.apache.jetspeed.om.page.Page)
+     */
+    public void removePage(Page page) throws JetspeedException,
+            PageNotRemovedException
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#updateFolder(org.apache.jetspeed.om.folder.Folder)
+     */
+    public void updateFolder(Folder folder) throws JetspeedException,
+            FolderNotUpdatedException
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#removeFolder(org.apache.jetspeed.om.folder.Folder)
+     */
+    public void removeFolder(Folder folder) throws JetspeedException,
+            FolderNotRemovedException
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#updateLink(org.apache.jetspeed.om.page.Link)
+     */
+    public void updateLink(Link link) throws JetspeedException,
+            LinkNotUpdatedException
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#removeLink(org.apache.jetspeed.om.page.Link)
+     */
+    public void removeLink(Link link) throws JetspeedException,
+            LinkNotRemovedException
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+}

Copied: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/OldDatabasePageManager.java
(from r292229, 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/OldDatabasePageManager.java?p2=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/OldDatabasePageManager.java&p1=portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java&r1=292229&r2=295120&rev=295120&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/OldDatabasePageManager.java
Wed Oct  5 14:34:46 2005
@@ -16,13 +16,11 @@
 package org.apache.jetspeed.page.impl;
 
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.jetspeed.components.persistence.store.Filter;
-import org.apache.jetspeed.components.persistence.store.PersistenceStore;
+import org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport;
 import org.apache.jetspeed.exception.JetspeedException;
 import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.folder.Folder;
@@ -35,10 +33,8 @@
 import org.apache.jetspeed.page.PageNotFoundException;
 import org.apache.jetspeed.page.PageNotRemovedException;
 import org.apache.jetspeed.page.PageNotUpdatedException;
-import org.apache.jetspeed.page.document.DocumentException;
 import org.apache.jetspeed.page.document.DocumentNotFoundException;
 import org.apache.jetspeed.page.document.NodeException;
-import org.apache.jetspeed.page.document.NodeSet;
 
 /**
  * DatabasePageManagerService
@@ -46,32 +42,23 @@
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
  * @version $Id$
  */
-public class DatabasePageManager extends AbstractPageManager implements PageManager
+public class OldDatabasePageManager extends AbstractPageManager implements PageManager
 {
     protected final static Log log = LogFactory.getLog(DatabasePageManager.class);
-    private PersistenceStore persistenceStore;
+    
     // TODO: this should eventually use a system cach like JCS
     private Map pageCache = new HashMap();
 
     /**
-     * 
-     * @param pContainer
-     *            PersistenceStoreContainer that will be used to look up the
-     *            <code>PersistenceStore</code> to use for persistence
-     *            operations
      * @param generator
      *            ID generator that will be used to generate unique page ids
-     * @param storeName
-     *            Name of the <code>PersistenceStore</code> that will be used
-     *            by the
-     *            <code>PersistenceStoreContainer.getStoreForThread(String)</code>
-     *            method to obtain the current persistence for this thread.
      */
-    public DatabasePageManager( PersistenceStore persistenceStore, IdGenerator generator
)
+    public OldDatabasePageManager(
+            IdGenerator generator, 
+            boolean isPermissionsSecurity, 
+            boolean isConstraintsSecurity)
     {
-        super(generator, false, false);
-        this.persistenceStore = persistenceStore;
-
+        super(generator, isPermissionsSecurity, isConstraintsSecurity);
     }
 
     /*
@@ -87,18 +74,18 @@
         }
         else
         {
-            Filter filter = persistenceStore.newFilter();
-            filter.addEqualTo("id", id);
-            Object q = persistenceStore.newQuery(pageClass, filter);
-            persistenceStore.getTransaction().begin();
-            Page page = (Page) persistenceStore.getObjectByQuery(q);
-            if (page == null)
-            {
-                throw new PageNotFoundException("Jetspeed PSML page not found: " + id);
-            }
+//            Filter filter = persistenceStore.newFilter();
+//            filter.addEqualTo("id", id);
+//            Object q = persistenceStore.newQuery(pageClass, filter);
+//            persistenceStore.getTransaction().begin();
+//            Page page = (Page) persistenceStore.getObjectByQuery(q);
+//            if (page == null)
+//            {
+//                throw new PageNotFoundException("Jetspeed PSML page not found: " + id);
+//            }
 
-            pageCache.put(id, page);
-            return page;
+//            pageCache.put(id, page);
+            return null;
         }
     }
 
@@ -134,9 +121,9 @@
         // update page
         try
         {
-            persistenceStore.getTransaction().begin();
-            persistenceStore.lockForWrite(page);
-            persistenceStore.getTransaction().commit();
+//            persistenceStore.getTransaction().begin();
+//            persistenceStore.lockForWrite(page);
+//            persistenceStore.getTransaction().commit();
         }
         catch (Exception e)
         {
@@ -166,9 +153,9 @@
         }
         try
         {
-            persistenceStore.getTransaction().begin();
-            persistenceStore.deletePersistent(page);
-            persistenceStore.getTransaction().commit();
+//            persistenceStore.getTransaction().begin();
+//            persistenceStore.deletePersistent(page);
+//            persistenceStore.getTransaction().commit();
         }
         catch (Exception e)
         {

Added: portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml?rev=295120&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml Wed
Oct  5 14:34:46 2005
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<!--
+Copyright 2004 The Apache Software Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<beans>
+
+    <!-- ID Generator -->
+    <bean id="IdGenerator" class="org.apache.jetspeed.idgenerator.JetspeedIdGenerator"
init-method="start" destroy-method="stop">
+        <!-- ID Start value -->
+        <constructor-arg index="0">
+            <value>65536</value>
+        </constructor-arg>
+        <!-- ID Prefix -->
+        <constructor-arg index="1">
+            <value>P-</value>
+        </constructor-arg>
+        <!-- ID Suffix -->
+        <constructor-arg index="2">
+            <value></value>
+        </constructor-arg>
+    </bean>
+
+  <bean 
+       id="org.apache.jetspeed.page.PageManagerImpl" 
+       name="pageManagerImpl"
+       init-method="init"
+       class="org.apache.jetspeed.page.impl.DatabasePageManager">         
+        <constructor-arg index="0">
+            <value>JETSPEED-INF/ojb/page-manager-repository.xml</value>
+        </constructor-arg>       
+       <constructor-arg index="1"><ref bean="IdGenerator"/></constructor-arg>
+       <!-- permissions security enabled flag, default=false -->
+       <constructor-arg index="2"><value>false</value></constructor-arg>
+       <!-- constraints security enabled flag, default=true -->
+       <constructor-arg index="3"><value>false</value></constructor-arg>
+  </bean>
+
+    <!-- Proxying -->
+    <bean id="org.apache.jetspeed.page.PageManager" name="pageManager" parent="baseTransactionProxy">
+        <property name="proxyInterfaces">
+            <value>org.apache.jetspeed.page.PageManager</value>
+        </property>
+        <property name="target">
+            <ref bean="pageManagerImpl" />
+        </property>
+        <property name="transactionAttributes">
+            <props>
+                <prop key="*">PROPAGATION_SUPPORTS</prop>
+            </props>
+        </property>
+    </bean>
+
+
+</beans>

Added: 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=295120&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
(added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
Wed Oct  5 14:34:46 2005
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.page;
+
+import org.apache.jetspeed.components.test.AbstractSpringTestCase;
+import org.apache.jetspeed.om.folder.Folder;
+import org.apache.jetspeed.om.page.Page;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * TestPageXmlPersistence
+ * 
+ * @author <a href="taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ *          
+ */
+public class TestDatabasePageManager extends AbstractSpringTestCase
+{
+    private PageManager pageManager;
+    
+    public static void main(String args[])
+    {
+        junit.awtui.TestRunner.main(new String[]
+        { TestDatabasePageManager.class.getName() });
+    }
+    
+    protected void setUp() throws Exception
+    {
+        super.setUp();        
+        pageManager = (PageManager)ctx.getBean("pageManager");        
+    }
+    
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestDatabasePageManager.class);
+    }
+    
+    protected String[] getConfigurations()
+    {
+        return new String[]
+        { "database-page-manager.xml", "transaction.xml" };
+    }
+
+    protected String[] getBootConfigurations()
+    {
+        return new String[]
+        { "test-repository-datasource-spring.xml" };
+    }
+
+    public void testPages()
+    throws Exception
+    {
+        System.out.println("************ creating test data");
+        createTestData();
+        try
+        {
+            Page page = pageManager.getPage("/notfound.psml");
+        }
+        catch (PageNotFoundException e)
+        {
+            System.out.println("Page " + "/notfound.psml");
+            return;
+        }
+        fail("should have got a page not found error");
+        
+        try
+        {
+            Folder folder = pageManager.getFolder("/");
+        }
+        catch (PageNotFoundException e)
+        {
+            fail("should have found root page");                    
+        }
+        dropTestData();        
+    }
+    
+//    public void testFolders()
+//    throws Exception
+//    {
+//        Folder folder = pageManager.getFolder("/");
+//    }
+    
+    private void createTestData()
+    {
+        try
+        {
+            Folder folder = pageManager.newFolder("/");
+            folder.setTitle("Root");
+            pageManager.updateFolder(folder);
+            
+        }
+        catch (Exception e)
+        {
+            fail("could not add root folder");
+        }
+    }
+    
+    private void dropTestData()
+    {
+        try
+        {
+            Folder root = pageManager.getFolder("/");
+            assertNotNull("folder should be found", root);
+            pageManager.removeFolder(root);
+            
+        }
+        catch (Exception e)
+        {
+            fail("could not remove root folder");
+        }
+        
+    }
+}
\ 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