portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r330500 - in /portals/jetspeed-2/trunk: components/page-manager/src/java/JETSPEED-INF/castor/ components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/ components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/ componen...
Date Thu, 03 Nov 2005 07:44:37 GMT
Author: rwatler
Date: Wed Nov  2 23:44:15 2005
New Revision: 330500

URL: http://svn.apache.org/viewcvs?rev=330500&view=rev
Log:
public API simplification for PageManager om implementations

Removed:
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/FolderMetaData.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Defaults.java
Modified:
    portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml
    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/om/folder/psml/FolderImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderMetaDataImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java
    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/om/page/psml/DefaultsImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java
    portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Page.java
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/page-manager.xml

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml?rev=330500&r1=330499&r2=330500&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml
Wed Nov  2 23:44:15 2005
@@ -176,7 +176,7 @@
 
     <field name="documentOrder"
            type="java.lang.String" 
-           collection="vector">
+           collection="collection">
       <bind-xml name="document-order"/>
     </field>    
 

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=330500&r1=330499&r2=330500&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
Wed Nov  2 23:44:15 2005
@@ -20,7 +20,6 @@
 import java.util.List;
 
 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.page.Link;
 import org.apache.jetspeed.om.page.Page;
@@ -154,35 +153,35 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.folder.Folder#getDefaultPage()
+     * @see org.apache.jetspeed.om.folder.Folder#getDocumentOrder()
      */
