portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r351770 [1/3] - in /portals/jetspeed-2/trunk: components/page-manager/src/java/JETSPEED-INF/ojb/ components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/ components/page-manager/src/java/org/apache/jetspeed/om/folder/psml/ compo...
Date Fri, 02 Dec 2005 16:52:40 GMT
Author: rwatler
Date: Fri Dec  2 08:52:05 2005
New Revision: 351770

URL: http://svn.apache.org/viewcvs?rev=351770&view=rev
Log:
- Support MenuDefinitions in DB PageManager for Page/Folder
- Add copyFields() method to GenericMetadata to support copy using different LocalizedField implementations
- Add newMenu*Definition() APIs to Page and Folder to allow proper om implementation types to be created per Page/Folder


Added:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionElement.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionMetadata.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuExcludeDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuIncludeDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuOptionsDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuSeparatorDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElement.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElementList.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionList.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuExcludeDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuIncludeDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuMetadataLocalizedFieldImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuOptionsDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuSeparatorDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionElement.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionElementList.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionList.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuExcludeDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuIncludeDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuMetadataLocalizedFieldImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuOptionsDefinitionImpl.java   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuSeparatorDefinitionImpl.java   (with props)
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/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/page/ContentFragmentImpl.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/BaseElementImpl.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/impl/PageSecurityImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintDefList.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintList.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintsRefList.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/AbstractBaseElement.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/impl/DatabasePageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
    portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/GenericMetadataImpl.java
    portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml
    portals/jetspeed-2/trunk/etc/sql/derby/schema/phase2-schema.sql
    portals/jetspeed-2/trunk/etc/sql/drop.sql
    portals/jetspeed-2/trunk/etc/sql/oracle/drop.sql
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/GenericMetadata.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/SecuredResource.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/jetspeed-api/src/java/org/apache/jetspeed/om/page/PageSecurity.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=351770&r1=351769&r2=351770&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 Fri Dec  2 08:52:05 2005
@@ -222,6 +222,18 @@
          <orderby name="sortOrder" sort="ASC"/>
          <inverse-foreignkey field-ref="folderId"/>
       </collection-descriptor>
+
+      <collection-descriptor
+          name="menus"
+          element-class-ref="org.apache.jetspeed.om.folder.impl.FolderMenuDefinitionImpl"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
+      >
+         <orderby name="name" sort="ASC"/>
+         <inverse-foreignkey field-ref="folderId"/>
+      </collection-descriptor>
    </class-descriptor>
 
    <class-descriptor
@@ -381,199 +393,361 @@
       />
    </class-descriptor>
 
-   <!-- Page mapping -->
+   <class-descriptor class="org.apache.jetspeed.om.folder.impl.FolderMenuDefinitionElement">
+      <extent-class class-ref="org.apache.jetspeed.om.folder.impl.FolderMenuDefinitionImpl"/>
+      <extent-class class-ref="org.apache.jetspeed.om.folder.impl.FolderMenuExcludeDefinitionImpl"/>
+      <extent-class class-ref="org.apache.jetspeed.om.folder.impl.FolderMenuIncludeDefinitionImpl"/>
+      <extent-class class-ref="org.apache.jetspeed.om.folder.impl.FolderMenuOptionsDefinitionImpl"/>
+      <extent-class class-ref="org.apache.jetspeed.om.folder.impl.FolderMenuSeparatorDefinitionImpl"/>
+   </class-descriptor>
 
    <class-descriptor
-      class="org.apache.jetspeed.om.page.impl.PageImpl"
-      table="PAGE"
+      class="org.apache.jetspeed.om.folder.impl.FolderMenuDefinitionImpl"
+      table="FOLDER_MENU"
    >
-      <object-cache class="org.apache.jetspeed.page.impl.DatabasePageManagerCache"/>
-
       <field-descriptor
          name="id"
-         column="PAGE_ID"
+         column="MENU_ID"
          jdbc-type="INTEGER"
          primarykey="true"
          autoincrement="true"
       />
 
       <field-descriptor
-        name="parentId"
-        column="PARENT_ID"
-        jdbc-type="INTEGER"
-        access="anonymous"
+         name="ojbConcreteClass"
+         column="CLASS_NAME"
+         jdbc-type="VARCHAR"
       />
 
-      <reference-descriptor
-          name="parent"
-          class-ref="org.apache.jetspeed.om.folder.impl.FolderImpl"
-          auto-retrieve="true"
-          auto-delete="none"
-          auto-update="none"
-          proxy="true"
-          >
-         <foreignkey field-ref="parentId"/>
-      </reference-descriptor>
+      <field-descriptor
+         name="parentId"
+         column="PARENT_ID"
+         jdbc-type="INTEGER"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="folderId"
+         column="FOLDER_ID"
+         jdbc-type="INTEGER"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="elementOrder"
+         column="ELEMENT_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="title"
+         column="TITLE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="shortTitle"
+         column="SHORT_TITLE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="options"
+         column="OPTIONS"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="depth"
+         column="DEPTH"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="paths"
+         column="IS_PATHS"
+         jdbc-type="INTEGER"
+         conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+      />
+
+      <field-descriptor
+         name="regexp"
+         column="IS_REGEXP"
+         jdbc-type="INTEGER"
+         conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+      />
+
+      <field-descriptor
+         name="profile"
+         column="PROFILE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="order"
+         column="OPTIONS_ORDER"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="skin"
+         column="SKIN"
+         jdbc-type="VARCHAR"
+      />
 
       <collection-descriptor
-          name="fragment"
-          element-class-ref="org.apache.jetspeed.om.page.impl.FragmentImpl"
+          name="metadataFields"
+          element-class-ref="org.apache.jetspeed.om.folder.impl.FolderMenuMetadataLocalizedFieldImpl"
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
           proxy="true"
       >
-         <inverse-foreignkey field-ref="pageId"/>
+         <inverse-foreignkey field-ref="menuId"/>
       </collection-descriptor>
-
+ 
       <collection-descriptor
