portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r326290 - in /portals/jetspeed-2/trunk: components/page-manager/src/java/JETSPEED-INF/ojb/ components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/ components/page-manager/src/java/org/apache/jetspeed/om/page/impl/ components/pa...
Date Tue, 18 Oct 2005 23:01:01 GMT
Author: rwatler
Date: Tue Oct 18 16:00:42 2005
New Revision: 326290

URL: http://svn.apache.org/viewcvs?rev=326290&view=rev
Log:
- hide Page/Folder/Fragment setId() API to allow different PageManager implementations
- remove general use of ID Generator: only Fragment creation in CastorXMLPageManagerImpl now uses it
- continue prep work for DB PageManager implementation


Modified:
    portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/FolderImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentFragmentImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentPageImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/AbstractNode.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.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/java/org/apache/jetspeed/page/impl/AbstractPageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DelegatingPageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/OldDatabasePageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/om/page/TestPageObjectModel.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
    portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/BaseElement.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Fragment.java
    portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
    portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java
    portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/ojb/page-manager-repository.xml Tue Oct 18 16:00:42 2005
@@ -25,24 +25,25 @@
       <field-descriptor
          name="id"
          column="FOLDER_ID"
-         jdbc-type="VARCHAR"
+         jdbc-type="INTEGER"
          primarykey="true"
-         autoincrement="false"
+         autoincrement="true"
       />
 
       <field-descriptor
         name="parentId"
         column="PARENT_ID"
-        jdbc-type="VARCHAR"
+        jdbc-type="INTEGER"
         access="anonymous"
       />
 
       <reference-descriptor
           name="parent"
           class-ref="org.apache.jetspeed.om.folder.impl.FolderImpl"
-          auto-delete="false"
-          auto-update="false"
-          auto-retrieve="false"
+          auto-retrieve="true"
+          auto-delete="none"
+          auto-update="none"
+          proxy="true"
           >
          <foreignkey field-ref="parentId"/>
       </reference-descriptor>
@@ -50,9 +51,10 @@
       <collection-descriptor
           name="folders"
           element-class-ref="org.apache.jetspeed.om.folder.impl.FolderImpl"
-          auto-delete="true"
-          auto-update="false"
-          auto-retrieve="false"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="link"
+          proxy="true"
       >
          <inverse-foreignkey field-ref="parentId"/>
       </collection-descriptor>
@@ -60,14 +62,21 @@
       <collection-descriptor
           name="pages"
           element-class-ref="org.apache.jetspeed.om.page.impl.PageImpl"
-          auto-delete="true"
-          auto-update="false"
-          auto-retrieve="false"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="link"
+          proxy="true"
       >
          <inverse-foreignkey field-ref="parentId"/>
       </collection-descriptor>
 
       <field-descriptor
+         name="path"
+         column="PATH"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
          name="name"
          column="NAME"
          jdbc-type="VARCHAR"
@@ -89,39 +98,46 @@
       <field-descriptor
          name="id"
          column="PAGE_ID"
-         jdbc-type="VARCHAR"
+         jdbc-type="INTEGER"
          primarykey="true"
-         autoincrement="false"
+         autoincrement="true"
       />
 
       <field-descriptor
         name="parentId"
         column="PARENT_ID"
-        jdbc-type="VARCHAR"
+        jdbc-type="INTEGER"
         access="anonymous"
       />
 
       <reference-descriptor
           name="parent"
           class-ref="org.apache.jetspeed.om.folder.impl.FolderImpl"
-          auto-delete="false"
-          auto-update="false"
-          auto-retrieve="false"
+          auto-retrieve="true"
+          auto-delete="none"
+          auto-update="none"
+          proxy="true"
           >
          <foreignkey field-ref="parentId"/>
       </reference-descriptor>
 
       <collection-descriptor
           name="fragments"
-          element-class-ref="org.apache.jetspeed.om.page.impl.FragmentImpl"
-          auto-delete="true"
-          auto-update="false"
-          auto-retrieve="false"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
       >
          <inverse-foreignkey field-ref="pageId"/>
       </collection-descriptor>
 
       <field-descriptor
+         name="path"
+         column="PATH"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
          name="name"
          column="NAME"
          jdbc-type="VARCHAR"
@@ -150,6 +166,48 @@
          column="DEFAULT_FRAGMENT_DECORATOR"
          jdbc-type="VARCHAR"
       />
+
+      <field-descriptor
+         name="subsite"
+         column="SUBSITE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="principal"
+         column="PRINCIPAL"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="principalType"
+         column="PRINCIPAL_TYPE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="mediatype"
+         column="MEDIATYPE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="locale"
+         column="LOCALE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="extLocatorName"
+         column="EXT_LOCATOR_NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="extLocatorValue"
+         column="EXT_LOCATOR_VALUE"
+         jdbc-type="VARCHAR"
+      />
    </class-descriptor>
 
    <!-- Fragment mapping -->
