portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r351848 - in /portals/jetspeed-2/trunk: components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/ components/page-manager/src/java/org/apache/jetspeed/om/page/impl/ components/page-manager/src/java/org/apache/jetspeed/page/ compo...
Date Fri, 02 Dec 2005 23:19:23 GMT
Author: rwatler
Date: Fri Dec  2 15:19:11 2005
New Revision: 351848

URL: http://svn.apache.org/viewcvs?rev=351848&view=rev
Log:
expand PageManager.newX() APIs to support Page/Folder/Fragment/PageSecurity specific constraint and menu om implementation types

Modified:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElementList.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionList.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/FragmentPreferenceList.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionElementList.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionList.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsDefList.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/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/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestSecureDatabasePageManager.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java

Modified: 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=351848&r1=351847&r2=351848&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElementList.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionElementList.java Fri Dec  2 15:19:11 2005
@@ -49,83 +49,14 @@
      * @param menuElement element to add
      * @return list element to add
      */
-    private FolderMenuDefinitionElement validateMenuElementForAdd(Object menuElement)
+    private FolderMenuDefinitionElement validateMenuElementForAdd(FolderMenuDefinitionElement 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;
+        return menuElement;
     }
 
     /* (non-Javadoc)
@@ -140,7 +71,7 @@
             throw new IndexOutOfBoundsException("Unable to add to list at index: " + index);
         }
         // verify element
-        FolderMenuDefinitionElement menuElement = validateMenuElementForAdd(element);
+        FolderMenuDefinitionElement menuElement = validateMenuElementForAdd((FolderMenuDefinitionElement)element);
         // add to underlying ordered list
         menuDefinition.accessElements().add(index, menuElement);
         // set element order in added element
@@ -195,7 +126,7 @@
     {
         // implement for modifiable AbstractList:
         // verify element
-        FolderMenuDefinitionElement newMenuElement = validateMenuElementForAdd(element);
+        FolderMenuDefinitionElement newMenuElement = validateMenuElementForAdd((FolderMenuDefinitionElement)element);
         // set in underlying ordered list
         FolderMenuDefinitionElement menuElement = (FolderMenuDefinitionElement)menuDefinition.accessElements().set(index, newMenuElement);
         // set element order in new element

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionList.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionList.java?rev=351848&r1=351847&r2=351848&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionList.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMenuDefinitionList.java Fri Dec  2 15:19:11 2005
@@ -47,40 +47,13 @@
      * @param definition menu definition to add
      * @return list element to add
      */