-          name="metadataFields"
-          element-class-ref="org.apache.jetspeed.om.page.impl.PageMetadataLocalizedFieldImpl"
+          name="elements"
+          element-class-ref="org.apache.jetspeed.om.folder.impl.FolderMenuDefinitionElement"
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
           proxy="true"
       >
-         <inverse-foreignkey field-ref="pageId"/>
+         <orderby name="elementOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="parentId"/>
       </collection-descriptor>
+   </class-descriptor>
 
+   <class-descriptor
+      class="org.apache.jetspeed.om.folder.impl.FolderMenuExcludeDefinitionImpl"
+      table="FOLDER_MENU"
+   >
       <field-descriptor
-         name="path"
-         column="PATH"
+         name="id"
+         column="MENU_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+         name="ojbConcreteClass"
+         column="CLASS_NAME"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
+         name="parentId"
+         column="PARENT_ID"
+         jdbc-type="INTEGER"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="elementOrder"
+         column="ELEMENT_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
          name="name"
          column="NAME"
          jdbc-type="VARCHAR"
       />
+   </class-descriptor>
 
+   <class-descriptor
+      class="org.apache.jetspeed.om.folder.impl.FolderMenuIncludeDefinitionImpl"
+      table="FOLDER_MENU"
+   >
       <field-descriptor
-         name="version"
-         column="VERSION"
-         jdbc-type="VARCHAR"
+         name="id"
+         column="MENU_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
       />
 
       <field-descriptor
-         name="title"
-         column="TITLE"
+         name="ojbConcreteClass"
+         column="CLASS_NAME"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="shortTitle"
-         column="SHORT_TITLE"
+         name="parentId"
+         column="PARENT_ID"
+         jdbc-type="INTEGER"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="elementOrder"
+         column="ELEMENT_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="hidden"
-         column="IS_HIDDEN"
+         name="nest"
+         column="IS_NEST"
          jdbc-type="INTEGER"
          conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
       />
+   </class-descriptor>
 
+   <class-descriptor
+      class="org.apache.jetspeed.om.folder.impl.FolderMenuOptionsDefinitionImpl"
+      table="FOLDER_MENU"
+   >
       <field-descriptor
-         name="skin"
-         column="SKIN"
-         jdbc-type="VARCHAR"
+         name="id"
+         column="MENU_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
       />
 
       <field-descriptor
-         name="defaultLayoutDecorator"
-         column="DEFAULT_LAYOUT_DECORATOR"
+         name="ojbConcreteClass"
+         column="CLASS_NAME"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="defaultPortletDecorator"
-         column="DEFAULT_PORTLET_DECORATOR"
-         jdbc-type="VARCHAR"
+         name="parentId"
+         column="PARENT_ID"
+         jdbc-type="INTEGER"
+         access="anonymous"
       />
 
       <field-descriptor
-         name="subsite"
-         column="SUBSITE"
-         jdbc-type="VARCHAR"
+         name="elementOrder"
+         column="ELEMENT_ORDER"
+         jdbc-type="INTEGER"
       />
 
       <field-descriptor
-         name="user"
-         column="USER_PRINCIPAL"
+         name="options"
+         column="OPTIONS"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="role"
-         column="ROLE_PRINCIPAL"
-         jdbc-type="VARCHAR"
+         name="depth"
+         column="DEPTH"
+         jdbc-type="INTEGER"
       />
 
       <field-descriptor
-         name="group"
-         column="GROUP_PRINCIPAL"
+         name="paths"
+         column="IS_PATHS"
+         jdbc-type="INTEGER"
+         conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+      />
+
+      <field-descriptor
+         name="regexp"
+         column="IS_REGEXP"
+         jdbc-type="INTEGER"
+         conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+      />
+
+      <field-descriptor
+         name="profile"
+         column="PROFILE"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="mediatype"
-         column="MEDIATYPE"
+         name="order"
+         column="OPTIONS_ORDER"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="locale"
-         column="LOCALE"
+         name="skin"
+         column="SKIN"
          jdbc-type="VARCHAR"
       />
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.folder.impl.FolderMenuSeparatorDefinitionImpl"
+      table="FOLDER_MENU"
+   >
+      <field-descriptor
+         name="id"
+         column="MENU_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
 
       <field-descriptor
-         name="extendedAttributeName"
-         column="EXT_ATTR_NAME"
+         name="ojbConcreteClass"
+         column="CLASS_NAME"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="extendedAttributeValue"
-         column="EXT_ATTR_VALUE"
+         name="parentId"
+         column="PARENT_ID"
+         jdbc-type="INTEGER"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="elementOrder"
+         column="ELEMENT_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="title"
+         column="TITLE"
          jdbc-type="VARCHAR"
       />
 
       <field-descriptor
-         name="constraints::owner"
-         column="OWNER_PRINCIPAL"
+         name="text"
+         column="TEXT"
          jdbc-type="VARCHAR"
       />
 
-      <collection-descriptor
-          name="constraints::constraints"
-          element-class-ref="org.apache.jetspeed.om.page.impl.PageSecurityConstraintImpl"
-          auto-retrieve="true"
-          auto-delete="object"
-          auto-update="object"
-          proxy="true"
-      >
-         <orderby name="applyOrder" sort="ASC"/>
-         <inverse-foreignkey field-ref="pageId"/>
-      </collection-descriptor>
+      <field-descriptor
+         name="skin"
+         column="SKIN"
+         jdbc-type="VARCHAR"
+      />
 
       <collection-descriptor
-          name="constraints::constraintsRefs"
-          element-class-ref="org.apache.jetspeed.om.page.impl.PageSecurityConstraintsRef"
+          name="metadataFields"
+          element-class-ref="org.apache.jetspeed.om.folder.impl.FolderMenuMetadataLocalizedFieldImpl"
           auto-retrieve="true"
           auto-delete="object"
           auto-update="object"
           proxy="true"
       >
-         <orderby name="applyOrder" sort="ASC"/>
-         <inverse-foreignkey field-ref="pageId"/>
+         <inverse-foreignkey field-ref="menuId"/>
       </collection-descriptor>
    </class-descriptor>
 
    <class-descriptor