-    public String getDefaultPage()
+    public List getDocumentOrder()
     {
-        return defaultPage;
+        return null; //NYI
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.folder.Folder#setDefaultPage(java.lang.String)
+     * @see org.apache.jetspeed.om.folder.Folder#setDocumentOrder(java.util.List)
      */
-    public void setDefaultPage(String defaultPage)
+    public void setDocumentOrder(List docIndexes)
     {
-        this.defaultPage = defaultPage;
+        // NYI
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.folder.Folder#getDefaultTheme()
+     * @see org.apache.jetspeed.om.folder.Folder#getDefaultPage()
      */
-    public String getDefaultTheme()
+    public String getDefaultPage()
     {
-        return null; // NYI
+        return defaultPage;
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.folder.Folder#setDefaultTheme(java.lang.String)
+     * @see org.apache.jetspeed.om.folder.Folder#setDefaultPage(java.lang.String)
      */
-    public void setDefaultTheme(String defaultTheme)
+    public void setDefaultPage(String defaultPage)
     {
-        // NYI
+        this.defaultPage = defaultPage;
     }
 
     /* (non-Javadoc)
@@ -299,14 +298,6 @@
             }
         }
         return allNodeSet;
-    }
-    
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.folder.Folder#getFolderMetaData()
-     */
-    public FolderMetaData getFolderMetaData()
-    {
-        return null; // NYI
     }
     
     /* (non-Javadoc)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java?rev=330500&r1=330499&r2=330500&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
Wed Nov  2 23:44:15 2005
@@ -27,7 +27,6 @@
 import org.apache.jetspeed.om.common.SecuredResource;
 import org.apache.jetspeed.om.common.SecurityConstraints;
 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.Reset;
 import org.apache.jetspeed.om.page.Link;
@@ -60,16 +59,15 @@
 {
     private final static String FOLDER_PERMISSION_WILD_CHAR = new String(new char[]{FolderPermission.WILD_CHAR});
     
-    private String defaultTheme;
     private NodeSet allNodes;
     private File directory;
-    private FolderMetaData metadata;
+    private FolderMetaDataImpl metadata;
     private FolderHandler folderHandler;
     private int reservedType = RESERVED_FOLDER_NONE;
     
     private static final Log log = LogFactory.getLog(FolderImpl.class);
 
-    public FolderImpl( String path, FolderMetaData metadata, DocumentHandlerFactory handlerFactory,
+    public FolderImpl( String path, FolderMetaDataImpl metadata, DocumentHandlerFactory handlerFactory,
                        FolderHandler folderHandler )
     {
         this.metadata = metadata;
@@ -112,41 +110,37 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.folder.Folder#getDefaultPage()
+     * @see org.apache.jetspeed.om.folder.Folder#getDocumentOrder()
      */
-    public String getDefaultPage()
+    public List getDocumentOrder()
     {
-        return metadata.getDefaultPage();
+        return metadata.getDocumentOrder();
     }
     
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.jetspeed.om.folder.Folder#setDefaultPage()
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.Folder#setDocumentOrder(java.util.List)
      */
-    public void setDefaultPage( String defaultPage )
+    public void setDocumentOrder(List docIndexes)
     {
-        metadata.setDefaultPage(defaultPage);
+        metadata.setDocumentOrder(docIndexes);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.jetspeed.om.folder.Folder#getDefaultTheme()
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.Folder#getDefaultPage()
      */
-    public String getDefaultTheme()
+    public String getDefaultPage()
     {
-        return defaultTheme;
+        return metadata.getDefaultPage();
     }
-
+    
     /*
      * (non-Javadoc)
      * 
-     * @see org.apache.jetspeed.om.folder.Folder#setDefaultTheme()
+     * @see org.apache.jetspeed.om.folder.Folder#setDefaultPage()
      */
-    public void setDefaultTheme( String defaultTheme )
+    public void setDefaultPage( String defaultPage )
     {
-        this.defaultTheme = defaultTheme;
+        metadata.setDefaultPage(defaultPage);
     }
 
     /**
@@ -537,11 +531,10 @@
      * <p>
      * getFolderMetaData
      * </p>
-     * 
-     * @see org.apache.jetspeed.om.folder.Folder#getFolderMetaData()
-     * @return
+     *
+     * @return implementation specific folder metadata
      */
-    public FolderMetaData getFolderMetaData()
+    public FolderMetaDataImpl getFolderMetaData()
     {
         return metadata;
     }
@@ -793,24 +786,29 @@
     private void setReservedType()
     {
         String name = getName();
-        if (name != null && name.startsWith(RESERVED_FOLDER_PREFIX))            
+        if (name != null)
         {
-            if (name.equals(RESERVED_USER_FOLDER_NAME))
-                reservedType = RESERVED_FOLDER_USERS;
-            else if (name.equals(RESERVED_ROLE_FOLDER_NAME))
-                reservedType = RESERVED_FOLDER_ROLES;
-            else if (name.equals(RESERVED_GROUP_FOLDER_NAME))
-                reservedType = RESERVED_FOLDER_GROUPS;
-            else if (name.equals(RESERVED_SUBSITE_FOLDER_NAME))
+            if (name.startsWith(RESERVED_SUBSITE_FOLDER_PREFIX))
+            {
                 reservedType = RESERVED_FOLDER_SUBSITES;
-            else if (name.equals(RESERVED_MEDIATYPE_FOLDER_NAME))
-                reservedType = RESERVED_FOLDER_MEDIATYPE;
-            else if (name.equals(RESERVED_LANGUAGE_FOLDER_NAME))
-                reservedType = RESERVED_FOLDER_LANGUAGE;
-            else if (name.equals(RESERVED_COUNTRY_FOLDER_NAME))
-                reservedType = RESERVED_FOLDER_COUNTRY;
-            else
-                reservedType = RESERVED_FOLDER_OTHER;            
+            }
+            else if (name.startsWith(RESERVED_FOLDER_PREFIX))            
+            {
+                if (name.equals(RESERVED_USER_FOLDER_NAME))
+                    reservedType = RESERVED_FOLDER_USERS;
+                else if (name.equals(RESERVED_ROLE_FOLDER_NAME))
+                    reservedType = RESERVED_FOLDER_ROLES;
+                else if (name.equals(RESERVED_GROUP_FOLDER_NAME))
+                    reservedType = RESERVED_FOLDER_GROUPS;
+                else if (name.equals(RESERVED_MEDIATYPE_FOLDER_NAME))
+                    reservedType = RESERVED_FOLDER_MEDIATYPE;
+                else if (name.equals(RESERVED_LANGUAGE_FOLDER_NAME))
+                    reservedType = RESERVED_FOLDER_LANGUAGE;
+                else if (name.equals(RESERVED_COUNTRY_FOLDER_NAME))
+                    reservedType = RESERVED_FOLDER_COUNTRY;
+                else
+                    reservedType = RESERVED_FOLDER_OTHER;            
+            }
         }
     }
     

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderMetaDataImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderMetaDataImpl.java?rev=330500&r1=330499&r2=330500&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderMetaDataImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderMetaDataImpl.java
Wed Nov  2 23:44:15 2005
@@ -15,11 +15,11 @@
  */
 package org.apache.jetspeed.om.folder.psml;
 
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Vector;
 
-import org.apache.jetspeed.om.folder.FolderMetaData;
+import org.apache.jetspeed.om.page.Document;
 import org.apache.jetspeed.page.document.psml.AbstractNode;
 
 /**
@@ -34,9 +34,11 @@
  * @version $Id$
  *  
  */
-public class FolderMetaDataImpl extends AbstractNode implements FolderMetaData
+public class FolderMetaDataImpl extends AbstractNode implements Document
 {
-    private Vector docOrder;
+    public static String DOCUMENT_TYPE = "folder.metadata";
+
+    private List docOrder;
     private String defaultPage;
 
     /**
@@ -46,7 +48,7 @@
     
     public FolderMetaDataImpl()
     {
-        docOrder = new Vector();
+        docOrder = new ArrayList(4);
     }
        
     /**
@@ -54,49 +56,49 @@
      * getType
      * </p>
      *
-     * @see org.apache.jetspeed.om.page.Document#getType()
-     * @return
+     * @return document type
      */
     public String getType()
     {
         return DOCUMENT_TYPE;
     }
+
     /**
      * <p>
      * getUrl
      * </p>
      *
-     * @see org.apache.jetspeed.om.page.Document#getUrl()
-     * @return
+     * @return url of folder
      */
     public String getUrl()
     {
         return getParent(false).getPath() + PATH_SEPARATOR + getType();
     }
+
     /**
      * <p>
      * getDocumentOrder
      * </p>
      *
-     * @see org.apache.jetspeed.om.folder.FolderMetaData#getDocumentOrder()
-     * @return
+     * @return document order
      */
-    public Vector getDocumentOrder()
+    public List getDocumentOrder()
     {
         return docOrder;
     }
+
     /**
      * <p>
      * setDocumentOrder
      * </p>
      *
-     * @see org.apache.jetspeed.om.folder.FolderMetaData#setDocumentOrder(java.util.List)
      * @param docIndexes
      */
-    public void setDocumentOrder( Vector docIndexes )
+    public void setDocumentOrder(List docIndexes)
     {
         docOrder = docIndexes;
     }
+
     /**
      * @return Returns the defaultPage.
      */
@@ -104,6 +106,7 @@
     {
         return defaultPage;
     }
+
     /**
      * @param defaultPage The defaultPage to set.
      */

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java?rev=330500&r1=330499&r2=330500&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java
Wed Nov  2 23:44:15 2005
@@ -370,9 +370,4 @@
     {
         return page;
     }
-
-    public Defaults getDefaults()
-    {
-        return page.getDefaults();
-    }
 }

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=330500&r1=330499&r2=330500&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
Wed Nov  2 23:44:15 2005
@@ -20,7 +20,6 @@
 import java.util.List;
 import java.util.Stack;
 
-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.om.page.PageMetadataImpl;
@@ -202,14 +201,6 @@
     {
         // NYI
     }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.page.Page#getDefaults()
-     */
-    public Defaults getDefaults()
-    {
-        return null; // NYI
-    }    
 
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.document.Node#getType()

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/DefaultsImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/DefaultsImpl.java?rev=330500&r1=330499&r2=330500&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/DefaultsImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/DefaultsImpl.java
Wed Nov  2 23:44:15 2005
@@ -16,75 +16,100 @@
 
 package org.apache.jetspeed.om.page.psml;
 
-// Java imports
 import java.util.Map;
 import java.util.HashMap;
 
-import org.apache.jetspeed.om.page.Defaults;
+import org.apache.jetspeed.om.page.Fragment;
 
 /**
  * @version $Id$
  */
-public class DefaultsImpl implements Defaults
+public class DefaultsImpl
 {
 
     private String skin = null;
     private Map decoratorMap = new HashMap();
 
-    public DefaultsImpl()
-    {
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.page.psml.DefaultsIf#getSkin()
+    /**
+     * getSkin
+     *
+     * @return skin name used in decorators
      */
     public String getSkin()
     {
         return this.skin;
     }
 
+    /**
+     * setSkin
+     *
+     * @param skin name used in decorators
+     */
     public void setSkin(String skin)
     {
         this.skin = skin;
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.page.psml.DefaultsIf#getDecorator(java.lang.String)
+    /**
+     * getDecorator
+     *
+     * @param type Fragment.LAYOUT or Fragment.PORTLET constants
+     * @return decorator name
      */
     public String getDecorator(String type)
     {
         return (String)decoratorMap.get(type);
     }
 
+    /**
+     * setDecorator
+     *
+     * @param type Fragment.LAYOUT or Fragment.PORTLET constants
+     * @param decorator decorator name
+     */
     public void setDecorator(String type, String decorator)
     {
         decoratorMap.put(type,decorator);
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.page.psml.DefaultsIf#getLayoutDecorator()
+    /**
+     * getLayoutDecorator
+     *
+     * @return Fragment.LAYOUT decorator name
      */
     public String getLayoutDecorator()
     {
-        return getDecorator("layout");
+        return getDecorator(Fragment.LAYOUT);
     }
 
+    /**
+     * setLayoutDecorator
+     *
+     * @param decorator Fragment.LAYOUT decorator name
+     */
     public void setLayoutDecorator(String decorator)
     {
-        setDecorator("layout",decorator);
+        setDecorator(Fragment.LAYOUT,decorator);
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.page.psml.DefaultsIf#getPortletDecorator()
+    /**
+     * getPortletDecorator
+     *
+     * @return Fragment.PORTLET decorator name
      */
     public String getPortletDecorator()
     {
-        return getDecorator("portlet");
+        return getDecorator(Fragment.PORTLET);
     }
 
+    /**
+     * setPortletDecorator
+     *
+     * @param decorator Fragment.PORTLET decorator name
+     */
     public void setPortletDecorator(String decorator)
     {
-        setDecorator("portlet",decorator);
+        setDecorator(Fragment.PORTLET,decorator);
     }
 
-}
\ No newline at end of file
+}

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java?rev=330500&r1=330499&r2=330500&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java
Wed Nov  2 23:44:15 2005
@@ -21,7 +21,6 @@
 import java.util.Stack;
 
 import org.apache.jetspeed.om.folder.psml.MenuDefinitionImpl;
-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.psml.AbstractNode;
@@ -162,7 +161,7 @@
         return f;
     }
 
-    public Defaults getDefaults()
+    public DefaultsImpl getDefaults()
     {
         return this.defaults;
     }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java?rev=330500&r1=330499&r2=330500&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
Wed Nov  2 23:44:15 2005
@@ -489,10 +489,11 @@
     {
         Folder folder = newFolder(path);
         folder.setDefaultPage(source.getDefaultPage()); 
-        folder.setDefaultTheme(source.getDefaultTheme());
         folder.setShortTitle(source.getShortTitle());
         folder.setTitle(source.getTitle());
         
+        // TODO: document orders
+
         // TODO: menu definitions
         
         // TODO: security constraints

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java?rev=330500&r1=330499&r2=330500&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java
Wed Nov  2 23:44:15 2005
@@ -26,11 +26,11 @@
 import org.apache.jetspeed.cache.file.FileCacheEntry;
 import org.apache.jetspeed.cache.file.FileCacheEventListener;
 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.InvalidFolderException;
 import org.apache.jetspeed.om.folder.Reset;
 import org.apache.jetspeed.om.folder.psml.FolderImpl;
+import org.apache.jetspeed.om.folder.psml.FolderMetaDataImpl;
 import org.apache.jetspeed.om.page.Document;
 
 import org.apache.jetspeed.page.document.DocumentHandler;
@@ -104,7 +104,7 @@
         this.documentRootDir = new File(documentRoot);
         verifyPath(documentRootDir);
         this.handlerFactory = handlerFactory;
-        this.metadataDocHandler = handlerFactory.getDocumentHandler(FolderMetaData.DOCUMENT_TYPE);
+        this.metadataDocHandler = handlerFactory.getDocumentHandler(FolderMetaDataImpl.DOCUMENT_TYPE);
         this.fileCache = fileCache;
         this.fileCache.addListener(this);
     }
@@ -188,7 +188,7 @@
             try
             {
                 // look for metadata
-                FolderMetaData metadata = (FolderMetaData) metadataDocHandler.getDocument(path
+ Folder.PATH_SEPARATOR + FolderMetaData.DOCUMENT_TYPE);
+                FolderMetaDataImpl metadata = (FolderMetaDataImpl) metadataDocHandler.getDocument(path
+ Folder.PATH_SEPARATOR + FolderMetaDataImpl.DOCUMENT_TYPE);
                 folder = new FolderImpl(path, metadata, handlerFactory, this);
             }
             catch (DocumentNotFoundException e)
@@ -273,8 +273,8 @@
         // update metadata
         try
         {
-            FolderMetaData metadata = folder.getFolderMetaData();
-            metadata.setPath(path + Folder.PATH_SEPARATOR + FolderMetaData.DOCUMENT_TYPE);
+            FolderMetaDataImpl metadata = folderImpl.getFolderMetaData();
+            metadata.setPath(path + Folder.PATH_SEPARATOR + FolderMetaDataImpl.DOCUMENT_TYPE);
             metadataDocHandler.updateDocument(metadata);
         }
         catch (Exception e)
@@ -319,9 +319,10 @@
         // (other than metadata document)
         File folderFile = new File(this.documentRootDir, path);
         File metadataFile = null;
-        if ((folder.getFolderMetaData() != null) && (folder.getFolderMetaData().getPath()
!= null))
+        FolderImpl folderImpl = (FolderImpl)folder;
+        if ((folderImpl.getFolderMetaData() != null) && (folderImpl.getFolderMetaData().getPath()
!= null))
         {
-            metadataFile = new File(this.documentRootDir, folder.getFolderMetaData().getPath());
+            metadataFile = new File(this.documentRootDir, folderImpl.getFolderMetaData().getPath());
         }
         if (folderFile.exists() && folderFile.isDirectory())
         {
@@ -640,7 +641,7 @@
         else if(entry.getDocument() instanceof Document)
         {
             Document doc = (Document) entry.getDocument();
-            if (doc.getType().equals(FolderMetaData.DOCUMENT_TYPE))
+            if (doc.getType().equals(FolderMetaDataImpl.DOCUMENT_TYPE))
             {
                 FileCacheEntry folderEntry = fileCache.get(((AbstractNode)doc).getParent().getPath());
                 refresh(folderEntry);

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=330500&r1=330499&r2=330500&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
Wed Nov  2 23:44:15 2005
@@ -36,18 +36,21 @@
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraints;
 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;
 import org.apache.jetspeed.om.folder.MenuOptionsDefinition;
 import org.apache.jetspeed.om.folder.MenuSeparatorDefinition;
+import org.apache.jetspeed.om.folder.psml.FolderMetaDataImpl;
 import org.apache.jetspeed.om.page.Document;
 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.LinkImpl;
+import org.apache.jetspeed.om.page.psml.PageImpl;
+import org.apache.jetspeed.om.page.psml.PageSecurityImpl;
 import org.apache.jetspeed.page.document.DocumentHandler;
 import org.apache.jetspeed.page.document.DocumentHandlerFactory;
 import org.apache.jetspeed.page.document.DocumentNotFoundException;
@@ -99,10 +102,10 @@
         IdGenerator idGen = new JetspeedIdGenerator(65536,"P-","");
         FileCache cache = new FileCache(10, 12);
         
-        DocumentHandler psmlHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml",
Page.DOCUMENT_TYPE, Page.class, "target/testdata/pages", cache);
-        DocumentHandler linkHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml",
Link.DOCUMENT_TYPE, Link.class, "target/testdata/pages", cache);
-        DocumentHandler folderMetaDataHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml",
FolderMetaData.DOCUMENT_TYPE, FolderMetaData.class, "target/testdata/pages", cache);
-        DocumentHandler pageSecurityHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml",
PageSecurity.DOCUMENT_TYPE, PageSecurity.class, "target/testdata/pages", cache);
+        DocumentHandler psmlHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml",
Page.DOCUMENT_TYPE, PageImpl.class, "target/testdata/pages", cache);
+        DocumentHandler linkHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml",
Link.DOCUMENT_TYPE, LinkImpl.class, "target/testdata/pages", cache);
+        DocumentHandler folderMetaDataHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml",
FolderMetaDataImpl.DOCUMENT_TYPE, FolderMetaDataImpl.class, "target/testdata/pages", cache);
+        DocumentHandler pageSecurityHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml",
PageSecurityImpl.DOCUMENT_TYPE, PageSecurity.class, "target/testdata/pages", cache);
         
         DocumentHandlerFactory handlerFactory = new DocumentHandlerFactoryImpl();
         handlerFactory.registerDocumentHandler(psmlHandler);

Modified: portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java?rev=330500&r1=330499&r2=330500&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java
(original)
+++ portals/jetspeed-2/trunk/components/portal-site/src/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java
Wed Nov  2 23:44:15 2005
@@ -27,7 +27,6 @@
 
 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.page.Link;
 import org.apache.jetspeed.om.page.Page;
@@ -57,7 +56,7 @@
      * *_METHOD - Folder method constants
      */
     protected static final Method GET_ALL_METHOD = reflectMethod(Folder.class, "getAll",
null);
-    protected static final Method GET_DEFAULT_PAGE_METHOD = reflectMethod(Folder.class, "getDefaultPage",
new Class[]{Boolean.TYPE});
+    protected static final Method GET_DEFAULT_PAGE_METHOD = reflectMethod(Folder.class, "getDefaultPage",
null);
     protected static final Method GET_FOLDERS_METHOD = reflectMethod(Folder.class, "getFolders",
null);
     protected static final Method GET_FOLDER_METHOD = reflectMethod(Folder.class, "getFolder",
new Class[]{String.class});
     protected static final Method GET_LINKS_METHOD = reflectMethod(Folder.class, "getLinks",
null);
@@ -200,7 +199,7 @@
         }
         else if (m.equals(GET_DEFAULT_PAGE_METHOD))
         {
-            return getDefaultPage(proxy, ((Boolean)args[0]).booleanValue());
+            return getDefaultPage(proxy);
         }
         else if (m.equals(GET_FOLDERS_METHOD))
         {
@@ -317,10 +316,9 @@
      * getDefaultPage - proxy implementation of Folder.getDefaultPage()
      *
      * @param proxy this folder proxy
-     * @param allowDefaulting flag to enable defaulting logic
-     * @return default page path
+     * @return default page name
      */
-    public String getDefaultPage(Object proxy, boolean allowDefaulting)
+    public String getDefaultPage(Object proxy)
     {
         // attempt to get explicitly specified default page
         Page defaultPage = selectDefaultPageFromAggregateFolders(proxy);
@@ -329,30 +327,6 @@
             return defaultPage.getName();
         }
 
-        // if defaulting allowed, use first page child in folder
-        if (allowDefaulting)
-        {
-            // return first page in folder
-            try
-            {
-                NodeSet pages = getPages(proxy);
-                if ((pages != null) && !pages.isEmpty())
-                {
-                    return ((Page)pages.iterator().next()).getName();
-                }
-            }
-            catch (NodeException ne)
-            {
-            }
-            catch (SecurityException se)
-            {
-            }
-
-            // no default page fallback default available, return
-            // non existing page name
-            return Folder.PAGE_NOT_FOUND_PAGE;
-        }
-
         // no default page available
         return null;
     }