-    private FolderMenuDefinitionImpl validateDefinitionForAdd(Object definition)
+    private FolderMenuDefinitionImpl validateDefinitionForAdd(FolderMenuDefinitionImpl definition)
     {
         // only non-null definitions supported
         if (definition == null)
         {
             throw new NullPointerException("Unable to add null to list.");
         }
-        if (!(definition instanceof FolderMenuDefinitionImpl))
-        {
-            // duplicate menu element from equivalent types
-            if (definition instanceof MenuDefinition)
-            {
-                MenuDefinition origDefinition = (MenuDefinition)definition;
-                FolderMenuDefinitionImpl dupDefinition = new FolderMenuDefinitionImpl();
-                // TODO: move this logic to copy methods on implementations
-                dupDefinition.setName(origDefinition.getName());
-                dupDefinition.setOptions(origDefinition.getOptions());
-                dupDefinition.setDepth(origDefinition.getDepth());
-                dupDefinition.setPaths(origDefinition.isPaths());
-                dupDefinition.setRegexp(origDefinition.isRegexp());
-                dupDefinition.setProfile(origDefinition.getProfile());
-                dupDefinition.setOrder(origDefinition.getOrder());
-                dupDefinition.setSkin(origDefinition.getSkin());
-                dupDefinition.setTitle(origDefinition.getTitle());
-                dupDefinition.setShortTitle(origDefinition.getShortTitle());
-                dupDefinition.setMenuElements(origDefinition.getMenuElements());
-                dupDefinition.getMetadata().copyFields(origDefinition.getMetadata().getFields());
-                definition = dupDefinition;
-            }
-            else
-            {
-                throw new ClassCastException("Unable to create menu element list instance from: " + definition.getClass().getName() + ".");
-            }
-        }
         // make sure element is unique
         if (folder.accessMenus().contains(definition))
         {
@@ -96,19 +69,19 @@
             {
                 // reuse menu definition with matching name
                 FolderMenuDefinitionImpl addDefinition = (FolderMenuDefinitionImpl)definition;
-                FolderMenuDefinitionImpl removedDefinition = (FolderMenuDefinitionImpl)removedMenuDefinitions.remove(removedIndex);
+                definition = (FolderMenuDefinitionImpl)removedMenuDefinitions.remove(removedIndex);
                 // TODO: move this logic to copy methods on implementations
                 // copy menu definition members
-                removedDefinition.setOptions(addDefinition.getOptions());
-                removedDefinition.setDepth(addDefinition.getDepth());
-                removedDefinition.setPaths(addDefinition.isPaths());
-                removedDefinition.setRegexp(addDefinition.isRegexp());
-                removedDefinition.setProfile(addDefinition.getProfile());
-                removedDefinition.setOrder(addDefinition.getOrder());
-                removedDefinition.setSkin(addDefinition.getSkin());
-                removedDefinition.setTitle(addDefinition.getTitle());
-                removedDefinition.setShortTitle(addDefinition.getShortTitle());
-                removedDefinition.setMenuElements(addDefinition.getMenuElements());
+                definition.setOptions(addDefinition.getOptions());
+                definition.setDepth(addDefinition.getDepth());
+                definition.setPaths(addDefinition.isPaths());
+                definition.setRegexp(addDefinition.isRegexp());
+                definition.setProfile(addDefinition.getProfile());
+                definition.setOrder(addDefinition.getOrder());
+                definition.setSkin(addDefinition.getSkin());
+                definition.setTitle(addDefinition.getTitle());
+                definition.setShortTitle(addDefinition.getShortTitle());
+                definition.setMenuElements(addDefinition.getMenuElements());
                 // copy menu definition metadata members
                 // TODO: strengthen... this code is not robust
                 // and may fail if multiple edits without a db
@@ -118,11 +91,10 @@
                 // metadata members are required to be unique
                 // and a removal list is not maintained for the
                 // metadata fields collections yet
-                removedDefinition.getMetadata().copyFields(addDefinition.getMetadata().getFields());
-                definition = removedDefinition;
+                definition.getMetadata().copyFields(addDefinition.getMetadata().getFields());
             }
         }
-        return (FolderMenuDefinitionImpl)definition;
+        return definition;
     }
 
     /**
@@ -151,7 +123,7 @@
             throw new IndexOutOfBoundsException("Unable to add to list at index: " + index);
         }
         // verify menu definition
-        FolderMenuDefinitionImpl definition = validateDefinitionForAdd(element);
+        FolderMenuDefinitionImpl definition = validateDefinitionForAdd((FolderMenuDefinitionImpl)element);
         // add to underlying ordered list
         folder.accessMenus().add(index, definition);
     }
@@ -187,7 +159,7 @@
     {
         // implement for modifiable AbstractList:
         // verify menu definition
-        FolderMenuDefinitionImpl newDefinition = validateDefinitionForAdd(element);
+        FolderMenuDefinitionImpl newDefinition = validateDefinitionForAdd((FolderMenuDefinitionImpl)element);
         // set in underlying ordered list
         FolderMenuDefinitionImpl definition = (FolderMenuDefinitionImpl)folder.accessMenus().set(index, newDefinition);
         // save replaced element

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=351848&r1=351847&r2=351848&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 Fri Dec  2 15:19:11 2005
@@ -282,11 +282,9 @@
      */
     public void setSecurityConstraints(SecurityConstraints constraints)
     {
-        // copy constraints to maintain persistent
-        // collection members
         if (this.constraints != null)
         {
-            // TODO: move this logic to copy methods on implementations
+            // set constraints configuration in nested om implementation instance
             this.constraints.setOwner(constraints.getOwner());
             this.constraints.setSecurityConstraints(constraints.getSecurityConstraints());
             this.constraints.setSecurityConstraintsRefs(constraints.getSecurityConstraintsRefs());

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentPreferenceList.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentPreferenceList.java?rev=351848&r1=351847&r2=351848&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentPreferenceList.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentPreferenceList.java Fri Dec  2 15:19:11 2005
@@ -67,6 +67,7 @@
             {
                 FragmentPreferenceImpl addPreference = preference;
                 preference = (FragmentPreferenceImpl)removedPreferences.remove(removedIndex);
+                // TODO: move this logic to copy methods on implementations
                 preference.setReadOnly(addPreference.isReadOnly());
                 preference.setValueList(addPreference.getValueList());
             }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionElementList.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionElementList.java?rev=351848&r1=351847&r2=351848&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionElementList.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionElementList.java Fri Dec  2 15:19:11 2005
@@ -49,83 +49,14 @@
      * @param menuElement element to add
      * @return list element to add
      */
-    private PageMenuDefinitionElement validateMenuElementForAdd(Object menuElement)
+    private PageMenuDefinitionElement validateMenuElementForAdd(PageMenuDefinitionElement menuElement)
     {
-        // validate element instance class
+        // validate element instance
         if (menuElement == null)
         {
             throw new NullPointerException("Unable to add null to list.");
         }
-        if (!(menuElement instanceof PageMenuDefinitionElement))
-        {
-            // duplicate menu element from equivalent types
-            if (menuElement instanceof MenuDefinition)
-            {
-                MenuDefinition origMenuElement = (MenuDefinition)menuElement;
-                PageMenuDefinitionImpl dupMenuElement = new PageMenuDefinitionImpl();
-                // 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;
-                PageMenuExcludeDefinitionImpl dupMenuElement = new PageMenuExcludeDefinitionImpl();
-                // TODO: move this logic to copy methods on implementations
-                dupMenuElement.setName(origMenuElement.getName());
-                menuElement = dupMenuElement;
-            }
-            else if (menuElement instanceof MenuIncludeDefinition)
-            {
-                MenuIncludeDefinition origMenuElement = (MenuIncludeDefinition)menuElement;
-                PageMenuIncludeDefinitionImpl dupMenuElement = new PageMenuIncludeDefinitionImpl();
-                // 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;
-                PageMenuOptionsDefinitionImpl dupMenuElement = new PageMenuOptionsDefinitionImpl();
-                // 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;
-                PageMenuSeparatorDefinitionImpl dupMenuElement = new PageMenuSeparatorDefinitionImpl();
-                // 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 (PageMenuDefinitionElement)menuElement;
+        return menuElement;
     }
 
     /* (non-Javadoc)
@@ -140,7 +71,7 @@
             throw new IndexOutOfBoundsException("Unable to add to list at index: " + index);
         }
         // verify element
-        PageMenuDefinitionElement menuElement = validateMenuElementForAdd(element);
+        PageMenuDefinitionElement menuElement = validateMenuElementForAdd((PageMenuDefinitionElement)element);
         // add to underlying ordered list
         menuDefinition.accessElements().add(index, menuElement);
         // set element order in added element
@@ -195,7 +126,7 @@
     {
         // implement for modifiable AbstractList:
         // verify element
-        PageMenuDefinitionElement newMenuElement = validateMenuElementForAdd(element);
+        PageMenuDefinitionElement newMenuElement = validateMenuElementForAdd((PageMenuDefinitionElement)element);
         // set in underlying ordered list
         PageMenuDefinitionElement menuElement = (PageMenuDefinitionElement)menuDefinition.accessElements().set(index, newMenuElement);
         // set element order in new element

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionList.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionList.java?rev=351848&r1=351847&r2=351848&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionList.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageMenuDefinitionList.java Fri Dec  2 15:19:11 2005
@@ -47,40 +47,13 @@
      * @param definition menu definition to add
      * @return list element to add
      */
-    private PageMenuDefinitionImpl validateDefinitionForAdd(Object definition)
+    private PageMenuDefinitionImpl validateDefinitionForAdd(PageMenuDefinitionImpl definition)
     {
         // only non-null definitions supported
         if (definition == null)
         {
             throw new NullPointerException("Unable to add null to list.");
         }
-        if (!(definition instanceof PageMenuDefinitionImpl))
-        {
-            // duplicate menu element from equivalent types
-            if (definition instanceof MenuDefinition)
-            {
-                MenuDefinition origDefinition = (MenuDefinition)definition;
-                PageMenuDefinitionImpl dupDefinition = new PageMenuDefinitionImpl();
-                // TODO: move this logic to copy methods on implementations
-                dupDefinition.setName(origDefinition.getName());
-                dupDefinition.setOptions(origDefinition.getOptions());
-                dupDefinition.setDepth(origDefinition.getDepth());
-                dupDefinition.setPaths(origDefinition.isPaths());
-                dupDefinition.setRegexp(origDefinition.isRegexp());
-                dupDefinition.setProfile(origDefinition.getProfile());
-                dupDefinition.setOrder(origDefinition.getOrder());
-                dupDefinition.setSkin(origDefinition.getSkin());
-                dupDefinition.setTitle(origDefinition.getTitle());
-                dupDefinition.setShortTitle(origDefinition.getShortTitle());
-                dupDefinition.setMenuElements(origDefinition.getMenuElements());
-                dupDefinition.getMetadata().copyFields(origDefinition.getMetadata().getFields());
-                definition = dupDefinition;
-            }
-            else
-            {
-                throw new ClassCastException("Unable to create menu element list instance from: " + definition.getClass().getName() + ".");
-            }
-        }
         // make sure element is unique
         if (page.accessMenus().contains(definition))
         {
@@ -96,19 +69,19 @@
             {
                 // reuse menu definition with matching name
                 PageMenuDefinitionImpl addDefinition = (PageMenuDefinitionImpl)definition;
-                PageMenuDefinitionImpl removedDefinition = (PageMenuDefinitionImpl)removedMenuDefinitions.remove(removedIndex);
+                definition = (PageMenuDefinitionImpl)removedMenuDefinitions.remove(removedIndex);
                 // TODO: move this logic to copy methods on implementations
                 // copy menu definition members
-                removedDefinition.setOptions(addDefinition.getOptions());
-                removedDefinition.setDepth(addDefinition.getDepth());
-                removedDefinition.setPaths(addDefinition.isPaths());
-                removedDefinition.setRegexp(addDefinition.isRegexp());
-                removedDefinition.setProfile(addDefinition.getProfile());
-                removedDefinition.setOrder(addDefinition.getOrder());
-                removedDefinition.setSkin(addDefinition.getSkin());
-                removedDefinition.setTitle(addDefinition.getTitle());
-                removedDefinition.setShortTitle(addDefinition.getShortTitle());
-                removedDefinition.setMenuElements(addDefinition.getMenuElements());
+                definition.setOptions(addDefinition.getOptions());
+                definition.setDepth(addDefinition.getDepth());
+                definition.setPaths(addDefinition.isPaths());
+                definition.setRegexp(addDefinition.isRegexp());
+                definition.setProfile(addDefinition.getProfile());
+                definition.setOrder(addDefinition.getOrder());
+                definition.setSkin(addDefinition.getSkin());
+                definition.setTitle(addDefinition.getTitle());
+                definition.setShortTitle(addDefinition.getShortTitle());
+                definition.setMenuElements(addDefinition.getMenuElements());
                 // copy menu definition metadata members
                 // TODO: strengthen... this code is not robust
                 // and may fail if multiple edits without a db
@@ -118,11 +91,10 @@
                 // metadata members are required to be unique
                 // and a removal list is not maintained for the
                 // metadata fields collections yet
-                removedDefinition.getMetadata().copyFields(addDefinition.getMetadata().getFields());
-                definition = removedDefinition;
+                definition.getMetadata().copyFields(addDefinition.getMetadata().getFields());
             }
         }
-        return (PageMenuDefinitionImpl)definition;
+        return definition;
     }
 
     /**
@@ -151,7 +123,7 @@
             throw new IndexOutOfBoundsException("Unable to add to list at index: " + index);
         }
         // verify menu definition
-        PageMenuDefinitionImpl definition = validateDefinitionForAdd(element);
+        PageMenuDefinitionImpl definition = validateDefinitionForAdd((PageMenuDefinitionImpl)element);
         // add to underlying ordered list
         page.accessMenus().add(index, definition);
     }
@@ -187,7 +159,7 @@
     {
         // implement for modifiable AbstractList:
         // verify menu definition
-        PageMenuDefinitionImpl newDefinition = validateDefinitionForAdd(element);
+        PageMenuDefinitionImpl newDefinition = validateDefinitionForAdd((PageMenuDefinitionImpl)element);
         // set in underlying ordered list
         PageMenuDefinitionImpl definition = (PageMenuDefinitionImpl)page.accessMenus().set(index, newDefinition);
         // save replaced element

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsDefList.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsDefList.java?rev=351848&r1=351847&r2=351848&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsDefList.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/PageSecurityConstraintsDefList.java Fri Dec  2 15:19:11 2005
@@ -67,6 +67,7 @@
             {
                 SecurityConstraintsDefImpl addConstraintsDef = constraintsDef;
                 constraintsDef = (SecurityConstraintsDefImpl)removedConstraintsDefs.remove(removedIndex);
+                // TODO: move this logic to copy methods on implementations
                 constraintsDef.setSecurityConstraints(addConstraintsDef.getSecurityConstraints());
             }
         }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintDefList.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintDefList.java?rev=351848&r1=351847&r2=351848&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintDefList.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintDefList.java Fri Dec  2 15:19:11 2005
@@ -45,26 +45,14 @@
      * @param constraint constraint to add
      * @return list element to add
      */
-    private PageSecuritySecurityConstraintImpl validateConstraintForAdd(SecurityConstraintImpl constraint)
+    private PageSecuritySecurityConstraintImpl validateConstraintForAdd(PageSecuritySecurityConstraintImpl constraint)
     {
         // validate constraint instance class
         if (constraint == null)
         {
             throw new NullPointerException("Unable to add null to list.");
         }
-        if (!(constraint instanceof PageSecuritySecurityConstraintImpl))
-        {
-            // duplicate constraint from equivalent types                
-            SecurityConstraintImpl origConstraint = (SecurityConstraintImpl)constraint;
-            PageSecuritySecurityConstraintImpl dupConstraint = new PageSecuritySecurityConstraintImpl();
-            // TODO: move this logic to copy methods on implementations
-            dupConstraint.setUsers(origConstraint.getUsers());
-            dupConstraint.setRoles(origConstraint.getRoles());
-            dupConstraint.setGroups(origConstraint.getGroups());
-            dupConstraint.setPermissions(origConstraint.getPermissions());
-            return dupConstraint;
-        }
-        return (PageSecuritySecurityConstraintImpl)constraint;
+        return constraint;
     }
 
     /* (non-Javadoc)
@@ -79,7 +67,7 @@
             throw new IndexOutOfBoundsException("Unable to add to list at index: " + index);
         }
         // verify constraint
-        PageSecuritySecurityConstraintImpl constraint = validateConstraintForAdd((SecurityConstraintImpl)element);
+        PageSecuritySecurityConstraintImpl constraint = validateConstraintForAdd((PageSecuritySecurityConstraintImpl)element);
         // add to underlying ordered list
         constraintsDef.accessConstraintDefs().add(index, constraint);
         // set apply order in added element
@@ -134,7 +122,7 @@
     {
         // implement for modifiable AbstractList:
         // verify constraint
-        PageSecuritySecurityConstraintImpl newConstraint = validateConstraintForAdd((SecurityConstraintImpl)element);
+        PageSecuritySecurityConstraintImpl newConstraint = validateConstraintForAdd((PageSecuritySecurityConstraintImpl)element);
         // set in underlying ordered list
         PageSecuritySecurityConstraintImpl constraint = (PageSecuritySecurityConstraintImpl)constraintsDef.accessConstraintDefs().set(index, newConstraint);
         // set apply order in new element

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintList.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintList.java?rev=351848&r1=351847&r2=351848&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintList.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/SecurityConstraintList.java Fri Dec  2 15:19:11 2005
@@ -55,26 +55,7 @@
         if ((constraints.getSecurityConstraintClass() != null) &&
             !constraints.getSecurityConstraintClass().isInstance(constraint))
         {
-            // duplicate constraint from equivalent types                
-            try
-            {
-                SecurityConstraintImpl origConstraint = (SecurityConstraintImpl)constraint;
-                SecurityConstraintImpl dupConstraint = (SecurityConstraintImpl)constraints.getSecurityConstraintClass().newInstance();
-                // TODO: move this logic to copy methods on implementations
-                dupConstraint.setUsers(origConstraint.getUsers());
-                dupConstraint.setRoles(origConstraint.getRoles());
-                dupConstraint.setGroups(origConstraint.getGroups());
-                dupConstraint.setPermissions(origConstraint.getPermissions());
-                return dupConstraint;
-            }
-            catch (InstantiationException ie)
-            {
-                throw new ClassCastException("Unable to create constraint list element instance: " + constraints.getSecurityConstraintClass().getName() + ", (" + ie + ").");
-            }
-            catch (IllegalAccessException iae)
-            {
-                throw new ClassCastException("Unable to create constraint list element instance: " + constraints.getSecurityConstraintClass().getName() + ", (" + iae + ").");
-            }
+            throw new ClassCastException("Unable to add list element instance: expected " + constraints.getSecurityConstraintClass().getName() + ", got " + constraint.getClass().getName() + ".");
         }
         return constraint;
     }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java?rev=351848&r1=351847&r2=351848&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java Fri Dec  2 15:19:11 2005
@@ -59,13 +59,21 @@
     protected Class linkClass;
     protected Class pageSecurityClass;
     protected Class propertyClass;
-    protected Class menuDefinitionClass;
-    protected Class menuExcludeDefinitionClass;
-    protected Class menuIncludeDefinitionClass;
-    protected Class menuOptionsDefinitionClass;
-    protected Class menuSeparatorDefinitionClass;
+    protected Class folderMenuDefinitionClass;
+    protected Class folderMenuExcludeDefinitionClass;
+    protected Class folderMenuIncludeDefinitionClass;
+    protected Class folderMenuOptionsDefinitionClass;
+    protected Class folderMenuSeparatorDefinitionClass;
+    protected Class pageMenuDefinitionClass;
+    protected Class pageMenuExcludeDefinitionClass;
+    protected Class pageMenuIncludeDefinitionClass;
+    protected Class pageMenuOptionsDefinitionClass;
+    protected Class pageMenuSeparatorDefinitionClass;
     protected Class securityConstraintsClass;
-    protected Class securityConstraintClass;
+    protected Class folderSecurityConstraintClass;
+    protected Class pageSecurityConstraintClass;
+    protected Class fragmentSecurityConstraintClass;
+    protected Class pageSecuritySecurityConstraintClass;
     protected Class securityConstraintsDefClass;
     protected Class fragmentPreferenceClass;
 
@@ -85,20 +93,28 @@
     {
         this(permissionsEnabled, constraintsEnabled);     
 
-        this.fragmentClass = (Class)modelClasses.get("FragmentImpl.class");
-        this.pageClass = (Class)modelClasses.get("PageImpl.class");
-        this.folderClass = (Class)modelClasses.get("FolderImpl.class");
-        this.linkClass = (Class)modelClasses.get("LinkImpl.class");
-        this.pageSecurityClass = (Class)modelClasses.get("PageSecurityImpl.class");
-        this.menuDefinitionClass = (Class)modelClasses.get("MenuDefinitionImpl.class");
-        this.menuExcludeDefinitionClass = (Class)modelClasses.get("MenuExcludeDefinitionImpl.class");
-        this.menuIncludeDefinitionClass = (Class)modelClasses.get("MenuIncludeDefinitionImpl.class");
-        this.menuOptionsDefinitionClass = (Class)modelClasses.get("MenuOptionsDefinitionImpl.class");
-        this.menuSeparatorDefinitionClass = (Class)modelClasses.get("MenuSeparatorDefinitionImpl.class");
-        this.securityConstraintsClass = (Class)modelClasses.get("SecurityConstraintsImpl.class");
-        this.securityConstraintClass = (Class)modelClasses.get("SecurityConstraintImpl.class");
-        this.securityConstraintsDefClass = (Class)modelClasses.get("SecurityConstraintsDefImpl.class");
-        this.fragmentPreferenceClass = (Class)modelClasses.get("FragmentPreferenceImpl.class");
+        this.fragmentClass = (Class)modelClasses.get("FragmentImpl");
+        this.pageClass = (Class)modelClasses.get("PageImpl");
+        this.folderClass = (Class)modelClasses.get("FolderImpl");
+        this.linkClass = (Class)modelClasses.get("LinkImpl");
+        this.pageSecurityClass = (Class)modelClasses.get("PageSecurityImpl");
+        this.folderMenuDefinitionClass = (Class)modelClasses.get("FolderMenuDefinitionImpl");
+        this.folderMenuExcludeDefinitionClass = (Class)modelClasses.get("FolderMenuExcludeDefinitionImpl");
+        this.folderMenuIncludeDefinitionClass = (Class)modelClasses.get("FolderMenuIncludeDefinitionImpl");
+        this.folderMenuOptionsDefinitionClass = (Class)modelClasses.get("FolderMenuOptionsDefinitionImpl");
+        this.folderMenuSeparatorDefinitionClass = (Class)modelClasses.get("FolderMenuSeparatorDefinitionImpl");
+        this.pageMenuDefinitionClass = (Class)modelClasses.get("PageMenuDefinitionImpl");
+        this.pageMenuExcludeDefinitionClass = (Class)modelClasses.get("PageMenuExcludeDefinitionImpl");
+        this.pageMenuIncludeDefinitionClass = (Class)modelClasses.get("PageMenuIncludeDefinitionImpl");
+        this.pageMenuOptionsDefinitionClass = (Class)modelClasses.get("PageMenuOptionsDefinitionImpl");
+        this.pageMenuSeparatorDefinitionClass = (Class)modelClasses.get("PageMenuSeparatorDefinitionImpl");
+        this.securityConstraintsClass = (Class)modelClasses.get("SecurityConstraintsImpl");
+        this.folderSecurityConstraintClass = (Class)modelClasses.get("FolderSecurityConstraintImpl");
+        this.pageSecurityConstraintClass = (Class)modelClasses.get("PageSecurityConstraintImpl");
+        this.fragmentSecurityConstraintClass = (Class)modelClasses.get("FragmentSecurityConstraintImpl");
+        this.pageSecuritySecurityConstraintClass = (Class)modelClasses.get("PageSecuritySecurityConstraintImpl");
+        this.securityConstraintsDefClass = (Class)modelClasses.get("SecurityConstraintsDefImpl");
+        this.fragmentPreferenceClass = (Class)modelClasses.get("FragmentPreferenceImpl");
     }
     
     /**
@@ -268,95 +284,190 @@
     }
     
     /**
-     * newMenuDefinition - creates a new empty menu definition
+     * newFolderMenuDefinition - creates a new empty menu definition
      *
      * @return a newly created MenuDefinition object
      */
-    public MenuDefinition newMenuDefinition()
+    public MenuDefinition newFolderMenuDefinition()
     {
         try
         {
-            return (MenuDefinition)createObject(this.menuDefinitionClass);
+            return (MenuDefinition)createObject(this.folderMenuDefinitionClass);
         }
         catch (ClassCastException e)
         {
-            String message = "Failed to create menu definition object for " + this.menuDefinitionClass;
+            String message = "Failed to create menu definition object for " + this.folderMenuDefinitionClass;
             log.error(message, e);
         }
         return null;
     }
 
     /**
-     * newMenuExcludeDefinition - creates a new empty menu exclude definition
+     * newFolderMenuExcludeDefinition - creates a new empty menu exclude definition
      *
      * @return a newly created MenuExcludeDefinition object
      */
-    public MenuExcludeDefinition newMenuExcludeDefinition()
+    public MenuExcludeDefinition newFolderMenuExcludeDefinition()
     {
         try
         {
-            return (MenuExcludeDefinition)createObject(this.menuExcludeDefinitionClass);
+            return (MenuExcludeDefinition)createObject(this.folderMenuExcludeDefinitionClass);
         }
         catch (ClassCastException e)
         {
-            String message = "Failed to create menu exclude definition object for " + this.menuExcludeDefinitionClass;
+            String message = "Failed to create menu exclude definition object for " + this.folderMenuExcludeDefinitionClass;
             log.error(message, e);
         }
         return null;
     }
 
     /**
-     * newMenuIncludeDefinition - creates a new empty menu include definition
+     * newFolderMenuIncludeDefinition - creates a new empty menu include definition
      *
      * @return a newly created MenuIncludeDefinition object
      */
-    public MenuIncludeDefinition newMenuIncludeDefinition()
+    public MenuIncludeDefinition newFolderMenuIncludeDefinition()
     {
         try
         {
-            return (MenuIncludeDefinition)createObject(this.menuIncludeDefinitionClass);
+            return (MenuIncludeDefinition)createObject(this.folderMenuIncludeDefinitionClass);
         }
         catch (ClassCastException e)
         {
-            String message = "Failed to create menu include definition object for " + this.menuIncludeDefinitionClass;
+            String message = "Failed to create menu include definition object for " + this.folderMenuIncludeDefinitionClass;
             log.error(message, e);
         }
         return null;
     }
 
     /**
-     * newMenuOptionsDefinition - creates a new empty menu options definition
+     * newFolderMenuOptionsDefinition - creates a new empty menu options definition
      *
      * @return a newly created MenuOptionsDefinition object
      */
-    public MenuOptionsDefinition newMenuOptionsDefinition()
+    public MenuOptionsDefinition newFolderMenuOptionsDefinition()
     {
         try
         {
-            return (MenuOptionsDefinition)createObject(this.menuOptionsDefinitionClass);
+            return (MenuOptionsDefinition)createObject(this.folderMenuOptionsDefinitionClass);
         }
         catch (ClassCastException e)
         {
-            String message = "Failed to create menu options definition object for " + this.menuOptionsDefinitionClass;
+            String message = "Failed to create menu options definition object for " + this.folderMenuOptionsDefinitionClass;
             log.error(message, e);
         }
         return null;
     }
 
     /**
-     * newMenuSeparatorDefinition - creates a new empty menu separator definition
+     * newFolderMenuSeparatorDefinition - creates a new empty menu separator definition
      *
      * @return a newly created MenuSeparatorDefinition object
      */
-    public MenuSeparatorDefinition newMenuSeparatorDefinition()
+    public MenuSeparatorDefinition newFolderMenuSeparatorDefinition()
     {
         try
         {
-            return (MenuSeparatorDefinition)createObject(this.menuSeparatorDefinitionClass);
+            return (MenuSeparatorDefinition)createObject(this.folderMenuSeparatorDefinitionClass);
         }
         catch (ClassCastException e)
         {
-            String message = "Failed to create menu separator definition object for " + this.menuSeparatorDefinitionClass;
+            String message = "Failed to create menu separator definition object for " + this.folderMenuSeparatorDefinitionClass;
+            log.error(message, e);
+        }
+        return null;
+    }
+
+    /**
+     * newPageMenuDefinition - creates a new empty menu definition
+     *
+     * @return a newly created MenuDefinition object
+     */
+    public MenuDefinition newPageMenuDefinition()
+    {
+        try
+        {
+            return (MenuDefinition)createObject(this.pageMenuDefinitionClass);
+        }
+        catch (ClassCastException e)
+        {
+            String message = "Failed to create menu definition object for " + this.pageMenuDefinitionClass;
+            log.error(message, e);
+        }
+        return null;
+    }
+
+    /**
+     * newPageMenuExcludeDefinition - creates a new empty menu exclude definition
+     *
+     * @return a newly created MenuExcludeDefinition object
+     */
+    public MenuExcludeDefinition newPageMenuExcludeDefinition()
+    {
+        try
+        {
+            return (MenuExcludeDefinition)createObject(this.pageMenuExcludeDefinitionClass);
+        }
+        catch (ClassCastException e)
+        {
+            String message = "Failed to create menu exclude definition object for " + this.pageMenuExcludeDefinitionClass;
+            log.error(message, e);
+        }
+        return null;
+    }
+
+    /**
+     * newPageMenuIncludeDefinition - creates a new empty menu include definition
+     *
+     * @return a newly created MenuIncludeDefinition object
+     */
+    public MenuIncludeDefinition newPageMenuIncludeDefinition()
+    {
+        try
+        {
+            return (MenuIncludeDefinition)createObject(this.pageMenuIncludeDefinitionClass);
+        }
+        catch (ClassCastException e)
+        {
+            String message = "Failed to create menu include definition object for " + this.pageMenuIncludeDefinitionClass;
+            log.error(message, e);
+        }
+        return null;
+    }
+
+    /**
+     * newPageMenuOptionsDefinition - creates a new empty menu options definition
+     *
+     * @return a newly created MenuOptionsDefinition object
+     */
+    public MenuOptionsDefinition newPageMenuOptionsDefinition()
+    {
+        try
+        {
+            return (MenuOptionsDefinition)createObject(this.pageMenuOptionsDefinitionClass);
+        }
+        catch (ClassCastException e)
+        {
+            String message = "Failed to create menu options definition object for " + this.pageMenuOptionsDefinitionClass;
+            log.error(message, e);
+        }
+        return null;
+    }
+
+    /**
+     * newPageMenuSeparatorDefinition - creates a new empty menu separator definition
+     *
+     * @return a newly created MenuSeparatorDefinition object
+     */
+    public MenuSeparatorDefinition newPageMenuSeparatorDefinition()
+    {
+        try
+        {
+            return (MenuSeparatorDefinition)createObject(this.pageMenuSeparatorDefinitionClass);
+        }
+        catch (ClassCastException e)
+        {
+            String message = "Failed to create menu separator definition object for " + this.pageMenuSeparatorDefinitionClass;
             log.error(message, e);
         }
         return null;
@@ -382,19 +493,76 @@
     }
 
     /**
-     * newSecurityConstraint - creates a new security constraint definition
+     * newFolderSecurityConstraint - creates a new security constraint definition
+     *
+     * @return a newly created SecurityConstraint object
+     */
+    public SecurityConstraint newFolderSecurityConstraint()
+    {
+        try
+        {
+            return (SecurityConstraint)createObject(this.folderSecurityConstraintClass);
+        }
+        catch (ClassCastException e)
+        {
+            String message = "Failed to create security constraint definition object for " + this.folderSecurityConstraintClass;
+            log.error(message, e);
+        }
+        return null;
+    }
+
+    /**
+     * newPageSecurityConstraint - creates a new security constraint definition
+     *
+     * @return a newly created SecurityConstraint object
+     */
+    public SecurityConstraint newPageSecurityConstraint()
+    {
+        try
+        {
+            return (SecurityConstraint)createObject(this.pageSecurityConstraintClass);
+        }
+        catch (ClassCastException e)
+        {
+            String message = "Failed to create security constraint definition object for " + this.pageSecurityConstraintClass;
+            log.error(message, e);
+        }
+        return null;
+    }
+
+    /**
+     * newFragmentSecurityConstraint - creates a new security constraint definition
      *
      * @return a newly created SecurityConstraint object
      */
-    public SecurityConstraint newSecurityConstraint()
+    public SecurityConstraint newFragmentSecurityConstraint()
     {
         try
         {
-            return (SecurityConstraint)createObject(this.securityConstraintClass);
+            return (SecurityConstraint)createObject(this.fragmentSecurityConstraintClass);
         }
         catch (ClassCastException e)
         {
-            String message = "Failed to create security constraint definition object for " + this.securityConstraintClass;
+            String message = "Failed to create security constraint definition object for " + this.fragmentSecurityConstraintClass;
+            log.error(message, e);
+        }
+        return null;
+    }
+
+    /**
+     * newPageSecuritySecurityConstraint - creates a new security constraint definition
+     *
+     * @return a newly created SecurityConstraint object
+     */
+    public SecurityConstraint newPageSecuritySecurityConstraint()
+    {
+        try
+        {
+            return (SecurityConstraint)createObject(this.pageSecuritySecurityConstraintClass);
+        }
+        catch (ClassCastException e)
+        {
+            String message = "Failed to create security constraint definition object for " + this.pageSecuritySecurityConstraintClass;
             log.error(message, e);
         }
         return null;
@@ -570,7 +738,7 @@
         SecurityConstraints srcSecurity = source.getSecurityConstraints();        
         if ((srcSecurity != null) && !srcSecurity.isEmpty())
         {
-            SecurityConstraints copiedSecurity = copySecurityConstraints(srcSecurity);
+            SecurityConstraints copiedSecurity = copySecurityConstraints("folder", srcSecurity);
             folder.setSecurityConstraints(copiedSecurity);
         }    
         
@@ -605,7 +773,7 @@
         SecurityConstraints srcSecurity = source.getSecurityConstraints();        
         if ((srcSecurity != null) && !srcSecurity.isEmpty())
         {
-            SecurityConstraints copiedSecurity = copySecurityConstraints(srcSecurity);
+            SecurityConstraints copiedSecurity = copySecurityConstraints("page", srcSecurity);
             page.setSecurityConstraints(copiedSecurity);
         }    
 
@@ -613,7 +781,7 @@
 //        List menus = page.getMenuDefinitions();
 //        if (menus != null)
 //        {
-//            List copiedMenus = copyMenuDefinitions(page.getMenuDefinitions());
+//            List copiedMenus = copyMenuDefinitions("page", page.getMenuDefinitions());
 //            page.setMenuDefinitions(copiedMenus);
 //        }        
         
@@ -635,7 +803,7 @@
         SecurityConstraints srcSecurity = source.getSecurityConstraints();        
         if ((srcSecurity != null) && !srcSecurity.isEmpty())
         {
-            SecurityConstraints copiedSecurity = copySecurityConstraints(srcSecurity);
+            SecurityConstraints copiedSecurity = copySecurityConstraints("fragment", srcSecurity);
             copy.setSecurityConstraints(copiedSecurity);
         }    
         
@@ -684,14 +852,22 @@
         }       
     }
     
-    protected List copyMenuDefinitions(List srcMenus)
+    protected List copyMenuDefinitions(String type, List srcMenus)
     {
         List copiedMenus = new ArrayList(4); 
         Iterator menus = srcMenus.iterator();
         while (menus.hasNext())
         {
             MenuDefinition srcMenu = (MenuDefinition)menus.next();
-            MenuDefinition copiedMenu = newMenuDefinition();
+            MenuDefinition copiedMenu = null;
+            if (type.equals("page"))
+            {
+                copiedMenu = newPageMenuDefinition();
+            }
+            else if (type.equals("folder"))
+            {
+                copiedMenu = newFolderMenuDefinition();
+            }
             copiedMenu.setDepth(srcMenu.getDepth());
             copiedMenu.setName(srcMenu.getName());
             copiedMenu.setOptions(srcMenu.getOptions());
@@ -741,7 +917,7 @@
         dstConstraint.setPermissions(srcConstraint.getPermissions());        
     }
     
-    protected SecurityConstraints copySecurityConstraints(SecurityConstraints source)
+    protected SecurityConstraints copySecurityConstraints(String type, SecurityConstraints source)
     {
         SecurityConstraints security = newSecurityConstraints();
         if (source.getOwner() != null)        
@@ -755,7 +931,19 @@
             while (constraints.hasNext())
             {
                 SecurityConstraint srcConstraint = (SecurityConstraint)constraints.next();
-                SecurityConstraint dstConstraint = newSecurityConstraint();
+                SecurityConstraint dstConstraint = null;
+                if (type.equals("page"))
+                {
+                    dstConstraint = newPageSecurityConstraint();
+                }
+                else if (type.equals("folder"))
+                {
+                    dstConstraint = newFolderSecurityConstraint();
+                }
+                else if (type.equals("fragment"))
+                {
+                    dstConstraint = newFragmentSecurityConstraint();
+                }
                 copyConstraint(srcConstraint, dstConstraint);
                 copiedConstraints.add(dstConstraint);
             }
@@ -798,7 +986,7 @@
             while (constraints.hasNext())
             {
                 SecurityConstraint srcConstraint = (SecurityConstraint)constraints.next();
-                SecurityConstraint dstConstraint = newSecurityConstraint();
+                SecurityConstraint dstConstraint = newPageSecuritySecurityConstraint();
                 copyConstraint(srcConstraint, dstConstraint);
                 copiedConstraints.add(dstConstraint);
             }                                            

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=351848&r1=351847&r2=351848&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 Fri Dec  2 15:19:11 2005
@@ -37,18 +37,26 @@
 import org.apache.jetspeed.om.folder.impl.FolderMenuIncludeDefinitionImpl;
 import org.apache.jetspeed.om.folder.impl.FolderMenuOptionsDefinitionImpl;
 import org.apache.jetspeed.om.folder.impl.FolderMenuSeparatorDefinitionImpl;
+import org.apache.jetspeed.om.folder.impl.FolderSecurityConstraintImpl;
 import org.apache.jetspeed.om.page.ContentPage;
 import org.apache.jetspeed.om.page.ContentPageImpl;
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageSecurity;
-import org.apache.jetspeed.om.page.SecurityConstraintImpl;
 import org.apache.jetspeed.om.page.SecurityConstraintsDef;
 import org.apache.jetspeed.om.page.impl.FragmentImpl;
 import org.apache.jetspeed.om.page.impl.FragmentPreferenceImpl;
+import org.apache.jetspeed.om.page.impl.FragmentSecurityConstraintImpl;
 import org.apache.jetspeed.om.page.impl.PageImpl;
+import org.apache.jetspeed.om.page.impl.PageMenuDefinitionImpl;
+import org.apache.jetspeed.om.page.impl.PageMenuExcludeDefinitionImpl;
+import org.apache.jetspeed.om.page.impl.PageMenuIncludeDefinitionImpl;
+import org.apache.jetspeed.om.page.impl.PageMenuOptionsDefinitionImpl;
+import org.apache.jetspeed.om.page.impl.PageMenuSeparatorDefinitionImpl;
+import org.apache.jetspeed.om.page.impl.PageSecurityConstraintImpl;
 import org.apache.jetspeed.om.page.impl.PageSecurityImpl;
+import org.apache.jetspeed.om.page.impl.PageSecuritySecurityConstraintImpl;
 import org.apache.jetspeed.om.page.impl.SecurityConstraintsDefImpl;
 import org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl;
 import org.apache.jetspeed.om.preference.FragmentPreference;
@@ -89,20 +97,28 @@
     private static Map modelClasses = new HashMap();
     static
     {
-        modelClasses.put("FragmentImpl.class", FragmentImpl.class);
-        modelClasses.put("PageImpl.class", PageImpl.class);
-        modelClasses.put("FolderImpl.class", FolderImpl.class);
-        //modelClasses.put("LinkImpl.class", LinkImpl.class);
-        modelClasses.put("PageSecurityImpl.class", PageSecurityImpl.class);
-        modelClasses.put("MenuDefinitionImpl.class", FolderMenuDefinitionImpl.class);
-        modelClasses.put("MenuExcludeDefinitionImpl.class", FolderMenuExcludeDefinitionImpl.class);
-        modelClasses.put("MenuIncludeDefinitionImpl.class", FolderMenuIncludeDefinitionImpl.class);
-        modelClasses.put("MenuOptionsDefinitionImpl.class", FolderMenuOptionsDefinitionImpl.class);
-        modelClasses.put("MenuSeparatorDefinitionImpl.class", FolderMenuSeparatorDefinitionImpl.class);
-        modelClasses.put("SecurityConstraintsImpl.class", SecurityConstraintsImpl.class);
-        modelClasses.put("SecurityConstraintImpl.class", SecurityConstraintImpl.class);
-        modelClasses.put("SecurityConstraintsDefImpl.class", SecurityConstraintsDefImpl.class);
-        modelClasses.put("FragmentPreferenceImpl.class", FragmentPreferenceImpl.class);
+        modelClasses.put("FragmentImpl", FragmentImpl.class);
+        modelClasses.put("PageImpl", PageImpl.class);
+        modelClasses.put("FolderImpl", FolderImpl.class);
+        //modelClasses.put("LinkImpl", LinkImpl.class);
+        modelClasses.put("PageSecurityImpl", PageSecurityImpl.class);
+        modelClasses.put("FolderMenuDefinitionImpl", FolderMenuDefinitionImpl.class);
+        modelClasses.put("FolderMenuExcludeDefinitionImpl", FolderMenuExcludeDefinitionImpl.class);
+        modelClasses.put("FolderMenuIncludeDefinitionImpl", FolderMenuIncludeDefinitionImpl.class);
+        modelClasses.put("FolderMenuOptionsDefinitionImpl", FolderMenuOptionsDefinitionImpl.class);
+        modelClasses.put("FolderMenuSeparatorDefinitionImpl", FolderMenuSeparatorDefinitionImpl.class);
+        modelClasses.put("PageMenuDefinitionImpl", PageMenuDefinitionImpl.class);
+        modelClasses.put("PageMenuExcludeDefinitionImpl", PageMenuExcludeDefinitionImpl.class);
+        modelClasses.put("PageMenuIncludeDefinitionImpl", PageMenuIncludeDefinitionImpl.class);
+        modelClasses.put("PageMenuOptionsDefinitionImpl", PageMenuOptionsDefinitionImpl.class);
+        modelClasses.put("PageMenuSeparatorDefinitionImpl", PageMenuSeparatorDefinitionImpl.class);
+        modelClasses.put("SecurityConstraintsImpl", SecurityConstraintsImpl.class);
+        modelClasses.put("FolderSecurityConstraintImpl", FolderSecurityConstraintImpl.class);
+        modelClasses.put("PageSecurityConstraintImpl", PageSecurityConstraintImpl.class);
+        modelClasses.put("FragmentSecurityConstraintImpl", FragmentSecurityConstraintImpl.class);
+        modelClasses.put("PageSecuritySecurityConstraintImpl", PageSecuritySecurityConstraintImpl.class);
+        modelClasses.put("SecurityConstraintsDefImpl", SecurityConstraintsDefImpl.class);
+        modelClasses.put("FragmentPreferenceImpl", FragmentPreferenceImpl.class);
     }
 
     private DelegatingPageManager delegator;
@@ -214,44 +230,89 @@
         return delegator.newPortletFragment();
     }
     
+
+
+
+
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#newFolderMenuDefinition()
+     */
+    public MenuDefinition newFolderMenuDefinition()
+    {
+        return delegator.newFolderMenuDefinition();
+    }
+
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#newMenuDefinition()
+     * @see org.apache.jetspeed.page.PageManager#newFolderMenuExcludeDefinition()
      */
-    public MenuDefinition newMenuDefinition()
+    public MenuExcludeDefinition newFolderMenuExcludeDefinition()
     {
-        return delegator.newMenuDefinition();
+        return delegator.newFolderMenuExcludeDefinition();
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#newMenuExcludeDefinition()
+     * @see org.apache.jetspeed.page.PageManager#newFolderMenuIncludeDefinition()
      */
-    public MenuExcludeDefinition newMenuExcludeDefinition()
+    public MenuIncludeDefinition newFolderMenuIncludeDefinition()
     {
-        return delegator.newMenuExcludeDefinition();
+        return delegator.newFolderMenuIncludeDefinition();
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#newMenuIncludeDefinition()
+     * @see org.apache.jetspeed.page.PageManager#newFolderMenuOptionsDefinition()
      */
-    public MenuIncludeDefinition newMenuIncludeDefinition()
+    public MenuOptionsDefinition newFolderMenuOptionsDefinition()
     {
-        return delegator.newMenuIncludeDefinition();
+        return delegator.newFolderMenuOptionsDefinition();
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#newMenuOptionsDefinition()
+     * @see org.apache.jetspeed.page.PageManager#newFolderMenuSeparatorDefinition()
      */
-    public MenuOptionsDefinition newMenuOptionsDefinition()
+    public MenuSeparatorDefinition newFolderMenuSeparatorDefinition()
     {
-        return delegator.newMenuOptionsDefinition();
+        return delegator.newFolderMenuSeparatorDefinition();
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#newMenuSeparatorDefinition()
+     * @see org.apache.jetspeed.page.PageManager#newPageMenuDefinition()
      */
-    public MenuSeparatorDefinition newMenuSeparatorDefinition()
+    public MenuDefinition newPageMenuDefinition()
     {
-        return delegator.newMenuSeparatorDefinition();
+        return delegator.newPageMenuDefinition();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#newPageMenuExcludeDefinition()
+     */
+    public MenuExcludeDefinition newPageMenuExcludeDefinition()
+    {
+        return delegator.newPageMenuExcludeDefinition();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#newPageMenuIncludeDefinition()
+     */
+    public MenuIncludeDefinition newPageMenuIncludeDefinition()
+    {
+        return delegator.newPageMenuIncludeDefinition();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#newPageMenuOptionsDefinition()
+     */
+    public MenuOptionsDefinition newPageMenuOptionsDefinition()
+    {
+        return delegator.newPageMenuOptionsDefinition();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#newPageMenuSeparatorDefinition()
+     */
+    public MenuSeparatorDefinition newPageMenuSeparatorDefinition()
+    {
+        return delegator.newPageMenuSeparatorDefinition();
     }
 
     /* (non-Javadoc)
@@ -263,11 +324,35 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#newSecurityConstraint()
+     * @see org.apache.jetspeed.page.PageManager#newFolderSecurityConstraint()
+     */
+    public SecurityConstraint newFolderSecurityConstraint()
+    {
+        return delegator.newFolderSecurityConstraint();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#newPageSecurityConstraint()
+     */
+    public SecurityConstraint newPageSecurityConstraint()
+    {
+        return delegator.newPageSecurityConstraint();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#newFragmentSecurityConstraint()
+     */
+    public SecurityConstraint newFragmentSecurityConstraint()
+    {
+        return delegator.newFragmentSecurityConstraint();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#newPageSecuritySecurityConstraint()
      */
-    public SecurityConstraint newSecurityConstraint()
+    public SecurityConstraint newPageSecuritySecurityConstraint()
     {
-        return delegator.newSecurityConstraint();
+        return delegator.newPageSecuritySecurityConstraint();
     }
 
     /* (non-Javadoc)

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=351848&r1=351847&r2=351848&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 Fri Dec  2 15:19:11 2005
@@ -81,20 +81,28 @@
     private static Map modelClasses = new HashMap();
     static
     {
-        modelClasses.put("FragmentImpl.class", FragmentImpl.class);
-        modelClasses.put("PageImpl.class", PageImpl.class);
-        modelClasses.put("FolderImpl.class", FolderImpl.class);
-        modelClasses.put("LinkImpl.class", LinkImpl.class);
-        modelClasses.put("PageSecurityImpl.class", PageSecurityImpl.class);
-        modelClasses.put("MenuDefinitionImpl.class", MenuDefinitionImpl.class);
-        modelClasses.put("MenuExcludeDefinitionImpl.class", MenuExcludeDefinitionImpl.class);
-        modelClasses.put("MenuIncludeDefinitionImpl.class", MenuIncludeDefinitionImpl.class);
-        modelClasses.put("MenuOptionsDefinitionImpl.class", MenuOptionsDefinitionImpl.class);
-        modelClasses.put("MenuSeparatorDefinitionImpl.class", MenuSeparatorDefinitionImpl.class);
-        modelClasses.put("SecurityConstraintsImpl.class", SecurityConstraintsImpl.class);
-        modelClasses.put("SecurityConstraintImpl.class", SecurityConstraintImpl.class);
-        modelClasses.put("SecurityConstraintsDefImpl.class", SecurityConstraintsDefImpl.class);
-        modelClasses.put("FragmentPreferenceImpl.class", FragmentPreferenceImpl.class);
+        modelClasses.put("FragmentImpl", FragmentImpl.class);
+        modelClasses.put("PageImpl", PageImpl.class);
+        modelClasses.put("FolderImpl", FolderImpl.class);
+        modelClasses.put("LinkImpl", LinkImpl.class);
+        modelClasses.put("PageSecurityImpl", PageSecurityImpl.class);
+        modelClasses.put("FolderMenuDefinitionImpl", MenuDefinitionImpl.class);
+        modelClasses.put("FolderMenuExcludeDefinitionImpl", MenuExcludeDefinitionImpl.class);
+        modelClasses.put("FolderMenuIncludeDefinitionImpl", MenuIncludeDefinitionImpl.class);
+        modelClasses.put("FolderMenuOptionsDefinitionImpl", MenuOptionsDefinitionImpl.class);
+        modelClasses.put("FolderMenuSeparatorDefinitionImpl", MenuSeparatorDefinitionImpl.class);
+        modelClasses.put("PageMenuDefinitionImpl", MenuDefinitionImpl.class);
+        modelClasses.put("PageMenuExcludeDefinitionImpl", MenuExcludeDefinitionImpl.class);
+        modelClasses.put("PageMenuIncludeDefinitionImpl", MenuIncludeDefinitionImpl.class);
+        modelClasses.put("PageMenuOptionsDefinitionImpl", MenuOptionsDefinitionImpl.class);
+        modelClasses.put("PageMenuSeparatorDefinitionImpl", MenuSeparatorDefinitionImpl.class);
+        modelClasses.put("SecurityConstraintsImpl", SecurityConstraintsImpl.class);
+        modelClasses.put("FolderSecurityConstraintImpl", SecurityConstraintImpl.class);
+        modelClasses.put("PageSecurityConstraintImpl", SecurityConstraintImpl.class);
+        modelClasses.put("FragmentSecurityConstraintImpl", SecurityConstraintImpl.class);
+        modelClasses.put("PageSecuritySecurityConstraintImpl", SecurityConstraintImpl.class);
+        modelClasses.put("SecurityConstraintsDefImpl", SecurityConstraintsDefImpl.class);
+        modelClasses.put("FragmentPreferenceImpl", FragmentPreferenceImpl.class);
     }
 
     private IdGenerator generator = null;

Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java?rev=351848&r1=351847&r2=351848&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java Fri Dec  2 15:19:11 2005
@@ -151,7 +151,7 @@
         SecurityConstraints folderConstraints = pageManager.newSecurityConstraints();
         folderConstraints.setOwner("admin");
         List inlineFolderConstraints = new ArrayList(2);
-        SecurityConstraint folderConstraint = pageManager.newSecurityConstraint();
+        SecurityConstraint folderConstraint = pageManager.newFolderSecurityConstraint();
         folderConstraint.setUsers(Shared.makeListFromCSV("user,admin"));
         folderConstraint.setRoles(Shared.makeListFromCSV("manager"));
         folderConstraint.setGroups(Shared.makeListFromCSV("*"));

Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestSecureDatabasePageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestSecureDatabasePageManager.java?rev=351848&r1=351847&r2=351848&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestSecureDatabasePageManager.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestSecureDatabasePageManager.java Fri Dec  2 15:19:11 2005
@@ -130,7 +130,7 @@
                         SecurityConstraintsDef constraintsDef = pageManager.newSecurityConstraintsDef();
                         constraintsDef.setName("public-view");
                         List defConstraints = new ArrayList(1);
-                        SecurityConstraint defConstraint = pageManager.newSecurityConstraint();
+                        SecurityConstraint defConstraint = pageManager.newPageSecuritySecurityConstraint();
                         defConstraint.setUsers(Shared.makeListFromCSV("*"));
                         defConstraint.setPermissions(Shared.makeListFromCSV("view"));
                         defConstraints.add(defConstraint);
@@ -139,7 +139,7 @@
                         constraintsDef = pageManager.newSecurityConstraintsDef();
                         constraintsDef.setName("admin-all");
                         defConstraints = new ArrayList(1);
-                        defConstraint = pageManager.newSecurityConstraint();
+                        defConstraint = pageManager.newPageSecuritySecurityConstraint();
                         defConstraint.setRoles(Shared.makeListFromCSV("admin"));
                         defConstraint.setPermissions(Shared.makeListFromCSV("view,edit"));
                         defConstraints.add(defConstraint);
@@ -155,7 +155,7 @@
                         constraints = pageManager.newSecurityConstraints();
                         constraints.setOwner("admin");
                         List inlineConstraints = new ArrayList(1);
-                        SecurityConstraint constraint = pageManager.newSecurityConstraint();
+                        SecurityConstraint constraint = pageManager.newPageSecurityConstraint();
                         constraint.setRoles(Shared.makeListFromCSV("manager"));
                         constraint.setPermissions(Shared.makeListFromCSV("edit"));
                         inlineConstraints.add(constraint);
@@ -186,7 +186,7 @@
                         page = pageManager.newPage("/user-page.psml");
                         constraints = pageManager.newSecurityConstraints();
                         inlineConstraints = new ArrayList(1);
-                        constraint = pageManager.newSecurityConstraint();
+                        constraint = pageManager.newPageSecurityConstraint();
                         constraint.setUsers(Shared.makeListFromCSV("user"));
                         constraint.setPermissions(Shared.makeListFromCSV("view,edit"));
                         inlineConstraints.add(constraint);

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java?rev=351848&r1=351847&r2=351848&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java Fri Dec  2 15:19:11 2005
@@ -113,39 +113,74 @@
     public Fragment newPortletFragment();
     
     /**
-     * newMenuDefinition - creates a new empty menu definition
+     * newFolderMenuDefinition - creates a new empty menu definition
      *
-     * @return a newly created MenuDefinition object
+     * @return a newly created MenuDefinition object to be used in Folder
      */
-    public MenuDefinition newMenuDefinition();
+    public MenuDefinition newFolderMenuDefinition();
 
     /**
-     * newMenuExcludeDefinition - creates a new empty menu exclude definition
+     * newFolderMenuExcludeDefinition - creates a new empty menu exclude definition
      *
-     * @return a newly created MenuExcludeDefinition object
+     * @return a newly created MenuExcludeDefinition object to be used in Folder
      */
-    public MenuExcludeDefinition newMenuExcludeDefinition();
+    public MenuExcludeDefinition newFolderMenuExcludeDefinition();
 
     /**
-     * newMenuIncludeDefinition - creates a new empty menu include definition
+     * newFolderMenuIncludeDefinition - creates a new empty menu include definition
      *
-     * @return a newly created MenuIncludeDefinition object
+     * @return a newly created MenuIncludeDefinition object to be used in Folder
      */
-    public MenuIncludeDefinition newMenuIncludeDefinition();
+    public MenuIncludeDefinition newFolderMenuIncludeDefinition();
 
     /**
-     * newMenuOptionsDefinition - creates a new empty menu options definition
+     * newFolderMenuOptionsDefinition - creates a new empty menu options definition
      *
-     * @return a newly created MenuOptionsDefinition object
+     * @return a newly created MenuOptionsDefinition object to be used in Folder
      */
-    public MenuOptionsDefinition newMenuOptionsDefinition();
+    public MenuOptionsDefinition newFolderMenuOptionsDefinition();
 
     /**
-     * newMenuSeparatorDefinition - creates a new empty menu separator definition
+     * newFolderMenuSeparatorDefinition - creates a new empty menu separator definition
      *
-     * @return a newly created MenuSeparatorDefinition object
+     * @return a newly created MenuSeparatorDefinition object to be used in Folder
      */
-    public MenuSeparatorDefinition newMenuSeparatorDefinition();
+    public MenuSeparatorDefinition newFolderMenuSeparatorDefinition();
+
+    /**
+     * newPageMenuDefinition - creates a new empty menu definition
+     *
+     * @return a newly created MenuDefinition object to be used in Page
+     */
+    public MenuDefinition newPageMenuDefinition();
+
+    /**
+     * newPageMenuExcludeDefinition - creates a new empty menu exclude definition
+     *
+     * @return a newly created MenuExcludeDefinition object to be used in Page
+     */
+    public MenuExcludeDefinition newPageMenuExcludeDefinition();
+
+    /**
+     * newPageMenuIncludeDefinition - creates a new empty menu include definition
+     *
+     * @return a newly created MenuIncludeDefinition object to be used in Page
+     */
+    public MenuIncludeDefinition newPageMenuIncludeDefinition();
+
+    /**
+     * newPageMenuOptionsDefinition - creates a new empty menu options definition
+     *
+     * @return a newly created MenuOptionsDefinition object to be used in Page
+     */
+    public MenuOptionsDefinition newPageMenuOptionsDefinition();
+
+    /**
+     * newPageMenuSeparatorDefinition - creates a new empty menu separator definition
+     *
+     * @return a newly created MenuSeparatorDefinition object to be used in Page
+     */
+    public MenuSeparatorDefinition newPageMenuSeparatorDefinition();
 
     /**
      * newSecurityConstraints - creates a new empty security constraints definition
@@ -155,11 +190,32 @@
     public SecurityConstraints newSecurityConstraints();
 
     /**
-     * newSecurityConstraint - creates a new security constraint definition
+     * newFolderSecurityConstraint - creates a new security constraint definition
+     *
+     * @return a newly created SecurityConstraint object to be used in Folder
+     */
+    public SecurityConstraint newFolderSecurityConstraint();
+
+    /**
+     * newPageSecurityConstraint - creates a new security constraint definition
+     *
+     * @return a newly created SecurityConstraint object to be used in Page
+     */
+    public SecurityConstraint newPageSecurityConstraint();
+
+    /**
+     * newFragmentSecurityConstraint - creates a new security constraint definition
+     *
+     * @return a newly created SecurityConstraint object to be used in Fragment
+     */
+    public SecurityConstraint newFragmentSecurityConstraint();
+
+    /**
+     * newPageSecuritySecurityConstraint - creates a new security constraint definition
      *
-     * @return a newly created SecurityConstraint object
+     * @return a newly created SecurityConstraint object to be used in PageSecurity
      */
-    public SecurityConstraint newSecurityConstraint();
+    public SecurityConstraint newPageSecuritySecurityConstraint();
 
     /**
      * newSecurityConstraintsDef - creates a new security constraints definition



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