-      class="org.apache.jetspeed.om.page.impl.PageMetadataLocalizedFieldImpl"
-      table="PAGE_METADATA"
+      class="org.apache.jetspeed.om.folder.impl.FolderMenuMetadataLocalizedFieldImpl"
+      table="FOLDER_MENU_METADATA"
    >
       <field-descriptor
          name="id"
@@ -584,8 +758,8 @@
       />
 
       <field-descriptor
-        name="pageId"
-        column="PAGE_ID"
+        name="menuId"
+        column="MENU_ID"
         jdbc-type="INTEGER"
         access="anonymous"
       />
@@ -610,27 +784,269 @@
       />
    </class-descriptor>
 
+   <!-- Page mapping -->
+
    <class-descriptor
-      class="org.apache.jetspeed.om.page.impl.PageSecurityConstraintImpl"
-      table="PAGE_CONSTRAINT"
+      class="org.apache.jetspeed.om.page.impl.PageImpl"
+      table="PAGE"
    >
+      <object-cache class="org.apache.jetspeed.page.impl.DatabasePageManagerCache"/>
+
       <field-descriptor
          name="id"
-         column="CONSTRAINT_ID"
+         column="PAGE_ID"
          jdbc-type="INTEGER"
          primarykey="true"
          autoincrement="true"
       />
 
       <field-descriptor
-        name="pageId"
-        column="PAGE_ID"
+        name="parentId"
+        column="PARENT_ID"
         jdbc-type="INTEGER"
         access="anonymous"
       />
 
-      <field-descriptor
-         name="applyOrder"
+      <reference-descriptor
+          name="parent"
+          class-ref="org.apache.jetspeed.om.folder.impl.FolderImpl"
+          auto-retrieve="true"
+          auto-delete="none"
+          auto-update="none"
+          proxy="true"
+          >
+         <foreignkey field-ref="parentId"/>
+      </reference-descriptor>
+
+      <collection-descriptor
+          name="fragment"
+          element-class-ref="org.apache.jetspeed.om.page.impl.FragmentImpl"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
+      >
+         <inverse-foreignkey field-ref="pageId"/>
+      </collection-descriptor>
+
+      <collection-descriptor
+          name="metadataFields"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageMetadataLocalizedFieldImpl"
+          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"
+      />
+
+      <field-descriptor
+         name="version"
+         column="VERSION"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="title"
+         column="TITLE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="shortTitle"
+         column="SHORT_TITLE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="hidden"
+         column="IS_HIDDEN"
+         jdbc-type="INTEGER"
+         conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+      />
+
+      <field-descriptor
+         name="skin"
+         column="SKIN"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="defaultLayoutDecorator"
+         column="DEFAULT_LAYOUT_DECORATOR"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="defaultPortletDecorator"
+         column="DEFAULT_PORTLET_DECORATOR"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="subsite"
+         column="SUBSITE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="user"
+         column="USER_PRINCIPAL"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="role"
+         column="ROLE_PRINCIPAL"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="group"
+         column="GROUP_PRINCIPAL"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="mediatype"
+         column="MEDIATYPE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="locale"
+         column="LOCALE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="extendedAttributeName"
+         column="EXT_ATTR_NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="extendedAttributeValue"
+         column="EXT_ATTR_VALUE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="constraints::owner"
+         column="OWNER_PRINCIPAL"
+         jdbc-type="VARCHAR"
+      />
+
+      <collection-descriptor
+          name="constraints::constraints"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageSecurityConstraintImpl"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
+      >
+         <orderby name="applyOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="pageId"/>
+      </collection-descriptor>
+
+      <collection-descriptor
+          name="constraints::constraintsRefs"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageSecurityConstraintsRef"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
+      >
+         <orderby name="applyOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="pageId"/>
+      </collection-descriptor>
+
+      <collection-descriptor
+          name="menus"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageMenuDefinitionImpl"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
+      >
+         <orderby name="name" sort="ASC"/>
+         <inverse-foreignkey field-ref="pageId"/>
+      </collection-descriptor>
+
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageMetadataLocalizedFieldImpl"
+      table="PAGE_METADATA"
+   >
+      <field-descriptor
+         name="id"
+         column="METADATA_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="pageId"
+        column="PAGE_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="locale"
+         column="LOCALE"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
+      />
+
+      <field-descriptor
+         name="value"
+         column="VALUE"
+         jdbc-type="VARCHAR"
+      />
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageSecurityConstraintImpl"
+      table="PAGE_CONSTRAINT"
+   >
+      <field-descriptor
+         name="id"
+         column="CONSTRAINT_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="pageId"
+        column="PAGE_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="applyOrder"
          column="APPLY_ORDER"
          jdbc-type="INTEGER"
       />
@@ -692,6 +1108,397 @@
       <field-descriptor
          name="name"
          column="NAME"