@@ -686,7 +660,7 @@
             {
                 // get folder default page name or look for fallback default name
                 Folder folder = ((SearchFolder)foldersIter.next()).folder;
-                String defaultPageName = folder.getFolderMetaData().getDefaultPage();
+                String defaultPageName = folder.getDefaultPage();
                 if (defaultPageName != null)
                 {
                     // validate and return default page if it exists
@@ -795,14 +769,10 @@
                 // capture most specific document ordering
                 if (folderDocumentOrder == null)
                 {
-                    FolderMetaData metadata = folder.getFolderMetaData();
-                    if (metadata != null)
+                    List documentOrder = folder.getDocumentOrder();
+                    if ((documentOrder != null) && !documentOrder.isEmpty()) 
                     {
-                        List documentOrder = metadata.getDocumentOrder();
-                        if ((documentOrder != null) && !documentOrder.isEmpty())

-                        {
-                            folderDocumentOrder = documentOrder;
-                        }
+                        folderDocumentOrder = documentOrder;
                     }
                 }
             }

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java?rev=330500&r1=330499&r2=330500&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java
(original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java
Wed Nov  2 23:44:15 2005
@@ -42,7 +42,6 @@
     String PAGE_NOT_FOUND_PAGE = "page_not_found.psml";
     
     String RESERVED_SUBSITE_FOLDER_PREFIX = "__";
-    String RESERVED_SUBSITE_FOLDER_NAME = RESERVED_SUBSITE_FOLDER_PREFIX + "subsite-root";
     String RESERVED_FOLDER_PREFIX = "_";
     String RESERVED_USER_FOLDER_NAME = RESERVED_FOLDER_PREFIX + "user";
     String RESERVED_ROLE_FOLDER_NAME = RESERVED_FOLDER_PREFIX + "role";
@@ -51,7 +50,6 @@
     String RESERVED_LANGUAGE_FOLDER_NAME = RESERVED_FOLDER_PREFIX + "language";
     String RESERVED_COUNTRY_FOLDER_NAME = RESERVED_FOLDER_PREFIX + "country";
     
-    String SUBSITE_FOLDER = PATH_SEPARATOR + RESERVED_SUBSITE_FOLDER_NAME + PATH_SEPARATOR;
     String USER_FOLDER = PATH_SEPARATOR + RESERVED_USER_FOLDER_NAME + PATH_SEPARATOR;
     String ROLE_FOLDER = PATH_SEPARATOR + RESERVED_ROLE_FOLDER_NAME + PATH_SEPARATOR;
     String GROUP_FOLDER = PATH_SEPARATOR + RESERVED_GROUP_FOLDER_NAME + PATH_SEPARATOR;
@@ -80,45 +78,39 @@
     boolean isRootFolder();
 
     /**
-     * 
-     * <p>
-     * getDefaultPage
-     * </p>
+     * getDocumentOrder
      *
-     * @return A String representing the default psml page for this folder
+     * @return list of ordered document names in folder
      */
-    String getDefaultPage();
+    List getDocumentOrder();
     
     /**
-     * 
-     * <p>
-     * setDefaultPage
-     * </p>
+     * setDocumentOrder
      *
-     * @param defaultPage
+     * @param docIndexes list of ordered document names in folder
      */
-    void setDefaultPage(String defaultPage);
-    
+    void setDocumentOrder(List docIndexes);
+
     /**
      * 
      * <p>
-     * getDefaultTheme
+     * getDefaultPage
      * </p>
      *
-     * @return A String representing the default theme for this Folder
+     * @return A String representing the default psml page for this folder
      */
-    String getDefaultTheme();
+    String getDefaultPage();
     
     /**
      * 
      * <p>
-     * setDefaultTheme
+     * setDefaultPage
      * </p>
      *
-     * @param defaultTheme
+     * @param defaultPage
      */
-    void setDefaultTheme(String defaultTheme);
-    
+    void setDefaultPage(String defaultPage);
+
     /**
      * 
      * <p>
@@ -222,16 +214,6 @@
      * @throws DocumentException
      */
     NodeSet getAll() throws FolderNotFoundException, DocumentException;
-
-    /**
-     * 
-     * <p>
-     * getFolderMetaData
-     * </p>
-     *
-     * @return folder metadata
-     */
-    FolderMetaData getFolderMetaData();
 
     /**
      * getMenuDefinitions - get list of menu definitions

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Page.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Page.java?rev=330500&r1=330499&r2=330500&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Page.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Page.java Wed
Nov  2 23:44:15 2005
@@ -107,11 +107,5 @@
      * @param definitions definition list
      */
     void setMenuDefinitions(List definitions);    
-    
-    /**
-     * Returns the defaults object defined for this page.
-     * @return
-     */
-    Defaults getDefaults();
 }
 

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/page-manager.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/page-manager.xml?rev=330500&r1=330499&r2=330500&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/page-manager.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/page-manager.xml Wed Nov  2 23:44:15
2005
@@ -22,7 +22,7 @@
        class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler" >
        
        <constructor-arg index="0"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
        <constructor-arg index="1"><value>.psml</value></constructor-arg>
-       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.Page</value></constructor-arg>
      
+       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.psml.PageImpl</value></constructor-arg>
      
        <constructor-arg index="3" ><value>${applicationRoot}/WEB-INF/pages</value></constructor-arg>
        <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
   </bean>
@@ -31,7 +31,7 @@
        class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler" >
        
        <constructor-arg index="0"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
        <constructor-arg index="1"><value>.link</value></constructor-arg>
-       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.Link</value></constructor-arg>
      
+       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.psml.LinkImpl</value></constructor-arg>
      
        <constructor-arg index="3" ><value>${applicationRoot}/WEB-INF/pages</value></constructor-arg>
        <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
   </bean>
@@ -40,7 +40,7 @@
        class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler" >
        
        <constructor-arg index="0"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
        <constructor-arg index="1"><value>folder.metadata</value></constructor-arg>
-       <constructor-arg index="2" ><value>org.apache.jetspeed.om.folder.FolderMetaData</value></constructor-arg>
      
+       <constructor-arg index="2" ><value>org.apache.jetspeed.om.folder.psml.FolderMetaDataImpl</value></constructor-arg>
      
        <constructor-arg index="3" ><value>${applicationRoot}/WEB-INF/pages</value></constructor-arg>
        <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
   </bean>
@@ -49,7 +49,7 @@
        class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler" >
        
        <constructor-arg index="0"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
        <constructor-arg index="1"><value>page.security</value></constructor-arg>
-       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.PageSecurity</value></constructor-arg>
      
+       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.psml.PageSecurityImpl</value></constructor-arg>
      
        <constructor-arg index="3" ><value>${applicationRoot}/WEB-INF/pages</value></constructor-arg>
        <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
   </bean>



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