@@ -176,9 +234,10 @@
       <reference-descriptor
           name="parent"
           class-ref="org.apache.jetspeed.om.page.impl.FragmentImpl"
-          auto-delete="false"
-          auto-update="false"
-          auto-retrieve="false"
+          auto-retrieve="true"
+          auto-delete="none"
+          auto-update="none"
+          proxy="true"
           >
          <foreignkey field-ref="parentId"/>
       </reference-descriptor>
@@ -186,9 +245,10 @@
       <collection-descriptor
           name="fragments"
           element-class-ref="org.apache.jetspeed.om.page.impl.FragmentImpl"
-          auto-delete="true"
-          auto-update="false"
-          auto-retrieve="false"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
       >
          <inverse-foreignkey field-ref="parentId"/>
       </collection-descriptor>
@@ -196,7 +256,7 @@
       <field-descriptor
         name="pageId"
         column="PAGE_ID"
-        jdbc-type="VARCHAR"
+        jdbc-type="INTEGER"
         access="anonymous"
       />
 
@@ -249,8 +309,8 @@
       />
 
       <field-descriptor
-         name="layoutWidthProperty"
-         column="LAYOUT_WIDTH"
+         name="layoutSizesProperty"
+         column="LAYOUT_SIZES"
          jdbc-type="INTEGER"
       />
 

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=326290&r1=326289&r2=326290&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 Tue Oct 18 16:00:42 2005
@@ -75,7 +75,6 @@
         this.metadata = metadata;
         this.metadata.setParent(this);
         this.folderHandler = folderHandler;
-        setId(path);
         setPath(path);
         setReservedType();
         setHandlerFactory(handlerFactory);
@@ -88,7 +87,6 @@
         this.metadata = new FolderMetaDataImpl();
         this.metadata.setParent(this);
         this.folderHandler = folderHandler;