+         jdbc-type="VARCHAR"
+      />
+   </class-descriptor>
+
+   <class-descriptor class="org.apache.jetspeed.om.page.impl.PageMenuDefinitionElement">
+      <extent-class class-ref="org.apache.jetspeed.om.page.impl.PageMenuDefinitionImpl"/>
+      <extent-class class-ref="org.apache.jetspeed.om.page.impl.PageMenuExcludeDefinitionImpl"/>
+      <extent-class class-ref="org.apache.jetspeed.om.page.impl.PageMenuIncludeDefinitionImpl"/>
+      <extent-class class-ref="org.apache.jetspeed.om.page.impl.PageMenuOptionsDefinitionImpl"/>
+      <extent-class class-ref="org.apache.jetspeed.om.page.impl.PageMenuSeparatorDefinitionImpl"/>
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageMenuDefinitionImpl"
+      table="PAGE_MENU"
+   >
+      <field-descriptor
+         name="id"
+         column="MENU_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+         name="ojbConcreteClass"
+         column="CLASS_NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="parentId"
+         column="PARENT_ID"
+         jdbc-type="INTEGER"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="pageId"
+         column="PAGE_ID"
+         jdbc-type="INTEGER"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="elementOrder"
+         column="ELEMENT_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="title"
+         column="TITLE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="shortTitle"
+         column="SHORT_TITLE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="options"
+         column="OPTIONS"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="depth"
+         column="DEPTH"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="paths"
+         column="IS_PATHS"
+         jdbc-type="INTEGER"
+         conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+      />
+
+      <field-descriptor
+         name="regexp"
+         column="IS_REGEXP"
+         jdbc-type="INTEGER"
+         conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+      />
+
+      <field-descriptor
+         name="profile"
+         column="PROFILE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="order"
+         column="OPTIONS_ORDER"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="skin"
+         column="SKIN"
+         jdbc-type="VARCHAR"
+      />
+
+      <collection-descriptor
+          name="metadataFields"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageMenuMetadataLocalizedFieldImpl"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
+      >
+         <inverse-foreignkey field-ref="menuId"/>
+      </collection-descriptor>
+ 
+      <collection-descriptor
+          name="elements"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageMenuDefinitionElement"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
+      >
+         <orderby name="elementOrder" sort="ASC"/>
+         <inverse-foreignkey field-ref="parentId"/>
+      </collection-descriptor>
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageMenuExcludeDefinitionImpl"
+      table="PAGE_MENU"
+   >
+      <field-descriptor
+         name="id"
+         column="MENU_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+         name="ojbConcreteClass"
+         column="CLASS_NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="parentId"
+         column="PARENT_ID"
+         jdbc-type="INTEGER"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="elementOrder"
+         column="ELEMENT_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
+         jdbc-type="VARCHAR"
+      />
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageMenuIncludeDefinitionImpl"
+      table="PAGE_MENU"
+   >
+      <field-descriptor
+         name="id"
+         column="MENU_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+         name="ojbConcreteClass"
+         column="CLASS_NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="parentId"
+         column="PARENT_ID"
+         jdbc-type="INTEGER"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="elementOrder"
+         column="ELEMENT_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="nest"
+         column="IS_NEST"
+         jdbc-type="INTEGER"
+         conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+      />
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageMenuOptionsDefinitionImpl"
+      table="PAGE_MENU"
+   >
+      <field-descriptor
+         name="id"
+         column="MENU_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+         name="ojbConcreteClass"
+         column="CLASS_NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="parentId"
+         column="PARENT_ID"
+         jdbc-type="INTEGER"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="elementOrder"
+         column="ELEMENT_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="options"
+         column="OPTIONS"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="depth"
+         column="DEPTH"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="paths"
+         column="IS_PATHS"
+         jdbc-type="INTEGER"
+         conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+      />
+
+      <field-descriptor
+         name="regexp"
+         column="IS_REGEXP"
+         jdbc-type="INTEGER"
+         conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion"
+      />
+
+      <field-descriptor
+         name="profile"
+         column="PROFILE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="order"
+         column="OPTIONS_ORDER"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="skin"
+         column="SKIN"
+         jdbc-type="VARCHAR"
+      />
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageMenuSeparatorDefinitionImpl"
+      table="PAGE_MENU"
+   >
+      <field-descriptor
+         name="id"
+         column="MENU_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+         name="ojbConcreteClass"
+         column="CLASS_NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="parentId"
+         column="PARENT_ID"
+         jdbc-type="INTEGER"
+         access="anonymous"
+      />
+
+      <field-descriptor
+         name="elementOrder"
+         column="ELEMENT_ORDER"
+         jdbc-type="INTEGER"
+      />
+
+      <field-descriptor
+         name="title"
+         column="TITLE"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="text"
+         column="TEXT"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="skin"
+         column="SKIN"
+         jdbc-type="VARCHAR"
+      />
+
+      <collection-descriptor
+          name="metadataFields"
+          element-class-ref="org.apache.jetspeed.om.page.impl.PageMenuMetadataLocalizedFieldImpl"
+          auto-retrieve="true"
+          auto-delete="object"
+          auto-update="object"
+          proxy="true"
+      >
+         <inverse-foreignkey field-ref="menuId"/>
+      </collection-descriptor>
+   </class-descriptor>
+
+   <class-descriptor
+      class="org.apache.jetspeed.om.page.impl.PageMenuMetadataLocalizedFieldImpl"
+      table="PAGE_MENU_METADATA"
+   >
+      <field-descriptor
+         name="id"
+         column="METADATA_ID"
+         jdbc-type="INTEGER"
+         primarykey="true"
+         autoincrement="true"
+      />
+
+      <field-descriptor
+        name="menuId"
+        column="MENU_ID"
+        jdbc-type="INTEGER"
+        access="anonymous"
+      />
+
+      <field-descriptor
+         name="name"
+         column="NAME"
+         jdbc-type="VARCHAR"
+      />
+
+      <field-descriptor
+         name="locale"
+         column="LOCALE"
+         jdbc-type="VARCHAR"
+         conversion="org.apache.jetspeed.util.ojb.LocaleFieldConversion"
+      />
+
+      <field-descriptor
+         name="value"
+         column="VALUE"
          jdbc-type="VARCHAR"
       />
    </class-descriptor>

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionElement.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionElement.java?rev=351770&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionElement.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionElement.java Fri Dec  2 08:52:05 2005
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.folder.impl;
+
+/**
+ * BaseMenuDefinitionElement
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public abstract class BaseMenuDefinitionElement
+{
+    private int id;
+    private String ojbConcreteClass = getClass().getName();
+    private int elementOrder;
+
+    /**
+     * getElementOrder
+     *
+     * @return element order
+     */
+    public int getElementOrder()
+    {
+        return elementOrder;
+    }
+
+    /**
+     * setElementOrder
+     *
+     * @param order element order
+     */
+    public void setElementOrder(int order)
+    {
+        elementOrder = order;
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionElement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionImpl.java?rev=351770&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionImpl.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionImpl.java Fri Dec  2 08:52:05 2005
@@ -0,0 +1,275 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.folder.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.jetspeed.om.folder.MenuDefinition;
+
+/**
+ * BaseMenuDefinitionImpl
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public abstract class BaseMenuDefinitionImpl extends BaseMenuDefinitionMetadata implements MenuDefinition
+{
+    private String name;
+    private String options;
+    private int depth;
+    private boolean paths;
+    private boolean regexp;
+    private String profile;
+    private String order;
+    private String skin;
+    private String title;
+    private String shortTitle;
+    private List elements;
+
+    /**
+     * accessElements
+     *
+     * Access mutable persistent collection member for List wrappers.
+     *
+     * @return persistent collection
+     */
+    public List accessElements()
+    {
+        // create initial collection if necessary
+        if (elements == null)
+        {
+            elements = new ArrayList(4);
+        }
+        return elements;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getName()
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#setName(java.lang.String)
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getOptions()
+     */
+    public String getOptions()
+    {
+        return options;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#setOptions(java.lang.String)
+     */
+    public void setOptions(String options)
+    {
+        this.options = options;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getDepth()
+     */
+    public int getDepth()
+    {
+        return depth;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#setDepth(int)
+     */
+    public void setDepth(int depth)
+    {
+        this.depth = depth;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getPaths()
+     */
+    public boolean isPaths()
+    {
+        return paths;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#setPaths(boolean)
+     */
+    public void setPaths(boolean paths)
+    {
+        this.paths = paths;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getRegexp()
+     */
+    public boolean isRegexp()
+    {
+        return regexp;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#setRegexp(boolean)
+     */
+    public void setRegexp(boolean regexp)
+    {
+        this.regexp = regexp;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getProfile()
+     */
+    public String getProfile()
+    {
+        return profile;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#setProfile(java.lang.String)
+     */
+    public void setProfile(String locatorName)
+    {
+        profile = locatorName;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getOrder()
+     */
+    public String getOrder()
+    {
+        return order;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#setOrder(java.lang.String)
+     */
+    public void setOrder(String order)
+    {
+        this.order = order;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getSkin()
+     */
+    public String getSkin()
+    {
+        return skin;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#setSkin(java.lang.String)
+     */
+    public void setSkin(String name)
+    {
+        skin = name;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getTitle()
+     */
+    public String getTitle()
+    {
+        return title;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#setTitle(java.lang.String)
+     */
+    public void setTitle(String title)
+    {
+        this.title = title;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getShortTitle()
+     */
+    public String getShortTitle()
+    {
+        return shortTitle; 
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#setShortTitle(java.lang.String)
+     */
+    public void setShortTitle(String title)
+    {
+        this.shortTitle = title;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getMenuElements()
+     */
+    public abstract List getMenuElements();
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#setMenuElements(java.util.List)
+     */
+    public void setMenuElements(List elements)
+    {
+        // set menu elements by replacing
+        // existing entries with new elements if
+        // new collection is specified
+        List menuElements = getMenuElements();
+        if (elements != menuElements)
+        {
+            // replace all menu elements
+            menuElements.clear();
+            if (elements != null)
+            {
+                menuElements.addAll(elements);
+            }
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals(Object o)
+    {
+        if (o instanceof BaseMenuDefinitionImpl)
+        {
+            if (name != null)
+            {
+                return name.equals(((BaseMenuDefinitionImpl)o).getName());
+            }
+            else
+            {
+                return (((BaseMenuDefinitionImpl)o).getName() == null);
+            }
+        }
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        if (name != null)
+        {
+            return name.hashCode();
+        }
+        return 0;
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionMetadata.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionMetadata.java?rev=351770&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionMetadata.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionMetadata.java Fri Dec  2 08:52:05 2005
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.folder.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Locale;
+
+import org.apache.jetspeed.om.common.GenericMetadata;
+import org.apache.jetspeed.om.page.PageMetadataImpl;
+
+/**
+ * BaseMenuDefinitionMetadata
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public abstract class BaseMenuDefinitionMetadata extends BaseMenuDefinitionElement 
+{
+    private Collection metadataFields;
+
+    private PageMetadataImpl pageMetadata;
+
+    /**
+     * newPageMetadata
+     *
+     * Construct page manager specific metadata implementation.
+     *
+     * @param fields mutable fields collection
+     * @return page metadata
+     */
+    public abstract PageMetadataImpl newPageMetadata(Collection fields);
+
+    /**
+     * getPageMetadata
+     *
+     * Get page manager specific metadata implementation.
+     *
+     * @return page metadata
+     */
+    public PageMetadataImpl getPageMetadata()
+    {
+        if (pageMetadata == null)
+        {
+            if (metadataFields == null)
+            {
+                metadataFields = new ArrayList(1);
+            }
+            pageMetadata = newPageMetadata(metadataFields);
+        }
+        return pageMetadata;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getTitle()
+     * @see org.apache.jetspeed.om.folder.MenuSeparatorDefinition#getTitle()
+     */
+    public String getTitle()
+    {
+        // no title available by default
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getShortTitle()
+     */
+    public String getShortTitle()
+    {
+        // no short title available by default
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuSeparatorDefinition#getText()
+     */
+    public String getText()
+    {
+        // no text available by default
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getTitle(java.util.Locale)
+     * @see org.apache.jetspeed.om.folder.MenuSeparatorDefinition#getTitle(java.util.Locale)
+     */
+    public String getTitle(Locale locale)
+    {
+        // get title from metadata or use default title
+        String title = getPageMetadata().getText("title", locale);
+        if (title == null)
+        {
+            title = getTitle();
+        }
+        return title;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getShortTitle(java.util.Locale)
+     */
+    public String getShortTitle(Locale locale)
+    {
+        // get short title from metadata or use title from metadata,
+        // default short title, or default title
+        String shortTitle = getPageMetadata().getText("short-title", locale);
+        if (shortTitle == null)
+        {
+            shortTitle = getPageMetadata().getText("title", locale);
+            if (shortTitle == null)
+            {
+                shortTitle = getShortTitle();
+                if (shortTitle == null)
+                {
+                    shortTitle = getTitle();
+                }
+            }
+        }
+        return shortTitle;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuSeparatorDefinition#getText(java.util.Locale)
+     */
+    public String getText(Locale locale)
+    {
+        // get title from metadata or use default title
+        String text = getPageMetadata().getText("text", locale);
+        if (text == null)
+        {
+            text = getText();
+        }
+        return text;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getMetadata()
+     * @see org.apache.jetspeed.om.folder.MenuSeparatorDefinition#getMetadata()
+     */
+    public GenericMetadata getMetadata()
+    {
+        return getPageMetadata();
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuDefinitionMetadata.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuExcludeDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuExcludeDefinitionImpl.java?rev=351770&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuExcludeDefinitionImpl.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuExcludeDefinitionImpl.java Fri Dec  2 08:52:05 2005
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.folder.impl;
+
+import org.apache.jetspeed.om.folder.MenuExcludeDefinition;
+
+/**
+ * BaseMenuExcludeDefinitionImpl
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public abstract class BaseMenuExcludeDefinitionImpl extends BaseMenuDefinitionElement implements MenuExcludeDefinition
+{
+    private String name;
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuExcludeDefinition#getName()
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuExcludeDefinition#setName(java.lang.String)
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuExcludeDefinitionImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuIncludeDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuIncludeDefinitionImpl.java?rev=351770&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuIncludeDefinitionImpl.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuIncludeDefinitionImpl.java Fri Dec  2 08:52:05 2005
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.folder.impl;
+
+import org.apache.jetspeed.om.folder.MenuIncludeDefinition;
+
+/**
+ * BaseMenuIncludeDefinitionImpl
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public abstract class BaseMenuIncludeDefinitionImpl extends BaseMenuDefinitionElement implements MenuIncludeDefinition
+{
+    private String name;
+    private boolean nest;
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuIncludeDefinition#getName()
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuIncludeDefinition#setName(java.lang.String)
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuIncludeDefinition#isNest()
+     */
+    public boolean isNest()
+    {
+        return nest;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuIncludeDefinition#setNest(boolean)
+     */
+    public void setNest(boolean nest)
+    {
+        this.nest = nest;
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuIncludeDefinitionImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuOptionsDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuOptionsDefinitionImpl.java?rev=351770&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuOptionsDefinitionImpl.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuOptionsDefinitionImpl.java Fri Dec  2 08:52:05 2005
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.folder.impl;
+
+import org.apache.jetspeed.om.folder.MenuOptionsDefinition;
+
+/**
+ * BaseMenuOptionsDefinitionImpl
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public abstract class BaseMenuOptionsDefinitionImpl extends BaseMenuDefinitionElement implements MenuOptionsDefinition
+{
+    private String options;
+    private int depth;
+    private boolean paths;
+    private boolean regexp;
+    private String profile;
+    private String order;
+    private String skin;
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#getOptions()
+     */
+    public String getOptions()
+    {
+        return options;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#setOptions(java.lang.String)
+     */
+    public void setOptions(String options)
+    {
+        this.options = options;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#getDepth()
+     */
+    public int getDepth()
+    {
+        return depth;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#setDepth(int)
+     */
+    public void setDepth(int depth)
+    {
+        this.depth = depth;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#isPaths()
+     */
+    public boolean isPaths()
+    {
+        return paths;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#setPaths(boolean)
+     */
+    public void setPaths(boolean paths)
+    {
+        this.paths = paths;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#isRegexp()
+     */
+    public boolean isRegexp()
+    {
+        return regexp;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#setRegexp(boolean)
+     */
+    public void setRegexp(boolean regexp)
+    {
+        this.regexp = regexp;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#getProfile()
+     */
+    public String getProfile()
+    {
+        return profile;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#setProfile(java.lang.String)
+     */
+    public void setProfile(String locatorName)
+    {
+        profile = locatorName;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#getOrder()
+     */
+    public String getOrder()
+    {
+        return order;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#setOrder(java.lang.String)
+     */
+    public void setOrder(String order)
+    {
+        this.order = order;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#getSkin()
+     */
+    public String getSkin()
+    {
+        return skin;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuOptionsDefinition#setSkin(java.lang.String)
+     */
+    public void setSkin(String name)
+    {
+        skin = name;
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuOptionsDefinitionImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuSeparatorDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuSeparatorDefinitionImpl.java?rev=351770&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuSeparatorDefinitionImpl.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuSeparatorDefinitionImpl.java Fri Dec  2 08:52:05 2005
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.folder.impl;
+
+import org.apache.jetspeed.om.folder.MenuSeparatorDefinition;
+
+/**
+ * BaseMenuSeparatorDefinitionImpl
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public abstract class BaseMenuSeparatorDefinitionImpl extends BaseMenuDefinitionMetadata implements MenuSeparatorDefinition 
+{
+    private String skin;
+    private String title;
+    private String text;
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuSeparatorDefinition#getSkin()
+     */
+    public String getSkin()
+    {
+        return skin;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuSeparatorDefinition#setSkin(java.lang.String)
+     */
+    public void setSkin(String name)
+    {
+        skin = name;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuSeparatorDefinition#getTitle()
+     */
+    public String getTitle()
+    {
+        return title;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuSeparatorDefinition#setTitle(java.lang.String)
+     */
+    public void setTitle(String title)
+    {
+        this.title = title;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuSeparatorDefinition#getText()
+     */
+    public String getText()
+    {
+        return text;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuSeparatorDefinition#setText(java.lang.String)
+     */
+    public void setText(String text)
+    {
+        this.text = text;
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/BaseMenuSeparatorDefinitionImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

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=351770&r1=351769&r2=351770&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 Fri Dec  2 08:52:05 2005
@@ -26,6 +26,11 @@
 import org.apache.jetspeed.om.common.SecuredResource;
 import org.apache.jetspeed.om.folder.Folder;
 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.page.Link;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageMetadataImpl;
@@ -56,6 +61,7 @@
     private List pages;
     private List pageSecurity;
     private List orders;
+    private List menus;
 
     private FolderOrderList documentOrder;
     private boolean documentOrderComparatorValid;
@@ -63,6 +69,7 @@
     private NodeSet allNodeSet;
     private NodeSet foldersNodeSet;
     private NodeSet pagesNodeSet;
+    private FolderMenuDefinitionList menuDefinitions;
 
     public FolderImpl()
     {
@@ -87,6 +94,23 @@
     }
 
     /**
+     * accessMenus
+     *
+     * Access mutable persistent collection member for List wrappers.
+     *
+     * @return persistent collection
+     */
+    List accessMenus()
+    {
+        // create initial collection if necessary
+        if (menus == null)
+        {
+            menus = new ArrayList(2);
+        }
+        return menus;
+    }
+
+    /**
      * addFolder
      *
      * Adds a folder to the persistent collection and resets cached node sets.
@@ -488,15 +512,74 @@
      */
     public List getMenuDefinitions()
     {
-        return null; // NYI
+        // return mutable menu definition list
+        // by using list wrapper to manage
+        // element uniqueness
+        if (menuDefinitions == null)
+        {
+            menuDefinitions = new FolderMenuDefinitionList(this);
+        }
+        return menuDefinitions;
     }
     
     /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.Folder#newMenuDefinition()
+     */
+    public MenuDefinition newMenuDefinition()
+    {
+        return new FolderMenuDefinitionImpl();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.Folder#newMenuExcludeDefinition()
+     */
+    public MenuExcludeDefinition newMenuExcludeDefinition()
+    {
+        return new FolderMenuExcludeDefinitionImpl();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.Folder#newMenuIncludeDefinition()
+     */
+    public MenuIncludeDefinition newMenuIncludeDefinition()
+    {
+        return new FolderMenuIncludeDefinitionImpl();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.Folder#newMenuOptionsDefinition()
+     */
+    public MenuOptionsDefinition newMenuOptionsDefinition()
+    {
+        return new FolderMenuOptionsDefinitionImpl();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.Folder#newMenuSeparatorDefinition()
+     */
+    public MenuSeparatorDefinition newMenuSeparatorDefinition()
+    {
+        return new FolderMenuSeparatorDefinitionImpl();
+    }
+
+    /* (non-Javadoc)
      * @see org.apache.jetspeed.om.folder.Folder#setMenuDefinitions(java.util.List)
      */
     public void setMenuDefinitions(List definitions)
     {
-        // NYI
+        // set menu definitions by replacing
+        // existing entries with new elements if
+        // new collection is specified
+        List menuDefinitions = getMenuDefinitions();
+        if (definitions != menuDefinitions)
+        {
+            // replace all menu definitions
+            menuDefinitions.clear();
+            if (definitions != null)
+            {
+                menuDefinitions.addAll(definitions);
+            }
+        }
     }
 
     /* (non-Javadoc)

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElement.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElement.java?rev=351770&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElement.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElement.java Fri Dec  2 08:52:05 2005
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.folder.impl;
+
+/**
+ * FolderMenuDefinitionElement
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public interface FolderMenuDefinitionElement
+{
+    // new interface defined only to facilitate OJB table/class mapping
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.impl.BaseMenuDefinitionElement#getElementOrder()
+     */
+    int getElementOrder();
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.impl.BaseMenuDefinitionElement#setElementOrder(int)
+     */
+    void setElementOrder(int order);
+}

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElementList.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElementList.java?rev=351770&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElementList.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElementList.java Fri Dec  2 08:52:05 2005
@@ -0,0 +1,215 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.folder.impl;
+
+import java.util.AbstractList;
+import java.util.ArrayList;
+import java.util.List;
+
+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;
+
+/**
+ * FolderMenuDefinitionElementList
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+class FolderMenuDefinitionElementList extends AbstractList
+{
+    private FolderMenuDefinitionImpl menuDefinition;
+
+    FolderMenuDefinitionElementList(FolderMenuDefinitionImpl menuDefinition)
+    {
+        super();
+        this.menuDefinition = menuDefinition;
+    }
+
+    /**
+     * validateMenuElementForAdd
+     *
+     * Validates element to be added to this list.
+     *
+     * @param menuElement element to add
+     * @return list element to add
+     */
+    private FolderMenuDefinitionElement validateMenuElementForAdd(Object menuElement)
+    {
+        // validate element instance class
+        if (menuElement == null)
+        {
+            throw new NullPointerException("Unable to add null to list.");
+        }
+        if (!(menuElement instanceof FolderMenuDefinitionElement))
+        {
+            // duplicate menu element from equivalent types
+            if (menuElement instanceof MenuDefinition)
+            {
+                MenuDefinition origMenuElement = (MenuDefinition)menuElement;
+                FolderMenuDefinitionImpl dupMenuElement = new FolderMenuDefinitionImpl();
+                // TODO: move this logic to copy methods on implementations
+                dupMenuElement.setName(origMenuElement.getName());
+                dupMenuElement.setOptions(origMenuElement.getOptions());
+                dupMenuElement.setDepth(origMenuElement.getDepth());
+                dupMenuElement.setPaths(origMenuElement.isPaths());
+                dupMenuElement.setRegexp(origMenuElement.isRegexp());
+                dupMenuElement.setProfile(origMenuElement.getProfile());
+                dupMenuElement.setOrder(origMenuElement.getOrder());
+                dupMenuElement.setSkin(origMenuElement.getSkin());
+                dupMenuElement.setTitle(origMenuElement.getTitle());
+                dupMenuElement.setShortTitle(origMenuElement.getShortTitle());
+                dupMenuElement.setMenuElements(origMenuElement.getMenuElements());
+                dupMenuElement.getMetadata().copyFields(origMenuElement.getMetadata().getFields());
+                menuElement = dupMenuElement;
+            }
+            else if (menuElement instanceof MenuExcludeDefinition)
+            {
+                MenuExcludeDefinition origMenuElement = (MenuExcludeDefinition)menuElement;
+                FolderMenuExcludeDefinitionImpl dupMenuElement = new FolderMenuExcludeDefinitionImpl();
+                // TODO: move this logic to copy methods on implementations
+                dupMenuElement.setName(origMenuElement.getName());
+                menuElement = dupMenuElement;
+            }
+            else if (menuElement instanceof MenuIncludeDefinition)
+            {
+                MenuIncludeDefinition origMenuElement = (MenuIncludeDefinition)menuElement;
+                FolderMenuIncludeDefinitionImpl dupMenuElement = new FolderMenuIncludeDefinitionImpl();
+                // TODO: move this logic to copy methods on implementations
+                dupMenuElement.setName(origMenuElement.getName());
+                dupMenuElement.setNest(origMenuElement.isNest());
+                menuElement = dupMenuElement;
+            }
+            else if (menuElement instanceof MenuOptionsDefinition)
+            {
+                MenuOptionsDefinition origMenuElement = (MenuOptionsDefinition)menuElement;
+                FolderMenuOptionsDefinitionImpl dupMenuElement = new FolderMenuOptionsDefinitionImpl();
+                // TODO: move this logic to copy methods on implementations
+                dupMenuElement.setOptions(origMenuElement.getOptions());
+                dupMenuElement.setDepth(origMenuElement.getDepth());
+                dupMenuElement.setPaths(origMenuElement.isPaths());
+                dupMenuElement.setRegexp(origMenuElement.isRegexp());
+                dupMenuElement.setProfile(origMenuElement.getProfile());
+                dupMenuElement.setOrder(origMenuElement.getOrder());
+                dupMenuElement.setSkin(origMenuElement.getSkin());
+                menuElement = dupMenuElement;
+            }
+            else if (menuElement instanceof MenuSeparatorDefinition)
+            {
+                MenuSeparatorDefinition origMenuElement = (MenuSeparatorDefinition)menuElement;
+                FolderMenuSeparatorDefinitionImpl dupMenuElement = new FolderMenuSeparatorDefinitionImpl();
+                // TODO: move this logic to copy methods on implementations
+                dupMenuElement.setSkin(origMenuElement.getSkin());
+                dupMenuElement.setTitle(origMenuElement.getTitle());
+                dupMenuElement.setText(origMenuElement.getText());
+                dupMenuElement.getMetadata().copyFields(origMenuElement.getMetadata().getFields());
+                menuElement = dupMenuElement;
+            }
+            else
+            {
+                throw new ClassCastException("Unable to create menu element list instance from: " + menuElement.getClass().getName() + ".");
+            }
+        }
+        return (FolderMenuDefinitionElement)menuElement;
+    }
+
+    /* (non-Javadoc)
+     * @see java.util.List#add(int,java.lang.Object)
+     */
+    public void add(int index, Object element)
+    {
+        // implement for modifiable AbstractList:
+        // validate index
+        if ((index < 0) || (index > menuDefinition.accessElements().size()))
+        {
+            throw new IndexOutOfBoundsException("Unable to add to list at index: " + index);
+        }
+        // verify element
+        FolderMenuDefinitionElement menuElement = validateMenuElementForAdd(element);
+        // add to underlying ordered list
+        menuDefinition.accessElements().add(index, menuElement);
+        // set element order in added element
+        if (index > 0)
+        {
+            menuElement.setElementOrder(((FolderMenuDefinitionElement)menuDefinition.accessElements().get(index-1)).getElementOrder() + 1);
+        }
+        else
+        {
+            menuElement.setElementOrder(0);
+        }
+        // maintain element order in subsequent elements
+        for (int i = index, limit = menuDefinition.accessElements().size() - 1; (i < limit); i++)
+        {
+            FolderMenuDefinitionElement nextMenuElement = (FolderMenuDefinitionElement)menuDefinition.accessElements().get(i + 1);
+            if (nextMenuElement.getElementOrder() <= menuElement.getElementOrder())
+            {
+                // adjust element order for next element
+                nextMenuElement.setElementOrder(menuElement.getElementOrder() + 1);
+                menuElement = nextMenuElement;
+            }
+            else
+            {
+                // element order maintained for remaining list elements
+                break;
+            }
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see java.util.List#get(int)
+     */
+    public Object get(int index)
+    {
+        // implement for modifiable AbstractList
+        return menuDefinition.accessElements().get(index);
+    }
+
+    /* (non-Javadoc)
+     * @see java.util.List#remove(int)
+     */
+    public Object remove(int index)
+    {
+        // implement for modifiable AbstractList
+        return menuDefinition.accessElements().remove(index);
+    }
+
+    /* (non-Javadoc)
+     * @see java.util.List#set(int,java.lang.Object)
+     */
+    public Object set(int index, Object element)
+    {
+        // implement for modifiable AbstractList:
+        // verify element
+        FolderMenuDefinitionElement newMenuElement = validateMenuElementForAdd(element);
+        // set in underlying ordered list
+        FolderMenuDefinitionElement menuElement = (FolderMenuDefinitionElement)menuDefinition.accessElements().set(index, newMenuElement);
+        // set element order in new element
+        newMenuElement.setElementOrder(menuElement.getElementOrder());
+        // return element
+        return menuElement;
+    }
+
+    /* (non-Javadoc)
+     * @see java.util.List#size()
+     */
+    public int size()
+    {
+        // implement for modifiable AbstractList
+        return menuDefinition.accessElements().size();
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElementList.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionImpl.java?rev=351770&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionImpl.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionImpl.java Fri Dec  2 08:52:05 2005
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.om.folder.impl;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.jetspeed.om.folder.MenuDefinition;
+import org.apache.jetspeed.om.page.PageMetadataImpl;
+
+/**
+ * FolderMenuDefinitionImpl
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public class FolderMenuDefinitionImpl extends BaseMenuDefinitionImpl implements MenuDefinition, FolderMenuDefinitionElement
+{
+    // new class defined only to facilitate OJB table/class mapping
+
+    private FolderMenuDefinitionElementList menuElements;
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.impl.BaseMenuDefinitionMetadata#newPageMetadata()
+     */
+    public PageMetadataImpl newPageMetadata(Collection fields)
+    {
+        PageMetadataImpl pageMetadata = new PageMetadataImpl(FolderMenuMetadataLocalizedFieldImpl.class);
+        pageMetadata.setFields(fields);
+        return pageMetadata;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.folder.MenuDefinition#getMenuElements()
+     */
+    public List getMenuElements()
+    {
+        // return mutable menu element list
+        // by using list wrapper to manage
+        // element order
+        if (menuElements == null)
+        {
+            menuElements = new FolderMenuDefinitionElementList(this);
+        }
+        return menuElements;
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native



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