portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r219058 - in /portals/jetspeed-2/trunk: components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/ components/page-manager/src/java/org/apache/jetspeed/page/document/ components/page-manager/src/java/org/apache/jetspeed/page/impl/...
Date Thu, 14 Jul 2005 16:29:32 GMT
Author: rwatler
Date: Thu Jul 14 09:29:27 2005
New Revision: 219058

URL: http://svn.apache.org/viewcvs?rev=219058&view=rev
Log:
rounded out page manager update/remove operations for links and folders

Added:
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotRemovedException.java   (with props)
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotUpdatedException.java   (with props)
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotRemovedException.java   (with props)
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotUpdatedException.java   (with props)
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToDeleteFolderException.java   (with props)
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToUpdateFolderException.java   (with props)
Modified:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/CastorFileSystemDocumentHandler.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/FileSystemFolderHandler.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/CastorXmlPageManager.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/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Link.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java?rev=219058&r1=219057&r2=219058&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java Thu Jul 14 09:29:27 2005
@@ -96,6 +96,13 @@
         setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
     }
 
+    public FolderImpl()
+    {
+        this.metadata = new FolderMetaDataImpl();
+        this.metadata.setParent(this);
+        setReservedType();
+    }
+
     /*
      * (non-Javadoc)
      * 
@@ -485,7 +492,7 @@
      */
     public NodeSet getAllNodes() throws FolderNotFoundException, DocumentException
     {
-        if(allNodes == null)
+        if((allNodes == null) && (folderHandler != null))
         {            
             if(metadata.getDocumentOrder() != null)
             {
@@ -503,8 +510,6 @@
                 allNodes = new NodeSetImpl(getPath());
             }
             
-            //DocumentHandler docHandler = getHandlerFactory().getDocumentHandler(documentType);
-
             String[] nodeNames = folderHandler.listAll(getPath());
             for (int i = 0; i < nodeNames.length; i++)
             {
@@ -565,6 +570,19 @@
     {
         return metadata;
     }
+
+    /**
+     * <p>
+     * setFolderHandler
+     * </p>
+     *
+     * @param handler folder handler
+     */
+    public void setFolderHandler(FolderHandler handler)
+    {
+        this.folderHandler = handler;
+    }
+
     /**
      * <p>
      * getMetadata

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/CastorFileSystemDocumentHandler.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/CastorFileSystemDocumentHandler.java?rev=219058&r1=219057&r2=219058&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/CastorFileSystemDocumentHandler.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/CastorFileSystemDocumentHandler.java Thu Jul 14 09:29:27 2005
@@ -550,6 +550,9 @@
         }
         File file = new File(this.documentRootDir, fileName);
         file.delete();
+
+        // remove from cache
+        fileCache.remove(path);
     }
 
     /**

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/FileSystemFolderHandler.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/FileSystemFolderHandler.java?rev=219058&r1=219057&r2=219058&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/FileSystemFolderHandler.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/FileSystemFolderHandler.java Thu Jul 14 09:29:27 2005
@@ -215,6 +215,129 @@
 
     /**
      * <p>
+     * updateFolder
+     * </p>
+     * 
+     * @see org.apache.jetspeed.page.document.FolderHandler#updateFolder(org.apache.jetspeed.om.folder.Folder)
+     * @param folder
+     * @throws FailedToUpdateFolderException
+     */
+    public void updateFolder(Folder folder) throws FailedToUpdateFolderException
+    {
+        // sanity checks
+        if (folder == null)
+        {
+            log.warn("Recieved null Folder to update");
+            return;
+        }
+        String path = folder.getPath();
+        if (path == null)
+        {
+            path = folder.getId();
+            if (path == null)
+            {
+                log.warn("Recieved Folder with null path/id to update");
+                return;
+            }
+            folder.setPath(path);
+        }
+
+        // setup folder implementation
+        FolderImpl folderImpl = (FolderImpl)folder;
+        folderImpl.setFolderHandler(this);
+        folderImpl.setHandlerFactory(handlerFactory);
+        folderImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
+        folderImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
+        folderImpl.marshalling();
+
+        // create underlying folder if it does not exist
+        File folderFile = new File(documentRootDir, path);
+        if ((folderFile.exists() && !folderFile.isDirectory()) || (!folderFile.exists() && !folderFile.mkdir()))
+        {
+            throw new FailedToUpdateFolderException(folderFile.getAbsolutePath()+" does not exist and cannot be created.");
+        }
+
+        // update metadata
+        try
+        {
+            FolderMetaData metadata = folder.getFolderMetaData();
+            metadata.setPath(path + Folder.PATH_SEPARATOR + FolderMetaData.DOCUMENT_TYPE);
+            metadata.setId(metadata.getPath());
+            metadataDocHandler.updateDocument(metadata);
+        }
+        catch (Exception e)
+        {
+            throw new FailedToUpdateFolderException(folderFile.getAbsolutePath()+" failed to update folder.metadata", e);
+        }
+
+        // add to cache
+        addToCache(path, folder);
+    }
+
+    /**
+     * <p>
+     * removeFolder
+     * </p>
+     * 
+     * @see org.apache.jetspeed.page.document.FolderHandler#removeFolder(org.apache.jetspeed.om.folder.Folder)
+     * @param folder
+     * @throws FailedToDeleteFolderException
+     */
+    public void removeFolder(Folder folder) throws FailedToDeleteFolderException
+    {
+        // sanity checks
+        if (folder == null)
+        {
+            log.warn("Recieved null Folder to remove");
+            return;
+        }
+        String path = folder.getPath();
+        if (path == null)
+        {
+            path = folder.getId();
+            if (path == null)
+            {
+                log.warn("Recieved Folder with null path/id to remove");
+                return;
+            }
+            folder.setPath(path);
+        }
+
+        // remove underlying folder if it exists and is empty,
+        // (other than metadata document)
+        File folderFile = new File(this.documentRootDir, path);
+        File metadataFile = null;
+        if ((folder.getFolderMetaData() != null) && (folder.getFolderMetaData().getPath() != null))
+        {
+            metadataFile = new File(this.documentRootDir, folder.getFolderMetaData().getPath());
+        }
+        if (folderFile.exists() && folderFile.isDirectory())
+        {
+            // test to make sure folder empty
+            File [] folderContents = folderFile.listFiles();
+            if ((folderContents.length > 0) &&
+                ((folderContents.length > 1) || (metadataFile == null) || !folderContents[0].getName().equals(metadataFile.getName())))
+            {
+                throw new FailedToDeleteFolderException(folderFile.getAbsolutePath()+" folder not empty.");
+            }
+
+            // delete folder and metadata
+            if ((metadataFile != null) && metadataFile.exists() && !metadataFile.delete())
+            {
+                throw new FailedToDeleteFolderException(folderFile.getAbsolutePath()+" folder metadata cannot be deleted.");
+            }
+            if (!folderFile.delete())
+            {
+                throw new FailedToDeleteFolderException(folderFile.getAbsolutePath()+" folder cannot be deleted.");
+            }
+        }
+
+        // remove from cache
+        fileCache.remove(path);
+    }
+
+    /**
+     * <p>
      * getFolders
      * </p>
      * 

Modified: 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/impl/AbstractPageManager.java?rev=219058&r1=219057&r2=219058&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/impl/AbstractPageManager.java Thu Jul 14 09:29:27 2005
@@ -23,20 +23,24 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.common.SecuredResource;
+import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.MenuDefinition;
 import org.apache.jetspeed.om.folder.MenuExcludeDefinition;
 import org.apache.jetspeed.om.folder.MenuIncludeDefinition;
 import org.apache.jetspeed.om.folder.MenuOptionsDefinition;
 import org.apache.jetspeed.om.folder.MenuSeparatorDefinition;
+import org.apache.jetspeed.om.folder.impl.FolderImpl;
 import org.apache.jetspeed.om.folder.impl.MenuDefinitionImpl;
 import org.apache.jetspeed.om.folder.impl.MenuExcludeDefinitionImpl;
 import org.apache.jetspeed.om.folder.impl.MenuIncludeDefinitionImpl;
 import org.apache.jetspeed.om.folder.impl.MenuOptionsDefinitionImpl;
 import org.apache.jetspeed.om.folder.impl.MenuSeparatorDefinitionImpl;
 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.Property;
 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.page.PageManager;
@@ -56,6 +60,8 @@
     
     protected Class fragmentClass = FragmentImpl.class;
     protected Class pageClass = PageImpl.class;
+    protected Class folderClass = FolderImpl.class;
+    protected Class linkClass = LinkImpl.class;
     protected Class propertyClass = PropertyImpl.class;
     protected Class menuDefinitionClass = MenuDefinitionImpl.class;
     protected Class menuExcludeDefinitionClass = MenuExcludeDefinitionImpl.class;
@@ -124,16 +130,25 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#newPage()
+     * @see org.apache.jetspeed.page.PageManager#newPage(java.lang.String)
      */
-    public Page newPage()
+    public Page newPage(String path)
     {
         Page page = null;
         try
         {
-            // factory create the page
+            // factory create the page and set id/path
             page = (Page)createObject(this.pageClass);            
-            page.setId(generator.getNextPeid());
+            if (!path.startsWith(Folder.PATH_SEPARATOR))
+            {
+                path = Folder.PATH_SEPARATOR + path;
+            }
+            if (!path.endsWith(Page.DOCUMENT_TYPE))
+            {
+                path += Page.DOCUMENT_TYPE;
+            }
+            page.setPath(path);
+            page.setId(path);
             
             // create the default fragment
             Fragment fragment = (Fragment)createObject(this.fragmentClass);
@@ -147,6 +162,60 @@
             log.error(message, e);
         }
         return page;        
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#newFolder(java.lang.String)
+     */
+    public Folder newFolder(String path)
+    {
+        Folder folder = null;
+        try
+        {
+            // factory create the folder and set id/path
+            folder = (Folder)createObject(this.folderClass);            
+            if (!path.startsWith(Folder.PATH_SEPARATOR))
+            {
+                path = Folder.PATH_SEPARATOR + path;
+            }
+            folder.setPath(path);
+            folder.setId(path);
+        }
+        catch (ClassCastException e)
+        {
+            String message = "Failed to create link object for " + this.linkClass;
+            log.error(message, e);
+        }
+        return folder;        
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#newLink(java.lang.String)
+     */
+    public Link newLink(String path)
+    {
+        Link link = null;
+        try
+        {
+            // factory create the page and set id/path
+            link = (Link)createObject(this.linkClass);            
+            if (!path.startsWith(Folder.PATH_SEPARATOR))
+            {
+                path = Folder.PATH_SEPARATOR + path;
+            }
+            if (!path.endsWith(Link.DOCUMENT_TYPE))
+            {
+                path += Link.DOCUMENT_TYPE;
+            }
+            link.setPath(path);
+            link.setId(path);
+        }
+        catch (ClassCastException e)
+        {
+            String message = "Failed to create link object for " + this.linkClass;
+            log.error(message, e);
+        }
+        return link;        
     }
     
     /* (non-Javadoc)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/CastorXmlPageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/CastorXmlPageManager.java?rev=219058&r1=219057&r2=219058&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/CastorXmlPageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/CastorXmlPageManager.java Thu Jul 14 09:29:27 2005
@@ -36,6 +36,8 @@
 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.LinkImpl;
+import org.apache.jetspeed.om.page.psml.PageImpl;
 import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.page.PageNotFoundException;
 import org.apache.jetspeed.page.document.DocumentHandlerFactory;
@@ -118,12 +120,12 @@
 
     /**
      * <p>
-     * registerPage
+     * updatePage
      * </p>
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#registerPage(org.apache.jetspeed.om.page.Page)
+     * @see org.apache.jetspeed.services.page.PageManagerService#updatePage(org.apache.jetspeed.om.page.Page)
      */
-    public void registerPage(Page page) throws JetspeedException
+    public void updatePage(Page page) throws JetspeedException
     {
         // unwrap page to be registered
         if (page instanceof ContentPageImpl)
@@ -132,22 +134,6 @@
         }
 
         // make sure path and related members are set
-        boolean newPageRegistered = false;
-        if ((page.getPath() == null) && (page.getId() != null))
-        {
-            String path = page.getId();
-            if (!path.startsWith(Folder.PATH_SEPARATOR))
-            {
-                path = Folder.PATH_SEPARATOR + path;
-            }
-            if (!path.endsWith(Page.DOCUMENT_TYPE))
-            {
-                path += Page.DOCUMENT_TYPE;
-            }
-            page.setId(path);
-            page.setPath(path);
-            newPageRegistered = true;
-        }
         if (page.getPath() != null)
         {
             if (!page.getPath().equals(page.getId()))
@@ -162,22 +148,35 @@
             return;
         }
 
+        // set parent
+        boolean newPage = false;
+        FolderImpl parentFolder = getNodeFolder(page.getPath());
+        if (page.getParent() == null)
+        {
+            page.setParent(parentFolder);
+            newPage = true;
+        }
+
+        // enable permissions/constraints
+        PageImpl pageImpl = (PageImpl)page;
+        pageImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
+        pageImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
+
         // check for edit access
         page.checkAccess(SecuredResource.EDIT_ACTION);
 
-        // register page
+        // update page
         handlerFactory.getDocumentHandler(Page.DOCUMENT_TYPE).updateDocument(page);
 
         // update folder
-        FolderImpl folder = getNodeFolder(page.getPath());
-        if (!folder.getAllNodes().contains(page))
+        if ((parentFolder != null) && !parentFolder.getAllNodes().contains(page))
         {
-            folder.getAllNodes().add(page);
+            parentFolder.getAllNodes().add(page);
+            newPage = true;
         }
-        page.setParent(folder);
 
         // notify page manager listeners
-        if (newPageRegistered)
+        if (newPage)
         {
             notifyNewNode(page);
         }
@@ -189,24 +188,6 @@
 
     /**
      * <p>
-     * updatePage
-     * </p>
-     * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#updatePage(org.apache.jetspeed.om.page.Page)
-     */
-    public void updatePage(Page page) throws JetspeedException
-    {
-        // unwrap page to be updated
-        if (page instanceof ContentPageImpl)
-        {
-            page = ((ContentPageImpl)page).getPage();
-        }
-
-        registerPage(page);
-    }
-
-    /**
-     * <p>
      * removePage
      * </p>
      * 
@@ -257,6 +238,92 @@
 
     /**
      * <p>
+     * updateLink
+     * </p>
+     * 
+     * @see org.apache.jetspeed.services.page.PageManagerService#updateLink(org.apache.jetspeed.om.page.Link)
+     */
+    public void updateLink(Link link) throws JetspeedException
+    {
+        // make sure path and related members are set
+        if (link.getPath() != null)
+        {
+            if (!link.getPath().equals(link.getId()))
+            {
+                log.error("Link paths and ids must match!");
+                return;
+            }
+        }
+        else
+        {
+            log.error("Link paths and ids must be set!");
+            return;
+        }
+
+        // set parent
+        boolean newLink = false;
+        FolderImpl parentFolder = getNodeFolder(link.getPath());
+        if (link.getParent() == null)
+        {
+            link.setParent(parentFolder);
+            newLink = true;
+        }
+
+        // enable permissions/constraints
+        LinkImpl linkImpl = (LinkImpl)link;
+        linkImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
+        linkImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
+
+        // check for edit access
+        link.checkAccess(SecuredResource.EDIT_ACTION);
+
+        // update link
+        handlerFactory.getDocumentHandler(Link.DOCUMENT_TYPE).updateDocument(link);
+
+        // update folder
+        if ((parentFolder != null) && !parentFolder.getAllNodes().contains(link))
+        {
+            parentFolder.getAllNodes().add(link);
+            newLink = true;
+        }
+
+        // notify page manager listeners
+        if (newLink)
+        {
+            notifyNewNode(link);
+        }
+        else
+        {
+            notifyUpdatedNode(link);
+        }
+    }
+
+    /**
+     * <p>
+     * removeLink
+     * </p>
+     * 
+     * @see org.apache.jetspeed.services.page.PageManagerService#removeLink(org.apache.jetspeed.om.page.Link)
+     */
+    public void removeLink(Link link) throws JetspeedException
+    {
+        // check for edit access
+        link.checkAccess(SecuredResource.EDIT_ACTION);
+
+        // remove link
+        handlerFactory.getDocumentHandler(Link.DOCUMENT_TYPE).removeDocument(link);
+
+        // update folder
+        FolderImpl folder = getNodeFolder(link.getPath());
+        ((NodeSetImpl)folder.getAllNodes()).remove(link);
+        link.setParent(null);
+
+        // notify page manager listeners
+        notifyRemovedNode(link);
+    }
+
+    /**
+     * <p>
      * getPageSecurity
      * </p>
      * 
@@ -292,6 +359,92 @@
         Folder folder = folderHandler.getFolder(folderPath);
         folder.checkAccess(SecuredResource.VIEW_ACTION);
         return folder;
+    }
+
+    /**
+     * <p>
+     * updateFolder
+     * </p>
+     * 
+     * @see org.apache.jetspeed.services.page.PageManagerService#updateFolder(org.apache.jetspeed.om.folder.Folder)
+     */
+    public void updateFolder(Folder folder) throws JetspeedException
+    {
+        // make sure path and related members are set
+        if (folder.getPath() != null)
+        {
+            if (!folder.getPath().equals(folder.getId()))
+            {
+                log.error("Folder paths and ids must match!");
+                return;
+            }
+        }
+        else
+        {
+            log.error("Folder paths and ids must be set!");
+            return;
+        }
+
+        // set parent
+        boolean newFolder = false;
+        FolderImpl parentFolder = getNodeFolder(folder.getPath());
+        if (folder.getParent() == null)
+        {
+            folder.setParent(parentFolder);
+            newFolder = true;
+        }
+
+        // enable permissions/constraints
+        FolderImpl folderImpl = (FolderImpl)folder;
+        folderImpl.setPermissionsEnabled(handlerFactory.getPermissionsEnabled());
+        folderImpl.setConstraintsEnabled(handlerFactory.getConstraintsEnabled());
+
+        // check for edit access
+        folder.checkAccess(SecuredResource.EDIT_ACTION);
+
+        // update folder
+        folderHandler.updateFolder(folder);
+
+        // update parent folder
+        if ((parentFolder != null) && !parentFolder.getAllNodes().contains(folder))
+        {
+            parentFolder.getAllNodes().add(folder);
+            newFolder = true;
+        }
+
+        // notify page manager listeners
+        if (newFolder)
+        {
+            notifyNewNode(folder);
+        }
+        else
+        {
+            notifyUpdatedNode(folder);
+        }
+    }
+
+    /**
+     * <p>
+     * removeFolder
+     * </p>
+     * 
+     * @see org.apache.jetspeed.services.page.PageManagerService#removeFolder(org.apache.jetspeed.om.folder.Folder)
+     */
+    public void removeFolder(Folder folder) throws JetspeedException
+    {
+        // check for edit access
+        folder.checkAccess(SecuredResource.EDIT_ACTION);
+
+        // remove folder
+        folderHandler.removeFolder(folder);
+
+        // update parent folder
+        FolderImpl parentFolder = getNodeFolder(folder.getPath());
+        ((NodeSetImpl)parentFolder.getAllNodes()).remove(folder);
+        folder.setParent(null);
+
+        // notify page manager listeners
+        notifyRemovedNode(folder);
     }
 
     /**

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=219058&r1=219057&r2=219058&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 Thu Jul 14 09:29:27 2005
@@ -105,29 +105,18 @@
     /*
      * (non-Javadoc)
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#listPages()
-     */
-    public List listPages()
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#registerPage(org.apache.jetspeed.om.page.Page)
+     * @see org.apache.jetspeed.services.page.PageManagerService#updatePage(org.apache.jetspeed.om.page.Page)
      */
-    public void registerPage( Page page ) throws JetspeedException
+    public void updatePage( Page page ) throws JetspeedException, PageNotUpdatedException
     {
         // sanity checks
         if (page == null)
         {
-            log.warn("Recieved null page to register");
+            log.warn("Recieved null page to update");
             return;
         }
 
-        // unwrap page to be registered
+        // unwrap page to be updated
         if (page instanceof ContentPageImpl)
         {
             page = ((ContentPageImpl)page).getPage();
@@ -135,7 +124,6 @@
 
         // register page
         String id = page.getId();
-
         if (id == null)
         {
             page.setId(generator.getNextPeid());
@@ -143,21 +131,6 @@
             log.warn("Page with no Id, created new Id : " + id);
         }
 
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#updatePage(org.apache.jetspeed.om.page.Page)
-     */
-    public void updatePage( Page page ) throws JetspeedException, PageNotUpdatedException
-    {
-        // unwrap page to be updated
-        if (page instanceof ContentPageImpl)
-        {
-            page = ((ContentPageImpl)page).getPage();
-        }
-
         // update page
         try
         {
@@ -221,6 +194,30 @@
 
     /**
      * <p>
+     * updateFolder
+     * </p>
+     * 
+     * @see org.apache.jetspeed.services.page.PageManagerService#updateFolder(org.apache.jetspeed.om.folder.Folder)
+     */
+    public void updateFolder(Folder folder) throws JetspeedException
+    {
+        throw new UnsupportedOperationException("Not supported by DB impl yet");
+    }
+
+    /**
+     * <p>
+     * removeFolder
+     * </p>
+     * 
+     * @see org.apache.jetspeed.services.page.PageManagerService#removeFolder(org.apache.jetspeed.om.folder.Folder)
+     */
+    public void removeFolder(Folder folder) throws JetspeedException
+    {
+        throw new UnsupportedOperationException("Not supported by DB impl yet");
+    }
+
+    /**
+     * <p>
      * getLink
      * </p>
      * 
@@ -230,6 +227,30 @@
      *         DocumentNotFoundException
      */
     public Link getLink( String name ) throws DocumentNotFoundException
+    {
+        throw new UnsupportedOperationException("Not supported by DB impl yet");
+    }
+
+    /**
+     * <p>
+     * updateLink
+     * </p>
+     * 
+     * @see org.apache.jetspeed.services.page.PageManagerService#updateLink(org.apache.jetspeed.om.page.Link)
+     */
+    public void updateLink(Link link) throws JetspeedException
+    {
+        throw new UnsupportedOperationException("Not supported by DB impl yet");
+    }
+
+    /**
+     * <p>
+     * removeLink
+     * </p>
+     * 
+     * @see org.apache.jetspeed.services.page.PageManagerService#removeLink(org.apache.jetspeed.om.page.Link)
+     */
+    public void removeLink(Link link) throws JetspeedException
     {
         throw new UnsupportedOperationException("Not supported by DB impl yet");
     }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java?rev=219058&r1=219057&r2=219058&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java Thu Jul 14 09:29:27 2005
@@ -34,6 +34,7 @@
 import org.apache.jetspeed.om.common.GenericMetadata;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.FolderMetaData;
+import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.folder.MenuDefinition;
 import org.apache.jetspeed.om.folder.MenuExcludeDefinition;
 import org.apache.jetspeed.om.folder.MenuIncludeDefinition;
@@ -49,6 +50,8 @@
 import org.apache.jetspeed.page.document.DocumentHandler;
 import org.apache.jetspeed.page.document.DocumentHandlerFactory;
 import org.apache.jetspeed.page.document.DocumentHandlerFactoryImpl;
+import org.apache.jetspeed.page.document.DocumentNotFoundException;
+import org.apache.jetspeed.page.document.FailedToDeleteFolderException;
 import org.apache.jetspeed.page.document.FileSystemFolderHandler;
 import org.apache.jetspeed.page.document.FolderHandler;
 import org.apache.jetspeed.page.impl.CastorXmlPageManager;
@@ -63,7 +66,13 @@
  */
 public class TestCastorXmlPageManager extends TestCase
 {
-    private String testId = "/test002.psml";
+    private String testPage002 = "/test002.psml";
+    private String testPage003 = "/test003.psml";
+    private String testPage004 = "/folder2/test004.psml";
+    private String testFolder2 = "/folder2";
+    private String testFolder3 = "/folder3";
+    private String testLink002 = "/test002.link";
+    private String testLink003 = "/test003.link";
     protected CastorXmlPageManager pageManager;
     protected DirectoryHelper dirHelper;
 
@@ -154,9 +163,11 @@
 
     public void testNewPage()
     {
-        Page testpage = pageManager.newPage();
+        Page testpage = pageManager.newPage(this.testPage003);
         assertNotNull(testpage);
         assertNotNull(testpage.getId());
+        assertNotNull(testpage.getPath());
+        assertEquals(testpage.getId(), testpage.getPath());
         assertNotNull(testpage.getRootFragment());
         assertNotNull(testpage.getRootFragment().getId());
     }
@@ -174,6 +185,24 @@
         // TODO: Fix Property manipulation API, too clumsy right now
     }
 
+    public void testNewFolder()
+    {
+        Folder testfolder = pageManager.newFolder(this.testFolder3);
+        assertNotNull(testfolder);
+        assertNotNull(testfolder.getId());
+        assertNotNull(testfolder.getPath());
+        assertEquals(testfolder.getId(), testfolder.getPath());
+    }
+
+    public void testNewLink()
+    {
+        Link testlink = pageManager.newLink(this.testLink003);
+        assertNotNull(testlink);
+        assertNotNull(testlink.getId());
+        assertNotNull(testlink.getPath());
+        assertEquals(testlink.getId(), testlink.getPath());
+    }
+
     public void testGetPage() throws Exception
     {
         Page testpage = pageManager.getPage("/test001.psml");
@@ -237,13 +266,12 @@
         assertTrue(f.getFragments().size() == 2);
     }
 
-    public void testRegisterPage() throws Exception
+    public void testCreatePage() throws Exception
     {
-        Page page = pageManager.newPage();
-        System.out.println("Retrieved test_id in register " + this.testId);
-        page.setId(this.testId);
+        Page page = pageManager.newPage(this.testPage002);
+        System.out.println("Retrieved test_id in create " + this.testPage002);
         page.setDefaultSkin("myskin");
-        page.setTitle("Registered Page");
+        page.setTitle("Created Page");
 
         Fragment root = page.getRootFragment();
         root.setName("TestLayout");
@@ -264,20 +292,20 @@
 
         try
         {
-            pageManager.registerPage(page);
+            pageManager.updatePage(page);
         }
         catch (Exception e)
         {
-            String errmsg = "Exception in page registration: " + e.toString();
+            String errmsg = "Exception in page update: " + e.toString();
             e.printStackTrace();
             System.err.println(errmsg);
             assertNotNull(errmsg, null);
         }
 
-        page = pageManager.getPage(this.testId);
+        page = pageManager.getPage(this.testPage002);
         assertNotNull(page);
-        assertTrue(page.getId().equals(this.testId));
-        assertTrue(page.getTitle().equals("Registered Page"));
+        assertTrue(page.getId().equals(this.testPage002));
+        assertTrue(page.getTitle().equals("Created Page"));
         assertNotNull(page.getRootFragment());
         assertTrue(page.getRootFragment().getName().equals("TestLayout"));
         assertTrue(page.getRootFragment().getFragments().size() == 1);
@@ -287,9 +315,58 @@
         assertTrue(((Property) f.getProperties("TestLayout").get(0)).getValue().equals("0"));
     }
 
+    public void testCreateFolder() throws Exception
+    {
+        Folder folder = pageManager.newFolder(this.testFolder2);
+        System.out.println("Retrieved test_id in create " + this.testFolder2);
+        folder.setTitle("Created Folder");
+
+        try
+        {
+            pageManager.updateFolder(folder);
+        }
+        catch (Exception e)
+        {
+            String errmsg = "Exception in folder update: " + e.toString();
+            e.printStackTrace();
+            System.err.println(errmsg);
+            assertNotNull(errmsg, null);
+        }
+
+        folder = pageManager.getFolder(this.testFolder2);
+        assertNotNull(folder);
+        assertTrue(folder.getId().equals(this.testFolder2));
+        assertTrue(folder.getTitle().equals("Created Folder"));
+    }
+
+    public void testCreateLink() throws Exception
+    {
+        Link link = pageManager.newLink(this.testLink002);
+        System.out.println("Retrieved test_id in create " + this.testLink002);
+        link.setTitle("Created Link");
+        link.setUrl("http://www.created.link.com/");
+
+        try
+        {
+            pageManager.updateLink(link);
+        }
+        catch (Exception e)
+        {
+            String errmsg = "Exception in link update: " + e.toString();
+            e.printStackTrace();
+            System.err.println(errmsg);
+            assertNotNull(errmsg, null);
+        }
+
+        link = pageManager.getLink(this.testLink002);
+        assertNotNull(link);
+        assertTrue(link.getId().equals(this.testLink002));
+        assertTrue(link.getTitle().equals("Created Link"));
+    }
+
     public void testUpdatePage() throws Exception
     {
-        Page page = pageManager.getPage(this.testId);
+        Page page = pageManager.getPage(this.testPage002);
         page.setTitle("Updated Title");
 
         try
@@ -304,10 +381,70 @@
             assertNotNull(errmsg, null);
         }
 
-        page = pageManager.getPage(this.testId);
+        page = pageManager.getPage(this.testPage002);
         assertTrue(page.getTitle().equals("Updated Title"));
     }
 
+    public void testUpdateFolder() throws Exception
+    {
+        Folder folder = pageManager.getFolder(this.testFolder2);
+        folder.setTitle("Updated Title");
+
+        try
+        {
+            pageManager.updateFolder(folder);
+        }
+        catch (Exception e)
+        {
+            String errmsg = "Exception in folder update: " + e.toString();
+            e.printStackTrace();
+            System.err.println(errmsg);
+            assertNotNull(errmsg, null);
+        }
+
+        folder = pageManager.getFolder(this.testFolder2);
+        assertTrue(folder.getTitle().equals("Updated Title"));
+
+        Page page = pageManager.newPage(this.testPage004);
+        page.setTitle("Folder Page");
+
+        try
+        {
+            pageManager.updatePage(page);
+        }
+        catch (Exception e)
+        {
+            String errmsg = "Exception in page update: " + e.toString();
+            e.printStackTrace();
+            System.err.println(errmsg);
+            assertNotNull(errmsg, null);
+        }
+
+        assertEquals(1, folder.getPages().size());
+        assertNotNull(folder.getPages().get(this.testPage004));
+    }
+
+    public void testUpdateLink() throws Exception
+    {
+        Link link = pageManager.getLink(this.testLink002);
+        link.setTitle("Updated Title");
+
+        try
+        {
+            pageManager.updateLink(link);
+        }
+        catch (Exception e)
+        {
+            String errmsg = "Exception in link update: " + e.toString();
+            e.printStackTrace();
+            System.err.println(errmsg);
+            assertNotNull(errmsg, null);
+        }
+
+        link = pageManager.getLink(this.testLink002);
+        assertTrue(link.getTitle().equals("Updated Title"));
+    }
+
     public void testFolders() throws Exception
     {
 
@@ -413,8 +550,8 @@
         Folder folder = pageManager.getFolder("/");
         assertNotNull(folder);
         assertNotNull(folder.getLinks());
-        assertEquals(folder.getLinks().size(), 1);
-        assertEquals("http://portals.apache.org", ((Document) folder.getLinks().iterator().next()).getUrl());
+        assertEquals(2,folder.getLinks().size());
+        assertEquals("http://portals.apache.org", ((Document) folder.getLinks().get("/apache_portals.link")).getUrl());
     }
 
     public void testMenuDefinitions() throws Exception
@@ -511,7 +648,7 @@
         assertEquals(2, simpleMenu.getMenuElements().size());
 
         // test writing page menu definitions
-        page = pageManager.getPage(this.testId);
+        page = pageManager.getPage(this.testPage002);
         page.setMenuDefinitions(new ArrayList());
         MenuDefinition newMenu = pageManager.newMenuDefinition();
         newMenu.setName("updated-menu");
@@ -550,7 +687,7 @@
             System.err.println(errmsg);
             assertNotNull(errmsg, null);
         }
-        page = pageManager.getPage(this.testId);
+        page = pageManager.getPage(this.testPage002);
         assertNotNull(page.getMenuDefinitions());
         assertEquals(1, page.getMenuDefinitions().size());
         assertNotNull(((MenuDefinition)page.getMenuDefinitions().get(0)).getMenuElements());
@@ -561,11 +698,38 @@
         assertTrue(((MenuDefinition)page.getMenuDefinitions().get(0)).getMenuElements().get(3) instanceof MenuDefinition);
         assertTrue(((MenuDefinition)page.getMenuDefinitions().get(0)).getMenuElements().get(4) instanceof MenuExcludeDefinition);
         assertTrue(((MenuDefinition)page.getMenuDefinitions().get(0)).getMenuElements().get(5) instanceof MenuIncludeDefinition);
+
+        // test writing folder menu definitions
+        folder = pageManager.getFolder(this.testFolder2);
+        folder.setMenuDefinitions(new ArrayList());
+        newMenu = pageManager.newMenuDefinition();
+        newMenu.setName("updated-menu");
+        newMenu.setSkin("bread-crumbs");
+        newMenu.setOptions("./");
+        newMenu.setPaths(true);
+        folder.getMenuDefinitions().add(newMenu);
+        try
+        {
+            pageManager.updateFolder(folder);
+        }
+        catch (Exception e)
+        {
+            String errmsg = "Exception in folder update: " + e.toString();
+            e.printStackTrace();
+            System.err.println(errmsg);
+            assertNotNull(errmsg, null);
+        }
+        folder = pageManager.getFolder(this.testFolder2);
+        assertNotNull(folder.getMenuDefinitions());
+        assertEquals(1, folder.getMenuDefinitions().size());
+        assertEquals("updated-menu", ((MenuDefinition)folder.getMenuDefinitions().get(0)).getName());
+        assertEquals("bread-crumbs", ((MenuDefinition)folder.getMenuDefinitions().get(0)).getSkin());
+        assertEquals("./", ((MenuDefinition)folder.getMenuDefinitions().get(0)).getOptions());
     }
 
     public void testRemovePage() throws Exception
     {
-        Page page = pageManager.getPage(this.testId);
+        Page page = pageManager.getPage(this.testPage002);
 
         try
         {
@@ -582,9 +746,89 @@
         boolean exceptionFound = false;
         try
         {
-            page = pageManager.getPage(this.testId);
+            page = pageManager.getPage(this.testPage002);
+        }
+        catch (DocumentNotFoundException dnfe)
+        {
+            exceptionFound = true;
+        }
+        assertTrue(exceptionFound);
+    }
+
+    public void testRemoveFolder() throws Exception
+    {
+        Folder folder = pageManager.getFolder(this.testFolder2);
+
+        boolean exceptionFound = false;
+        try
+        {
+            pageManager.removeFolder(folder);
+        }
+        catch (FailedToDeleteFolderException ftdfe)
+        {
+            exceptionFound = true;
+        }
+        assertTrue(exceptionFound);
+
+        Page page = pageManager.getPage(this.testPage004);
+        try
+        {
+            pageManager.removePage(page);
+        }
+        catch (Exception e)
+        {
+            String errmsg = "Exception in page remove: " + e.toString();
+            e.printStackTrace();
+            System.err.println(errmsg);
+            assertNotNull(errmsg, null);
+        }
+
+        try
+        {
+            pageManager.removeFolder(folder);
+        }
+        catch (Exception e)
+        {
+            String errmsg = "Exception in folder remove: " + e.toString();
+            e.printStackTrace();
+            System.err.println(errmsg);
+            assertNotNull(errmsg, null);
+        }
+
+        exceptionFound = false;
+        try
+        {
+            folder = pageManager.getFolder(this.testFolder2);
+        }
+        catch (FolderNotFoundException fnfe)
+        {
+            exceptionFound = true;
+        }
+        assertTrue(exceptionFound);
+    }
+
+    public void testRemoveLink() throws Exception
+    {
+        Link link = pageManager.getLink(this.testLink002);
+
+        try
+        {
+            pageManager.removeLink(link);
+        }
+        catch (Exception e)
+        {
+            String errmsg = "Exception in link remove: " + e.toString();
+            e.printStackTrace();
+            System.err.println(errmsg);
+            assertNotNull(errmsg, null);
+        }
+
+        boolean exceptionFound = false;
+        try
+        {
+            link = pageManager.getLink(this.testLink002);
         }
-        catch (PageNotFoundException pnfe)
+        catch (DocumentNotFoundException dnfe)
         {
             exceptionFound = true;
         }

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Link.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Link.java?rev=219058&r1=219057&r2=219058&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Link.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Link.java Thu Jul 14 09:29:27 2005
@@ -33,6 +33,11 @@
     String DOCUMENT_TYPE = ".link";
     
     /**
+     * @param url The url to set.
+     */
+    void setUrl( String url );
+
+    /**
      * @return Returns the target.
      */
     String getTarget();
@@ -41,4 +46,4 @@
      * @param target The target to set.
      */
     void setTarget( String target );
-}
\ No newline at end of file
+}

Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotRemovedException.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotRemovedException.java?rev=219058&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotRemovedException.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotRemovedException.java Thu Jul 14 09:29:27 2005
@@ -0,0 +1,65 @@
+/*
+ * 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.exception.JetspeedException;
+
+/**
+ * <p>
+ * FolderNotRemovedException
+ * </p>
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ *
+ */
+public class FolderNotRemovedException extends JetspeedException
+{
+
+    /**
+     * 
+     */
+    public FolderNotRemovedException()
+    {
+        super();
+    }
+
+    /**
+     * @param message
+     */
+    public FolderNotRemovedException(String message)
+    {
+        super(message);
+    }
+
+    /**
+     * @param nested
+     */
+    public FolderNotRemovedException(Throwable nested)
+    {
+        super(nested);
+    }
+
+    /**
+     * @param msg
+     * @param nested
+     */
+    public FolderNotRemovedException(String msg, Throwable nested)
+    {
+        super(msg, nested);
+    }
+
+}

Propchange: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotRemovedException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotRemovedException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotUpdatedException.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotUpdatedException.java?rev=219058&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotUpdatedException.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotUpdatedException.java Thu Jul 14 09:29:27 2005
@@ -0,0 +1,65 @@
+/*
+ * 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.exception.JetspeedException;
+
+/**
+ * <p>
+ * FolderNotUpdatedException
+ * </p>
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ *
+ */
+public class FolderNotUpdatedException extends JetspeedException
+{
+
+    /**
+     * 
+     */
+    public FolderNotUpdatedException()
+    {
+        super();
+    }
+
+    /**
+     * @param message
+     */
+    public FolderNotUpdatedException(String message)
+    {
+        super(message);
+    }
+
+    /**
+     * @param nested
+     */
+    public FolderNotUpdatedException(Throwable nested)
+    {
+        super(nested);
+    }
+
+    /**
+     * @param msg
+     * @param nested
+     */
+    public FolderNotUpdatedException(String msg, Throwable nested)
+    {
+        super(msg, nested);
+    }
+
+}

Propchange: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotUpdatedException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/FolderNotUpdatedException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotRemovedException.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotRemovedException.java?rev=219058&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotRemovedException.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotRemovedException.java Thu Jul 14 09:29:27 2005
@@ -0,0 +1,65 @@
+/*
+ * 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.exception.JetspeedException;
+
+/**
+ * <p>
+ * LinkNotRemovedException
+ * </p>
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ *
+ */
+public class LinkNotRemovedException extends JetspeedException
+{
+
+    /**
+     * 
+     */
+    public LinkNotRemovedException()
+    {
+        super();
+    }
+
+    /**
+     * @param message
+     */
+    public LinkNotRemovedException(String message)
+    {
+        super(message);
+    }
+
+    /**
+     * @param nested
+     */
+    public LinkNotRemovedException(Throwable nested)
+    {
+        super(nested);
+    }
+
+    /**
+     * @param msg
+     * @param nested
+     */
+    public LinkNotRemovedException(String msg, Throwable nested)
+    {
+        super(msg, nested);
+    }
+
+}

Propchange: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotRemovedException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotRemovedException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotUpdatedException.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotUpdatedException.java?rev=219058&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotUpdatedException.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotUpdatedException.java Thu Jul 14 09:29:27 2005
@@ -0,0 +1,65 @@
+/*
+ * 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.exception.JetspeedException;
+
+/**
+ * <p>
+ * LinkNotUpdatedException
+ * </p>
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ *
+ */
+public class LinkNotUpdatedException extends JetspeedException
+{
+
+    /**
+     * 
+     */
+    public LinkNotUpdatedException()
+    {
+        super();
+    }
+
+    /**
+     * @param message
+     */
+    public LinkNotUpdatedException(String message)
+    {
+        super(message);
+    }
+
+    /**
+     * @param nested
+     */
+    public LinkNotUpdatedException(Throwable nested)
+    {
+        super(nested);
+    }
+
+    /**
+     * @param msg
+     * @param nested
+     */
+    public LinkNotUpdatedException(String msg, Throwable nested)
+    {
+        super(msg, nested);
+    }
+
+}

Propchange: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotUpdatedException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/LinkNotUpdatedException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java?rev=219058&r1=219057&r2=219058&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java Thu Jul 14 09:29:27 2005
@@ -70,7 +70,21 @@
      *
      * @return a newly created Page object
      */
-    public Page newPage();
+    public Page newPage(String path);
+
+    /**
+     * Create a new empty Folder instance
+     *
+     * @return a newly created Folder object
+     */
+    public Folder newFolder(String path);
+
+    /**
+     * Creates a new empty Link instance
+     *
+     * @return a newly created Link object
+     */
+    public Link newLink(String path);
 
     /**
      * Creates a new empty Fragment instance
@@ -195,12 +209,6 @@
      */
     Folder getFolder(String folderPath) throws FolderNotFoundException, InvalidFolderException, NodeException;
 
-    /** Store the page on disk
-     *
-     * @param page The page to be stored.
-     */
-    public void registerPage(Page page) throws JetspeedException;
-
     /** Update a page in persistent storage
      *
      * @param page The page to be updated.
@@ -212,6 +220,30 @@
      * @param page The page to be removed.
      */
     public void removePage(Page page) throws JetspeedException, PageNotRemovedException;
+
+    /** Update a folder in persistent storage
+     *
+     * @param folder The folder to be updated.
+     */
+    public void updateFolder(Folder folder) throws JetspeedException, FolderNotUpdatedException;
+
+    /** Remove a folder.
+     *
+     * @param page The folder to be removed.
+     */
+    public void removeFolder(Folder folder) throws JetspeedException, FolderNotRemovedException;
+
+    /** Update a link in persistent storage
+     *
+     * @param link The link to be updated.
+     */
+    public void updateLink(Link link) throws JetspeedException, LinkNotUpdatedException;
+
+    /** Remove a link.
+     *
+     * @param page The link to be removed.
+     */
+    public void removeLink(Link link) throws JetspeedException, LinkNotRemovedException;
 
     /**
      * addListener - add page manager event listener

Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToDeleteFolderException.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToDeleteFolderException.java?rev=219058&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToDeleteFolderException.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToDeleteFolderException.java Thu Jul 14 09:29:27 2005
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2001,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.document;
+
+
+/**
+ * <p>
+ * FailedToDeleteFolderException
+ * </p>
+ * <p>
+ *
+ * </p>
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ *
+ */
+public class FailedToDeleteFolderException extends NodeException
+{
+
+    /**
+     * 
+     */
+    public FailedToDeleteFolderException()
+    {
+        super();
+    }
+
+    /**
+     * @param message
+     */
+    public FailedToDeleteFolderException( String message )
+    {
+        super(message);
+    }
+
+    /**
+     * @param nested
+     */
+    public FailedToDeleteFolderException( Throwable nested )
+    {
+        super(nested);
+    }
+
+    /**
+     * @param msg
+     * @param nested
+     */
+    public FailedToDeleteFolderException( String msg, Throwable nested )
+    {
+        super(msg, nested);
+    }
+
+}

Propchange: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToDeleteFolderException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToDeleteFolderException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToUpdateFolderException.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToUpdateFolderException.java?rev=219058&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToUpdateFolderException.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToUpdateFolderException.java Thu Jul 14 09:29:27 2005
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2001,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.document;
+
+
+/**
+ * <p>
+ * FailedToUpdateFolderException
+ * </p>
+ * <p>
+ *
+ * </p>
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ *
+ */
+public class FailedToUpdateFolderException extends NodeException
+{
+
+    /**
+     * 
+     */
+    public FailedToUpdateFolderException()
+    {
+        super();
+    }
+
+    /**
+     * @param message
+     */
+    public FailedToUpdateFolderException( String message )
+    {
+        super(message);
+    }
+
+    /**
+     * @param nested
+     */
+    public FailedToUpdateFolderException( Throwable nested )
+    {
+        super(nested);
+    }
+
+    /**
+     * @param msg
+     * @param nested
+     */
+    public FailedToUpdateFolderException( String msg, Throwable nested )
+    {
+        super(msg, nested);
+    }
+
+}

Propchange: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToUpdateFolderException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FailedToUpdateFolderException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java?rev=219058&r1=219057&r2=219058&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java Thu Jul 14 09:29:27 2005
@@ -51,6 +51,31 @@
      */
     Folder getFolder(String path) throws FolderNotFoundException, InvalidFolderException, NodeException;
     
+    /**
+     * 
+     * <p>
+     * updateFolder
+     * </p>
+     * <p>
+     *  Updates the folder specified with the <code>folder</code> argument.
+     * </p>
+     *
+     * @param folder folder to update
+     */
+    void updateFolder(Folder folder) throws FailedToUpdateFolderException;
+    
+    /**
+     * 
+     * <p>
+     * removeFolder
+     * </p>
+     * <p>
+     *  Removes the folder specified with the <code>folder</code> argument.
+     * </p>
+     *
+     * @param folder folder to update
+     */
+    void removeFolder(Folder folder) throws FailedToDeleteFolderException;
     
     /**
      * 



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