-        setId(path);
         setPath(path);
         setReservedType();
         setHandlerFactory(handlerFactory);

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java Tue Oct 18 16:00:42 2005
@@ -26,7 +26,7 @@
  */
 public abstract class BaseElementImpl implements BaseElement
 {
-    private String id;
+    private int id;
     private String name;
     private String title;
 
@@ -111,15 +111,7 @@
      */
     public String getId()
     {
-        return id;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.page.BaseElement#setId(java.lang.String)
-     */
-    public void setId(String id)
-    {
-        this.id = id;
+        return Integer.toString(id);
     }
 
     /* (non-Javadoc)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java Tue Oct 18 16:00:42 2005
@@ -33,9 +33,9 @@
     private String skin;
     private String decorator;
     private String state;
-    private int layoutRowProperty;
-    private int layoutColumnProperty;
-    private int layoutWidthProperty;
+    private int layoutRowProperty = -1;
+    private int layoutColumnProperty = -1;
+    private String layoutSizesProperty;
     private String extendedPropertyName1;
     private String extendedPropertyValue1;
     private String extendedPropertyName2;
@@ -167,6 +167,30 @@
     public void clearProperties(String layoutName)
     {
         // NYI
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#getLayoutWidths()
+     */
+    public int getLayoutRow()
+    {
+        return layoutRowProperty;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#getLayoutWidths()
+     */
+    public int getLayoutColumn()
+    {
+        return layoutColumnProperty;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#getLayoutSizes()
+     */
+    public String getLayoutSizes()
+    {
+        return layoutSizesProperty;
     }
 
     /* (non-Javadoc)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentFragmentImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentFragmentImpl.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentFragmentImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentFragmentImpl.java Tue Oct 18 16:00:42 2005
@@ -264,6 +264,30 @@
     }
 
     /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#getLayoutRow()
+     */
+    public int getLayoutRow()
+    {
+        return fragment.getLayoutRow();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#getLayoutColumn()
+     */
+    public int getLayoutColumn()
+    {
+        return fragment.getLayoutColumn();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#getLayoutSizes()
+     */
+    public String getLayoutSizes()
+    {
+        return fragment.getLayoutSizes();
+    }
+
+    /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#setSkin(java.lang.String)
      */
     public void setSkin(String skinName)
@@ -315,15 +339,6 @@
     {
         
         return fragment.getTitle();
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.page.BaseElement#setId(java.lang.String)
-     */
-    public void setId(String id)
-    {
-        
-        fragment.setId(id);
     }
 
     /* (non-Javadoc)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentPageImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentPageImpl.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentPageImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/ContentPageImpl.java Tue Oct 18 16:00:42 2005
@@ -341,15 +341,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.page.BaseElement#setId(java.lang.String)
-     */
-    public void setId(String id)
-    {
-        
-        page.setId(id);
-    }
-
-    /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.BaseElement#setShortTitle(java.lang.String)
      */
     public void setShortTitle(String title)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java Tue Oct 18 16:00:42 2005
@@ -227,6 +227,60 @@
         this.properties = props;
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#getLayoutRow()
+     */
+    public int getLayoutRow()
+    {
+        // return first valid row layout property
+        Iterator i = this.properties.iterator();
+        while (i.hasNext())
+        {
+            Property p = (Property) i.next();
+            if ((p.getLayout() != null) && (p.getLayout().length() > 0) && ROW_PROPERTY_NAME.equals(p.getName()) && (p.getValue() != null))
+            {
+                return p.getIntValue();
+            }
+        }
+        return -1;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#getLayoutColumn()
+     */
+    public int getLayoutColumn()
+    {
+        // return first valid column layout property
+        Iterator i = this.properties.iterator();
+        while (i.hasNext())
+        {
+            Property p = (Property) i.next();
+            if ((p.getLayout() != null) && (p.getLayout().length() > 0) && COLUMN_PROPERTY_NAME.equals(p.getName()) && (p.getValue() != null))
+            {
+                return p.getIntValue();
+            }
+        }
+        return -1;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment#getLayoutSizes()
+     */
+    public String getLayoutSizes()
+    {
+        // return first valid sizes property
+        Iterator i = this.properties.iterator();
+        while (i.hasNext())
+        {
+            Property p = (Property) i.next();
+            if (SIZES_PROPERTY_NAME.equals(p.getName()) && (p.getValue() != null))
+            {
+                return p.getValue();
+            }
+        }
+        return null;
+    }
+
     public Object clone() throws java.lang.CloneNotSupportedException
     {
         Object cloned = super.clone();

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeImpl.java Tue Oct 18 16:00:42 2005
@@ -30,6 +30,7 @@
 public abstract class NodeImpl extends BaseElementImpl implements Node
 {
     private NodeImpl parent;
+    private String path;
 
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.document.Node#getParent()
@@ -52,7 +53,7 @@
      */
     public String getPath()
     {
-        return null; // NYI
+        return path;
     }
     
     /* (non-Javadoc)
@@ -60,7 +61,7 @@
      */
     public void setPath(String path)
     {
-        // NYI
+        this.path = path;
     }
 
     /* (non-Javadoc)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/AbstractNode.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/AbstractNode.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/AbstractNode.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/AbstractNode.java Tue Oct 18 16:00:42 2005
@@ -291,7 +291,10 @@
      */
     public void setPath( String path )
     {
+        // PSML id is always kept in sync with path, despite how the
+        // id may be loaded from the persistent store
         this.path = path;
+        setId(path);
     }
 
     /**

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java Tue Oct 18 16:00:42 2005
@@ -464,7 +464,6 @@
                     }
                 });
 
-            document.setId(path);
             document.setPath(path);
             AbstractBaseElement documentImpl = (AbstractBaseElement)document;
             documentImpl.setHandlerFactory(handlerFactory);

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=326290&r1=326289&r2=326290&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 Tue Oct 18 16:00:42 2005
@@ -275,7 +275,6 @@
         {
             FolderMetaData metadata = folder.getFolderMetaData();
             metadata.setPath(path + Folder.PATH_SEPARATOR + FolderMetaData.DOCUMENT_TYPE);
-            metadata.setId(metadata.getPath());
             metadataDocHandler.updateDocument(metadata);
         }
         catch (Exception e)

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=326290&r1=326289&r2=326290&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 Tue Oct 18 16:00:42 2005
@@ -25,7 +25,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.exception.JetspeedException;
-import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraints;
 import org.apache.jetspeed.om.folder.Folder;
@@ -68,24 +67,21 @@
     protected Class securityConstraintsClass;
     protected Class securityConstraintClass;
 
-    protected IdGenerator generator = null;
-
     private boolean permissionsEnabled;
 
     private boolean constraintsEnabled;
 
     private List listeners = new LinkedList();
 
-    public AbstractPageManager(IdGenerator generator, boolean permissionsEnabled, boolean constraintsEnabled)
+    public AbstractPageManager(boolean permissionsEnabled, boolean constraintsEnabled)
     {    
-        this.generator = generator;
         this.permissionsEnabled = permissionsEnabled;
         this.constraintsEnabled = constraintsEnabled;
     }
     
-    public AbstractPageManager(IdGenerator generator, boolean permissionsEnabled, boolean constraintsEnabled, Map modelClasses)
+    public AbstractPageManager(boolean permissionsEnabled, boolean constraintsEnabled, Map modelClasses)
     {
-        this(generator, permissionsEnabled, constraintsEnabled);     
+        this(permissionsEnabled, constraintsEnabled);     
 
         this.fragmentClass = (Class)modelClasses.get("FragmentImpl.class");
         this.pageClass = (Class)modelClasses.get("PageImpl.class");
@@ -146,13 +142,9 @@
                 path += Page.DOCUMENT_TYPE;
             }
             page.setPath(path);
-            page.setId(path);
             
             // create the default fragment
-            Fragment fragment = (Fragment)createObject(this.fragmentClass);
-            fragment.setId(generator.getNextPeid());
-            fragment.setType(Fragment.LAYOUT);
-            page.setRootFragment(fragment);            
+            page.setRootFragment(newFragment());            
         }
         catch (ClassCastException e)
         {
@@ -177,7 +169,6 @@
                 path = Folder.PATH_SEPARATOR + path;
             }
             folder.setPath(path);
-            folder.setId(path);
         }
         catch (ClassCastException e)
         {
@@ -206,7 +197,6 @@
                 path += Link.DOCUMENT_TYPE;
             }
             link.setPath(path);
-            link.setId(path);
         }
         catch (ClassCastException e)
         {
@@ -225,9 +215,7 @@
         try
         {
             fragment = (Fragment)createObject(this.fragmentClass);
-            fragment.setId(generator.getNextPeid());
             fragment.setType(Fragment.LAYOUT);          
-            
         }
         catch (ClassCastException e)
         {

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=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java Tue Oct 18 16:00:42 2005
@@ -5,7 +5,6 @@
 
 import org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport;
 import org.apache.jetspeed.exception.JetspeedException;
-import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraints;
 import org.apache.jetspeed.om.folder.Folder;
@@ -72,14 +71,13 @@
     
     public DatabasePageManager(
             String repositoryPath,
-            IdGenerator generator, 
             boolean isPermissionsSecurity, 
             boolean isConstraintsSecurity)
 
     {
         super(repositoryPath);
         System.out.println("Page Manager repo = " + repositoryPath);
-        delegator = new DelegatingPageManager(generator, isPermissionsSecurity, isConstraintsSecurity, modelClasses);
+        delegator = new DelegatingPageManager(isPermissionsSecurity, isConstraintsSecurity, modelClasses);
     }
 
     /* (non-Javadoc)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DelegatingPageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DelegatingPageManager.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DelegatingPageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DelegatingPageManager.java Tue Oct 18 16:00:42 2005
@@ -3,7 +3,6 @@
 import java.util.Map;
 
 import org.apache.jetspeed.exception.JetspeedException;
-import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.folder.InvalidFolderException;
@@ -34,12 +33,11 @@
 {
 
     DelegatingPageManager(
-            IdGenerator generator, 
             boolean isPermissionsSecurity, 
             boolean isConstraintsSecurity,
             Map modelClasses)
     {
-        super(generator, isPermissionsSecurity, isConstraintsSecurity, modelClasses);
+        super(isPermissionsSecurity, isConstraintsSecurity, modelClasses);
     }
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getPage(java.lang.String)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/OldDatabasePageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/OldDatabasePageManager.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/OldDatabasePageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/OldDatabasePageManager.java Tue Oct 18 16:00:42 2005
@@ -22,7 +22,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport;
 import org.apache.jetspeed.exception.JetspeedException;
-import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.page.ContentPage;
 import org.apache.jetspeed.om.page.Link;
@@ -54,11 +53,10 @@
      *            ID generator that will be used to generate unique page ids
      */
     public OldDatabasePageManager(
-            IdGenerator generator, 
             boolean isPermissionsSecurity, 
             boolean isConstraintsSecurity)
     {
-        super(generator, isPermissionsSecurity, isConstraintsSecurity);
+        super(isPermissionsSecurity, isConstraintsSecurity);
     }
 
     /*
@@ -113,9 +111,9 @@
         String id = page.getId();
         if (id == null)
         {
-            page.setId(generator.getNextPeid());
-            id = page.getId();
-            log.warn("Page with no Id, created new Id : " + id);
+            String msg = "Page with no Id.";
+            log.error(msg);
+            throw new PageNotUpdatedException(msg);
         }
 
         // update page

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java Tue Oct 18 16:00:42 2005
@@ -39,6 +39,7 @@
 import org.apache.jetspeed.om.folder.psml.MenuOptionsDefinitionImpl;
 import org.apache.jetspeed.om.folder.psml.MenuSeparatorDefinitionImpl;
 import org.apache.jetspeed.om.page.ContentPage;
+import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageSecurity;
@@ -92,6 +93,7 @@
         modelClasses.put("SecurityConstraintImpl.class", SecurityConstraintImpl.class);
     }
 
+    private IdGenerator generator = null;
     private DocumentHandlerFactory handlerFactory;
     private FolderHandler folderHandler;
     private FileCache fileCache;
@@ -100,13 +102,30 @@
                                  FolderHandler folderHandler, FileCache fileCache,
                                  boolean permissionsEnabled, boolean constraintsEnabled ) throws FileNotFoundException
     {
-        super(generator, permissionsEnabled, constraintsEnabled, modelClasses);
+        super(permissionsEnabled, constraintsEnabled, modelClasses);
+        this.generator = generator;
         handlerFactory.setPermissionsEnabled(permissionsEnabled);
         handlerFactory.setConstraintsEnabled(constraintsEnabled);
         this.handlerFactory = handlerFactory;
         this.folderHandler = folderHandler;
         this.fileCache = fileCache;
         this.fileCache.addListener(this);
+    }
+
+    /**
+     * <p>
+     * newFragment
+     * </p>
+     * 
+     * @see org.apache.jetspeed.page.PageManager#newFragment()
+     * @return fragment
+     */
+    public Fragment newFragment()
+    {
+        // FragmentImpl requires generated ids
+        FragmentImpl fragment = (FragmentImpl)super.newFragment();
+        fragment.setId(generator.getNextPeid());
+        return fragment;
     }
 
     /**

Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/database-page-manager.xml Tue Oct 18 16:00:42 2005
@@ -17,22 +17,6 @@
 -->
 <beans>
 
-    <!-- ID Generator -->
-    <bean id="IdGenerator" class="org.apache.jetspeed.idgenerator.JetspeedIdGenerator" init-method="start" destroy-method="stop">
-        <!-- ID Start value -->
-        <constructor-arg index="0">
-            <value>65536</value>
-        </constructor-arg>
-        <!-- ID Prefix -->
-        <constructor-arg index="1">
-            <value>P-</value>
-        </constructor-arg>
-        <!-- ID Suffix -->
-        <constructor-arg index="2">
-            <value></value>
-        </constructor-arg>
-    </bean>
-
   <bean 
        id="org.apache.jetspeed.page.PageManagerImpl" 
        name="pageManagerImpl"
@@ -41,11 +25,10 @@
         <constructor-arg index="0">
             <value>JETSPEED-INF/ojb/page-manager-repository.xml</value>
         </constructor-arg>       
-       <constructor-arg index="1"><ref bean="IdGenerator"/></constructor-arg>
        <!-- permissions security enabled flag, default=false -->
-       <constructor-arg index="2"><value>false</value></constructor-arg>
+       <constructor-arg index="1"><value>false</value></constructor-arg>
        <!-- constraints security enabled flag, default=true -->
-       <constructor-arg index="3"><value>false</value></constructor-arg>
+       <constructor-arg index="2"><value>false</value></constructor-arg>
   </bean>
 
     <!-- Proxying -->

Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/om/page/TestPageObjectModel.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/om/page/TestPageObjectModel.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/om/page/TestPageObjectModel.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/om/page/TestPageObjectModel.java Tue Oct 18 16:00:42 2005
@@ -76,7 +76,7 @@
         PageImpl page = new PageImpl();
         page.setId("MyPageID");
 
-        Fragment frag = new FragmentImpl();
+        FragmentImpl frag = new FragmentImpl();
         frag.setId("Frag1");
         frag.setType(Fragment.LAYOUT);
 
@@ -107,19 +107,19 @@
         Fragment root = page.getRootFragment();
         assertNotNull(root.getFragments());
 
-        Fragment frag1 = new FragmentImpl();
+        FragmentImpl frag1 = new FragmentImpl();
         frag1.setId("F1");
         frag1.setType(Fragment.PORTLET);
         frag1.setName("Portlet1");
         root.getFragments().add(frag1);
 
-        Fragment frag2 = new FragmentImpl();
+        FragmentImpl frag2 = new FragmentImpl();
         frag2.setId("F2");
         frag2.setType(Fragment.LAYOUT);
         frag2.setName("TwoColumns");
         frag2.setDecorator("test");
 
-        Fragment frag3 = new FragmentImpl();
+        FragmentImpl frag3 = new FragmentImpl();
         frag3.setId("F3");
         frag3.setType(Fragment.PORTLET);
         frag3.setName("Portlet3");
@@ -131,7 +131,7 @@
         //Check the construct
         assertTrue(root.getFragments().size()==2);
         Iterator i = root.getFragments().iterator();
-        Fragment f = (Fragment)i.next();
+        FragmentImpl f = (FragmentImpl)i.next();
         assertNotNull(f);
         assertTrue(f.getName().equals("Portlet1"));
         assertTrue(f.getType().equals(Fragment.PORTLET));
@@ -140,7 +140,7 @@
         assertNull(f.getDecorator());
         assertNull(f.getState());
         assertTrue(f.getFragments().size()==0);
-        f = (Fragment)i.next();
+        f = (FragmentImpl)i.next();
         assertNotNull(f);
         assertTrue(f.getName().equals("TwoColumns"));
         assertTrue(f.getType().equals(Fragment.LAYOUT));
@@ -148,7 +148,7 @@
         assertTrue(f.getDecorator().equals("test"));
         assertTrue(f.getFragments().size()==1);
         i = f.getFragments().iterator();
-        frag1 = (Fragment)i.next();
+        frag1 = (FragmentImpl)i.next();
         assertNotNull(frag1);
         assertTrue(frag1.getName().equals("Portlet3"));
         assertTrue(frag1.getType().equals(Fragment.PORTLET));
@@ -159,14 +159,14 @@
         frag2.setType(Fragment.PORTLET);
         frag2.setName("P4");
 
-        frag3 = page.getFragmentById("F3");
+        frag3 = (FragmentImpl)page.getFragmentById("F3");
         assertNotNull(frag3);
         f.getFragments().remove(frag3);
-        frag3 = page.getFragmentById("F3");
+        frag3 = (FragmentImpl)page.getFragmentById("F3");
         assertNull(frag3);
         f.getFragments().add(frag2);
         assertTrue(f.getFragments().size()==1);
-        f = (Fragment)f.getFragments().get(0);
+        f = (FragmentImpl)f.getFragments().get(0);
         assertNotNull(f);
         assertTrue(f.getName().equals("P4"));
     }

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorImpl.java Tue Oct 18 16:00:42 2005
@@ -16,7 +16,9 @@
 package org.apache.jetspeed.aggregator.impl;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -28,10 +30,11 @@
 import org.apache.jetspeed.exception.JetspeedException;
 import org.apache.jetspeed.headerresource.HeaderResource;
 import org.apache.jetspeed.headerresource.HeaderResourceFactory;
+import org.apache.jetspeed.om.common.SecurityConstraints;
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.om.page.Fragment;
+import org.apache.jetspeed.om.page.Property;
 import org.apache.jetspeed.om.page.psml.ContentFragmentImpl;
-import org.apache.jetspeed.om.page.psml.FragmentImpl;
 import org.apache.jetspeed.request.RequestContext;
 
 /**
@@ -50,37 +53,321 @@
     {
         this.renderer = renderer;
     }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.Fragment
+     */
+    public class PortletEntityFragmentImpl implements Fragment
+    {
+        private String id;
+        private String name;
+        private String type;
+        private String decorator;
+        private String state;
+
+        public PortletEntityFragmentImpl(String id)
+        {
+            this.id = id;
+        }
+
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.common.SecuredResource#getConstraintsEnabled()
+         */
+        public boolean getConstraintsEnabled()
+        {
+            return false;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.common.SecuredResource#getSecurityConstraints()
+         */
+        public SecurityConstraints getSecurityConstraints()
+        {
+            return null;
+        }
     
-    
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.common.SecuredResource#setSecurityConstraints(org.apache.jetspeed.om.common.SecurityConstraints)
+         */
+        public void setSecurityConstraints(SecurityConstraints constraints)
+        {
+        }
+
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.common.SecuredResource#checkConstraints(java.lang.String)
+         */
+        public void checkConstraints(String actions) throws SecurityException
+        {
+        }
+
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.common.SecuredResource#getPermissionsEnabled()
+         */
+        public boolean getPermissionsEnabled()
+        {
+            return false;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.common.SecuredResource#checkPermissions(java.lang.String)
+         */
+        public void checkPermissions(String actions) throws SecurityException
+        {
+        }
+
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.common.SecuredResource#checkAccess(java.lang.String)
+         */
+        public void checkAccess(String actions) throws SecurityException
+        {
+        }
+
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.BaseElement#getId()
+         */
+        public String getId()
+        {
+            return id;
+        }
+
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.BaseElement#getTitle()
+         */
+        public String getTitle()
+        {
+            return null;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.BaseElement#setTitle(java.lang.String)
+         */
+        public void setTitle(String title)
+        {
+        }
+
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.BaseElement#getShortTitle()
+         */
+        public String getShortTitle()
+        {
+            return null;
+        }
+
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.BaseElement#setShortTitle(java.lang.String)
+         */
+        public void setShortTitle(String title)
+        {
+        }
+
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#getName()
+         */
+        public String getName()
+        {
+            return name;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#setName(java.lang.String)
+         */
+        public void setName( String name )
+        {
+            this.name = name;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#getType()
+         */
+        public String getType()
+        {
+            return type;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#setType(java.lang.String)
+         */
+        public void setType(String type)
+        {
+            this.type = type;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#getSkin()
+         */
+        public String getSkin()
+        {
+            return null;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#setSkin(java.lang.String)
+         */
+        public void setSkin(String skinName)
+        {
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#getDecorator()
+         */
+        public String getDecorator()
+        {
+            return decorator;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#setDecorator(java.lang.String)
+         */
+        public void setDecorator(String decoratorName)
+        {
+            this.decorator = decoratorName;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#getState()
+         */
+        public String getState()
+        {
+            return state;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#setState(java.lang.String)
+         */
+        public void setState(String state)
+        {
+            this.state = state;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#getFragments()
+         */
+        public List getFragments()
+        {
+            return new ArrayList(0);
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#getLayoutProperties()
+         */
+        public List getLayoutProperties()
+        {
+            return new ArrayList(0);
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#getProperties(java.lang.String)
+         */
+        public List getProperties(String layoutName)
+        {
+            return new ArrayList(0);
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#getPropertyValue(java.lang.String,java.lang.String)
+         */
+        public String getPropertyValue(String layout, String propName)
+        {
+            return null;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#getPropertyValue(java.lang.String,java.lang.String,java.lang.String)
+         */
+        public void setPropertyValue(String layout, String propName, String value)
+        {
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#addProperty(org.apache.jetspeed.om.page.Property)
+         */
+        public void addProperty(Property p)
+        {
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#removeProperty(org.apache.jetspeed.om.page.Property)
+         */
+        public void removeProperty(Property p)
+        {
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#clearProperties(java.lang.String)
+         */
+        public void clearProperties(String layoutName)
+        {
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#getLayoutWidths()
+         */
+        public int getLayoutRow()
+        {
+            return -1;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#getLayoutWidths()
+         */
+        public int getLayoutColumn()
+        {
+            return -1;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#getLayoutSizes()
+         */
+        public String getLayoutSizes()
+        {
+            return null;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#isReference()
+         */
+        public boolean isReference()
+        {
+            return false;
+        }
+        
+        /* (non-Javadoc)
+         * @see org.apache.jetspeed.om.page.Fragment#clone()
+         */
+        public Object clone() throws CloneNotSupportedException
+        {
+            return null;
+        }    
+    }
     
     /* (non-Javadoc)
      * @see org.apache.jetspeed.aggregator.Aggregator#build(org.apache.jetspeed.request.RequestContext)
      */
     public void build(RequestContext context) throws JetspeedException, IOException
     {
-        ContentFragment fragment = new ContentFragmentImpl(new FragmentImpl(), new HashMap()); // TODO: fragment factory
-        fragment.setType(Fragment.PORTLET);
-        fragment.setName(context.getRequestParameter(PortalReservedParameters.PORTLET));
+        // construct Fragment for rendering use with
+        // appropriate id to match portlet entity
         String entity = context.getRequestParameter(PortalReservedParameters.PORTLET_ENTITY);
         if (entity == null)
         {
-            entity = (String)context.getAttribute(PortalReservedParameters.PORTLET_ENTITY);          
+            entity = (String)context.getAttribute(PortalReservedParameters.PORTLET_ENTITY);
         }
-        fragment.setId(entity);  
-         
+        PortletEntityFragmentImpl fragment = new PortletEntityFragmentImpl(entity);
+        fragment.setType(Fragment.PORTLET);
+        fragment.setName(context.getRequestParameter(PortalReservedParameters.PORTLET));
         String decorator = fragment.getDecorator();
-        if( decorator == null)
+
+        // render and write portlet content to response
+        if (decorator == null)
         {
-           // decorator = context.getPage().getDefaultDecorator(fragment.getType());
+            // decorator = context.getPage().getDefaultDecorator(fragment.getType());
             log.debug("No sepecific decorator portlet so using page default: "+decorator);
         }
-        
-
         ContentDispatcher dispatcher = renderer.getDispatcher(context, false);
-        renderer.renderNow(fragment, context);
- //       dispatcher.include(fragment);
-        context.getResponse().getWriter().write(fragment.getRenderedContent());
-        
+        ContentFragment contentFragment = new ContentFragmentImpl(fragment, new HashMap());
+        renderer.renderNow(contentFragment, context);
+//        dispatcher.include(fragment);
+        context.getResponse().getWriter().write(contentFragment.getRenderedContent());
     }
     
     private void addStyle(RequestContext context, String decoratorName, String decoratorType) 

Modified: portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml (original)
+++ portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml Tue Oct 18 16:00:42 2005
@@ -92,7 +92,7 @@
         <column name="STATE" size="40" type="VARCHAR"/>
         <column name="LAYOUT_ROW" type="INTEGER"/>
         <column name="LAYOUT_COLUMN" type="INTEGER"/>
-        <column name="LAYOUT_WIDTHS" size="20" type="VARCHAR"/>
+        <column name="LAYOUT_SIZES" size="20" type="VARCHAR"/>
         <column name="EXT_PROPERTY_NAME_1" size="40" type="VARCHAR"/>
         <column name="EXT_PROPERTY_VALUE_1" size="80" type="VARCHAR"/>
         <column name="EXT_PROPERTY_NAME_2" size="40" type="VARCHAR"/>

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/BaseElement.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/BaseElement.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/BaseElement.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/BaseElement.java Tue Oct 18 16:00:42 2005
@@ -34,14 +34,6 @@
     public String getId();
 
     /**
-     * Modifies the id of this element. This id must not be null and must be unique
-     * for the portal.
-     *
-     * @param id the new id for this element
-     */
-    public void setId(String id);
-
-    /**
      * Returns the title in the default Locale
      *
      * @return the page title

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Fragment.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Fragment.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Fragment.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Fragment.java Tue Oct 18 16:00:42 2005
@@ -58,6 +58,21 @@
      public String LAYOUT = "layout";
 
     /**
+     * row standard layout property name
+     */
+     public String ROW_PROPERTY_NAME = "row";
+
+    /**
+     * column standard layout property name
+     */
+     public String COLUMN_PROPERTY_NAME = "column";
+
+    /**
+     * widths standard layout property name
+     */
+     public String SIZES_PROPERTY_NAME = "sizes";
+
+    /**
      * Returns the administrative name of this fragment. This name should map
      * to a component name in the component repository defined by the type
      * attribute.
@@ -200,6 +215,27 @@
     public void clearProperties(String layoutName);
 
     /**
+     * get layout row property
+     *
+     * @return row layout property
+     **/
+    public int getLayoutRow();
+    
+    /**
+     * get layout column property
+     *
+     * @return column layout property
+     **/
+    public int getLayoutColumn();
+
+    /**
+     * get layout sizes property, (i.e. "25%,75%")
+     *
+     * @return sizes layout property
+     **/
+    public String getLayoutSizes();
+
+    /**
      * Test if this fragment is actually a reference to an external fragment.
      *
      * @return true is this element is a reference
@@ -212,4 +248,4 @@
     public Object clone()
         throws java.lang.CloneNotSupportedException;
     
-}
\ No newline at end of file
+}

Modified: portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java (original)
+++ portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java Tue Oct 18 16:00:42 2005
@@ -65,10 +65,6 @@
  */
 public class ColumnLayout implements Serializable
 {
-    private static final String COLUMN = "column";
-
-    private static final String ROW = "row";
-   
     /** Constrains the columns for this layout */
     private final int numberOfColumns;
     
@@ -734,7 +730,7 @@
      */
     protected final int getRow(int currentColumn, Fragment fragment)
     {
-        String propertyValue = fragment.getPropertyValue(layoutType, ROW);
+        String propertyValue = fragment.getPropertyValue(layoutType, Fragment.ROW_PROPERTY_NAME);
 
         if (propertyValue != null)
         {
@@ -761,7 +757,7 @@
      */
     protected final int getColumn(Fragment fragment)
     {
-        String propertyValue = fragment.getPropertyValue(layoutType, COLUMN);
+        String propertyValue = fragment.getPropertyValue(layoutType, Fragment.COLUMN_PROPERTY_NAME);
         if (propertyValue != null)
         {
             int columnNumber = Integer.parseInt(propertyValue);

Modified: portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java (original)
+++ portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java Tue Oct 18 16:00:42 2005
@@ -37,7 +37,6 @@
 import org.apache.jetspeed.capabilities.CapabilityMap;
 import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent;
 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
-import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.locator.LocatorDescriptor;
 import org.apache.jetspeed.locator.TemplateDescriptor;
 import org.apache.jetspeed.locator.TemplateLocator;
@@ -74,7 +73,6 @@
     
     protected PortletRegistry registry;
     protected PageManager pageManager;
-    protected IdGenerator generator;
     protected JetspeedPowerToolFactory jptFactory;
     protected TemplateLocator templateLocator;
     protected PortletEntityAccessComponent entityAccess;
@@ -94,11 +92,6 @@
         {
             throw new PortletException("Failed to find the Page Manager on portlet initialization");
         }        
-        generator = (IdGenerator)getPortletContext().getAttribute(CommonPortletServices.CPS_ID_GENERATOR_COMPONENT);
-        if (null == generator)
-        {
-            throw new PortletException("Failed to find the ID Generator on portlet initialization");
-        }        
         jptFactory = (JetspeedPowerToolFactory)getPortletContext().getAttribute(CommonPortletServices.CPS_JETSPEED_POWERTOOL_FACTORY);
         if (null == jptFactory)
         {
@@ -277,7 +270,6 @@
         {
             Fragment fragment = pageManager.newFragment();
             fragment.setType(Fragment.PORTLET);
-            fragment.setId(generator.getNextPeid());
             fragment.setName(portletId);
             
             Page page = pageManager.getContentPage(pageId);
@@ -531,4 +523,4 @@
             throw e;
         }
     }
-}
\ No newline at end of file
+}

Modified: portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java?rev=326290&r1=326289&r2=326290&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java (original)
+++ portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java Tue Oct 18 16:00:42 2005
@@ -109,7 +109,7 @@
         List columnSizes = this.columnSizes;
 
         // Determine custom column sizes in the psml
-        String customSizes = f.getPropertyValue(this.layoutType, "sizes");
+        String customSizes = f.getPropertyValue(this.layoutType, Fragment.SIZES_PROPERTY_NAME);
         if ( customSizes != null && customSizes.trim().length() > 0 )
         {
             columnSizes = getCellSizes(customSizes);



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