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 [3/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
Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java?rev=351770&r1=351769&r2=351770&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestCastorXmlPageManager.java
Fri Dec  2 08:52:05 2005
@@ -684,28 +684,28 @@
         // test writing page menu definitions
         page = pageManager.getPage(this.testPage002);
         page.setMenuDefinitions(new ArrayList());
-        MenuDefinition newMenu = pageManager.newMenuDefinition();
+        MenuDefinition newMenu = page.newMenuDefinition();
         newMenu.setName("updated-menu");
         newMenu.setSkin("tabs");
         newMenu.setMenuElements(new ArrayList());
-        MenuSeparatorDefinition newSeparator = pageManager.newMenuSeparatorDefinition();
+        MenuSeparatorDefinition newSeparator = page.newMenuSeparatorDefinition();
         newSeparator.setText("-- Updated Menu --");
         newMenu.getMenuElements().add(newSeparator);
-        MenuOptionsDefinition newOptions0 = pageManager.newMenuOptionsDefinition();
+        MenuOptionsDefinition newOptions0 = page.newMenuOptionsDefinition();
         newOptions0.setOptions("/*.psml");
         newOptions0.setRegexp(true);
         newMenu.getMenuElements().add(newOptions0);
-        MenuOptionsDefinition newOptions1 = pageManager.newMenuOptionsDefinition();
+        MenuOptionsDefinition newOptions1 = page.newMenuOptionsDefinition();
         newOptions1.setOptions("/folder0");
         newMenu.getMenuElements().add(newOptions1);
-        MenuDefinition newNestedMenu = pageManager.newMenuDefinition();
+        MenuDefinition newNestedMenu = page.newMenuDefinition();
         newNestedMenu.setOptions("/*/");
         newNestedMenu.setRegexp(true);
         newMenu.getMenuElements().add(newNestedMenu);
-        MenuExcludeDefinition newExcludeMenu = pageManager.newMenuExcludeDefinition();
+        MenuExcludeDefinition newExcludeMenu = page.newMenuExcludeDefinition();
         newExcludeMenu.setName("exclude-menu");
         newMenu.getMenuElements().add(newExcludeMenu);
-        MenuIncludeDefinition newIncludeMenu = pageManager.newMenuIncludeDefinition();
+        MenuIncludeDefinition newIncludeMenu = page.newMenuIncludeDefinition();
         newIncludeMenu.setName("include-menu");
         newIncludeMenu.setNest(true);
         newMenu.getMenuElements().add(newIncludeMenu);
@@ -736,7 +736,7 @@
         // test writing folder menu definitions
         folder = pageManager.getFolder(this.testFolder2);
         folder.setMenuDefinitions(new ArrayList());
-        newMenu = pageManager.newMenuDefinition();
+        newMenu = folder.newMenuDefinition();
         newMenu.setName("updated-menu");
         newMenu.setSkin("bread-crumbs");
         newMenu.setOptions("./");

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=351770&r1=351769&r2=351770&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 08:52:05 2005
@@ -27,6 +27,11 @@
 import org.apache.jetspeed.om.common.SecurityConstraints;
 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.Fragment;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageSecurity;
@@ -165,6 +170,55 @@
         documentOrder.add("some-other-page.psml");
         documentOrder.add("default-page.psml");
         folder.setDocumentOrder(documentOrder);
+        MenuDefinition newMenu = folder.newMenuDefinition();
+        newMenu.setName("folder-menu");
+        newMenu.setTitle("The Test Folder Menu");
+        newMenu.setShortTitle("Folder Menu");
+        newMenu.setProfile("group-fallback");
+        metadata = newMenu.getMetadata();
+        metadata.addField(Locale.FRENCH, "short-title", "[fr] Folder Menu");
+        metadata.addField(Locale.FRENCH, "title", "[fr] The Test Folder Menu");
+        MenuSeparatorDefinition newSeparator = folder.newMenuSeparatorDefinition();
+        newSeparator.setText("-- Folder Menu --");
+        newSeparator.setTitle("Rollover: Folder Menu");
+        newSeparator.setSkin("header");
+        metadata = newSeparator.getMetadata();
+        metadata.addField(Locale.FRENCH, "text", "-- [fr] Folder Menu --");
+        metadata.addField(Locale.FRENCH, "title", "[fr] Rollover: Folder Menu");
+        newMenu.getMenuElements().add(newSeparator);
+        MenuOptionsDefinition newOptions0 = folder.newMenuOptionsDefinition();
+        newOptions0.setOptions("/*.psml");
+        newOptions0.setRegexp(true);
+        newOptions0.setSkin("flash");
+        newMenu.getMenuElements().add(newOptions0);
+        MenuOptionsDefinition newOptions1 = folder.newMenuOptionsDefinition();
+        newOptions1.setOptions("/folder0");
+        newOptions1.setProfile("role-fallback");
+        newOptions1.setOrder("/folder*");
+        newOptions1.setDepth(1);
+        newOptions1.setPaths(true);
+        newMenu.getMenuElements().add(newOptions1);
+        MenuDefinition newNestedMenu = folder.newMenuDefinition();
+        newNestedMenu.setOptions("/*/");
+        newNestedMenu.setRegexp(true);
+        newNestedMenu.setDepth(2);
+        newNestedMenu.setOrder("/x*/,/y*/,/z*/");
+        newNestedMenu.setSkin("bold");
+        newMenu.getMenuElements().add(newNestedMenu);
+        MenuExcludeDefinition newExcludeMenu = folder.newMenuExcludeDefinition();
+        newExcludeMenu.setName("exclude-menu");
+        newMenu.getMenuElements().add(newExcludeMenu);
+        MenuIncludeDefinition newIncludeMenu = folder.newMenuIncludeDefinition();
+        newIncludeMenu.setName("include-menu");
+        newIncludeMenu.setNest(true);
+        newMenu.getMenuElements().add(newIncludeMenu);
+        folder.getMenuDefinitions().add(newMenu);
+        newMenu = folder.newMenuDefinition();
+        newMenu.setName("folder-breadcrumb-menu");
+        newMenu.setSkin("bread-crumbs");
+        newMenu.setOptions("./");
+        newMenu.setPaths(true);
+        folder.getMenuDefinitions().add(newMenu);
         pageManager.updateFolder(folder);
         
         assertNull(folder.getParent());
@@ -191,6 +245,35 @@
         pageConstraintsRefs.add("manager-edit");
         pageConstraints.setSecurityConstraintsRefs(pageConstraintsRefs);
         page.setSecurityConstraints(pageConstraints);
+        List pageMenus = new ArrayList();
+        newMenu = page.newMenuDefinition();
+        newMenu.setName("page-menu-1");
+        newMenu.setTitle("The Test Page Menu");
+        metadata = newMenu.getMetadata();
+        metadata.addField(Locale.FRENCH, "title", "[fr] The Test Page Menu");
+        newSeparator = page.newMenuSeparatorDefinition();
+        newSeparator.setText("-- Page Menu --");
+        List menuElements = new ArrayList();
+        menuElements.add(newSeparator);
+        newOptions0 = page.newMenuOptionsDefinition();
+        newOptions0.setOptions("/*.psml");
+        menuElements.add(newOptions0);
+        newNestedMenu = page.newMenuDefinition();
+        newNestedMenu.setOptions("/*/");
+        menuElements.add(newNestedMenu);
+        newExcludeMenu = page.newMenuExcludeDefinition();
+        newExcludeMenu.setName("exclude-menu");
+        menuElements.add(newExcludeMenu);
+        newIncludeMenu = page.newMenuIncludeDefinition();
+        newIncludeMenu.setName("include-menu");
+        menuElements.add(newIncludeMenu);
+        newMenu.setMenuElements(menuElements);
+        pageMenus.add(newMenu);
+        newMenu = page.newMenuDefinition();
+        newMenu.setName("page-menu-2");
+        newMenu.setOptions("./");
+        pageMenus.add(newMenu);
+        page.setMenuDefinitions(pageMenus);
 
         Fragment root = page.getRootFragment();
         root.setDecorator("blue-gradient");
@@ -423,6 +506,30 @@
             assertNotNull(check.getSecurityConstraints().getSecurityConstraints());
             assertEquals(1, check.getSecurityConstraints().getSecurityConstraints().size());
             assertEquals("jetspeed", Shared.makeCSVFromList(((SecurityConstraint)check.getSecurityConstraints().getSecurityConstraints().get(0)).getUsers()));
+            assertNotNull(check.getMenuDefinitions());
+            assertEquals(2, check.getMenuDefinitions().size());
+            MenuDefinition checkMenu = (MenuDefinition)check.getMenuDefinitions().get(0);
+            assertEquals("page-menu-1", checkMenu.getName());
+            assertEquals("The Test Page Menu", checkMenu.getTitle());
+            assertEquals("[fr] The Test Page Menu", checkMenu.getTitle(Locale.FRENCH));
+            assertNotNull(checkMenu.getMenuElements());
+            assertEquals(5,checkMenu.getMenuElements().size());
+            assertTrue(checkMenu.getMenuElements().get(0) instanceof MenuSeparatorDefinition);
+            assertEquals("-- Page Menu --", ((MenuSeparatorDefinition)checkMenu.getMenuElements().get(0)).getText());
+            assertTrue(checkMenu.getMenuElements().get(1) instanceof MenuOptionsDefinition);
+            assertEquals("/*.psml", ((MenuOptionsDefinition)checkMenu.getMenuElements().get(1)).getOptions());
+            assertTrue(checkMenu.getMenuElements().get(2) instanceof MenuDefinition);
+            assertEquals("/*/", ((MenuDefinition)checkMenu.getMenuElements().get(2)).getOptions());
+            assertNotNull(((MenuDefinition)checkMenu.getMenuElements().get(2)).getMenuElements());
+            assertTrue(((MenuDefinition)checkMenu.getMenuElements().get(2)).getMenuElements().isEmpty());
+            assertTrue(checkMenu.getMenuElements().get(3) instanceof MenuExcludeDefinition);
+            assertEquals("exclude-menu", ((MenuExcludeDefinition)checkMenu.getMenuElements().get(3)).getName());
+            assertTrue(checkMenu.getMenuElements().get(4) instanceof MenuIncludeDefinition);
+            assertEquals("include-menu", ((MenuIncludeDefinition)checkMenu.getMenuElements().get(4)).getName());
+            checkMenu = (MenuDefinition)check.getMenuDefinitions().get(1);
+            assertEquals("page-menu-2", checkMenu.getName());
+            assertNotNull(checkMenu.getMenuElements());
+            assertTrue(checkMenu.getMenuElements().isEmpty());
             assertNotNull(check.getRootFragment());
             assertEquals("blue-gradient", check.getRootFragment().getDecorator());
             assertEquals("jetspeed-layouts::VelocityTwoColumns", check.getRootFragment().getName());
@@ -512,6 +619,53 @@
             assertEquals("__subsite-rootx", ((Node)all.next()).getName());
             assertEquals("another-page.psml", ((Node)all.next()).getName());
             assertEquals("page.security", ((Node)all.next()).getName());
+            assertNotNull(check.getMenuDefinitions());
+            assertEquals(2, check.getMenuDefinitions().size());
+            MenuDefinition checkMenu = (MenuDefinition)check.getMenuDefinitions().get(0);
+            assertEquals("folder-breadcrumb-menu", checkMenu.getName());
+            assertEquals("bread-crumbs", checkMenu.getSkin());
+            assertEquals("./", checkMenu.getOptions());
+            assertTrue(checkMenu.isPaths());
+            assertNotNull(checkMenu.getMenuElements());
+            assertTrue(checkMenu.getMenuElements().isEmpty());
+            checkMenu = (MenuDefinition)check.getMenuDefinitions().get(1);
+            assertEquals("folder-menu", checkMenu.getName());
+            assertEquals("The Test Folder Menu", checkMenu.getTitle());
+            assertEquals("Folder Menu", checkMenu.getShortTitle());
+            assertEquals("group-fallback", checkMenu.getProfile());
+            assertEquals("[fr] Folder Menu", checkMenu.getShortTitle(Locale.FRENCH));
+            assertEquals("[fr] The Test Folder Menu", checkMenu.getTitle(Locale.FRENCH));
+            assertNotNull(checkMenu.getMenuElements());
+            assertEquals(6,checkMenu.getMenuElements().size());
+            assertTrue(checkMenu.getMenuElements().get(0) instanceof MenuSeparatorDefinition);
+            assertEquals("-- Folder Menu --", ((MenuSeparatorDefinition)checkMenu.getMenuElements().get(0)).getText());
+            assertEquals("Rollover: Folder Menu", ((MenuSeparatorDefinition)checkMenu.getMenuElements().get(0)).getTitle());
+            assertEquals("header", ((MenuSeparatorDefinition)checkMenu.getMenuElements().get(0)).getSkin());
+            assertEquals("-- [fr] Folder Menu --", ((MenuSeparatorDefinition)checkMenu.getMenuElements().get(0)).getText(Locale.FRENCH));
+            assertEquals("[fr] Rollover: Folder Menu", ((MenuSeparatorDefinition)checkMenu.getMenuElements().get(0)).getTitle(Locale.FRENCH));
+            assertTrue(checkMenu.getMenuElements().get(1) instanceof MenuOptionsDefinition);
+            assertEquals("/*.psml", ((MenuOptionsDefinition)checkMenu.getMenuElements().get(1)).getOptions());
+            assertTrue(((MenuOptionsDefinition)checkMenu.getMenuElements().get(1)).isRegexp());
+            assertEquals("flash", ((MenuOptionsDefinition)checkMenu.getMenuElements().get(1)).getSkin());
+            assertTrue(checkMenu.getMenuElements().get(2) instanceof MenuOptionsDefinition);
+            assertEquals("/folder0", ((MenuOptionsDefinition)checkMenu.getMenuElements().get(2)).getOptions());
+            assertEquals("role-fallback", ((MenuOptionsDefinition)checkMenu.getMenuElements().get(2)).getProfile());
+            assertEquals("/folder*", ((MenuOptionsDefinition)checkMenu.getMenuElements().get(2)).getOrder());
+            assertEquals(1, ((MenuOptionsDefinition)checkMenu.getMenuElements().get(2)).getDepth());
+            assertTrue(((MenuOptionsDefinition)checkMenu.getMenuElements().get(2)).isPaths());
+            assertTrue(checkMenu.getMenuElements().get(3) instanceof MenuDefinition);
+            assertEquals("/*/", ((MenuDefinition)checkMenu.getMenuElements().get(3)).getOptions());
+            assertTrue(((MenuDefinition)checkMenu.getMenuElements().get(3)).isRegexp());
+            assertEquals(2, ((MenuDefinition)checkMenu.getMenuElements().get(3)).getDepth());
+            assertEquals("/x*/,/y*/,/z*/", ((MenuDefinition)checkMenu.getMenuElements().get(3)).getOrder());
+            assertEquals("bold", ((MenuDefinition)checkMenu.getMenuElements().get(3)).getSkin());
+            assertNotNull(((MenuDefinition)checkMenu.getMenuElements().get(3)).getMenuElements());
+            assertTrue(((MenuDefinition)checkMenu.getMenuElements().get(3)).getMenuElements().isEmpty());
+            assertTrue(checkMenu.getMenuElements().get(4) instanceof MenuExcludeDefinition);
+            assertEquals("exclude-menu", ((MenuExcludeDefinition)checkMenu.getMenuElements().get(4)).getName());
+            assertTrue(checkMenu.getMenuElements().get(5) instanceof MenuIncludeDefinition);
+            assertEquals("include-menu", ((MenuIncludeDefinition)checkMenu.getMenuElements().get(5)).getName());
+            assertTrue(((MenuIncludeDefinition)checkMenu.getMenuElements().get(5)).isNest());
         }
         catch (FolderNotFoundException e)
         {
@@ -567,6 +721,11 @@
         folder.getDocumentOrder().remove("some-other-page.psml");
         folder.getDocumentOrder().add("UPDATED");
         folder.getDocumentOrder().add("some-other-page.psml");
+        MenuDefinition updateMenu = (MenuDefinition)folder.getMenuDefinitions().get(1);
+        updateMenu.setName("UPDATED");
+        updateMenu.setTitle("UPDATED");
+        updateMenu.getMetadata().addField(Locale.JAPANESE, "short-title", "[ja] UPDATED");
+        ((MenuOptionsDefinition)updateMenu.getMenuElements().get(2)).setProfile("UPDATED");
         pageManager.updateFolder(folder);
 
         assertNotNull(folder.getAll());

Modified: portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/GenericMetadataImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/GenericMetadataImpl.java?rev=351770&r1=351769&r2=351770&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/GenericMetadataImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/impl/GenericMetadataImpl.java
Fri Dec  2 08:52:05 2005
@@ -112,7 +112,7 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.om.common.GenericMetadata#setField(java.util.Collection)
+     * @see org.apache.jetspeed.om.common.GenericMetadata#setFields(java.util.Collection)
      */
     public void setFields(Collection fields)
     {
@@ -129,5 +129,59 @@
             }
         }
         
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.common.GenericMetadata#copyFields(java.util.Collection)
+     */
+    public void copyFields(Collection fields)
+    {
+        // preserve matching fields during copy to
+        // minimize persistent store thrash and
+        // field uniqueness constraint violations
+        // that may occur if identical field is
+        // removed and reinserted
+        if ((this.fields != null) && !this.fields.isEmpty())
+        {
+            // remove unique existing fields
+            if (fields != null)
+            {
+                this.fields.retainAll(fields);
+            }
+            else
+            {
+                this.fields = null;
+            }
+        }
+        if ((fields != null) && !fields.isEmpty())
+        {
+            // create new fields collection if necessary
+            if (this.fields == null)
+            {
+                this.fields = new ArrayList();
+            }
+            // copy unique new metadata members
+            Iterator fieldIter = fields.iterator();
+            while (fieldIter.hasNext())
+            {
+                LocalizedField field = (LocalizedField)fieldIter.next();
+                if (!this.fields.contains(field))
+                {
+                    addField(field.getLocale(), field.getName(), field.getValue());
+                }
+            }
+        }
+        
+        // update field map
+        this.fieldMap.clear();
+        if (this.fields != null)
+        {    
+            Iterator fieldIter = this.fields.iterator();
+            while (fieldIter.hasNext())
+            {
+                LocalizedField field = (LocalizedField)fieldIter.next();
+                this.fieldMap.put(field.getName(), field);
+            }
+        }
     }
 }

Modified: portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml?rev=351770&r1=351769&r2=351770&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml (original)
+++ portals/jetspeed-2/trunk/etc/schema/phase2-schema.xml Fri Dec  2 08:52:05 2005
@@ -120,6 +120,59 @@
         </unique>
     </table>
 
+    <table name="FOLDER_MENU">
+        <column name="MENU_ID" primaryKey="true" required="true" type="INTEGER"/>
+        <column name="CLASS_NAME" required="true" size="100" type="VARCHAR"/>
+        <column name="PARENT_ID" type="INTEGER"/>
+        <column name="FOLDER_ID" type="INTEGER"/>
+        <column name="ELEMENT_ORDER" type="INTEGER"/>
+        <column name="NAME" size="100" type="VARCHAR"/>
+        <column name="TITLE" size="100" type="VARCHAR"/>
+        <column name="SHORT_TITLE" size="40" type="VARCHAR"/>
+        <column name="TEXT" size="100" type="VARCHAR"/>
+        <column name="OPTIONS" size="255" type="VARCHAR"/>
+        <column name="DEPTH" type="INTEGER"/>
+        <column name="IS_PATHS" type="BOOLEANINT"/>
+        <column name="IS_REGEXP" type="BOOLEANINT"/>
+        <column name="PROFILE" size="80" type="VARCHAR"/>
+        <column name="OPTIONS_ORDER" size="255" type="VARCHAR"/>
+        <column name="SKIN" size="80" type="VARCHAR"/>
+        <column name="IS_NEST" type="BOOLEANINT"/>
+        <foreign-key foreignTable="FOLDER_MENU" onDelete="cascade">
+            <reference foreign="MENU_ID" local="PARENT_ID"/>
+        </foreign-key>
+        <foreign-key foreignTable="FOLDER" onDelete="cascade">
+            <reference foreign="FOLDER_ID" local="FOLDER_ID"/>
+        </foreign-key>
+        <index name="IX_FOLDER_MENU_1">
+            <index-column name="PARENT_ID"/>
+        </index>        
+        <unique name="UN_FOLDER_MENU_1">
+            <unique-column name="FOLDER_ID"/>
+            <unique-column name="NAME"/>
+        </unique>
+    </table>
+
+    <table name="FOLDER_MENU_METADATA">
+        <column name="METADATA_ID" primaryKey="true" required="true" type="INTEGER"/>
+        <column name="MENU_ID" type="INTEGER" required="true"/>
+        <column name="NAME" required="true" size="15" type="VARCHAR"/>
+        <column name="LOCALE" required="true" size="20" type="VARCHAR"/>
+        <column name="VALUE" required="true" size="100" type="VARCHAR"/>
+        <foreign-key foreignTable="FOLDER_MENU" onDelete="cascade">
+            <reference foreign="MENU_ID" local="MENU_ID"/>
+        </foreign-key>
+        <index name="IX_FOLDER_MENU_METADATA_1">
+            <index-column name="MENU_ID"/>
+        </index>
+        <unique name="UN_FOLDER_MENU_METADATA_1">
+            <unique-column name="MENU_ID"/>
+            <unique-column name="NAME"/>
+            <unique-column name="LOCALE"/>
+            <unique-column name="VALUE"/>
+        </unique>
+    </table>
+
     <!--
        Page Definition
     -->
@@ -206,6 +259,59 @@
         <unique name="UN_PAGE_CONSTRAINTS_REF_1">
             <unique-column name="PAGE_ID"/>
             <unique-column name="NAME"/>
+        </unique>
+    </table>
+
+    <table name="PAGE_MENU">
+        <column name="MENU_ID" primaryKey="true" required="true" type="INTEGER"/>
+        <column name="CLASS_NAME" required="true" size="100" type="VARCHAR"/>
+        <column name="PARENT_ID" type="INTEGER"/>
+        <column name="PAGE_ID" type="INTEGER"/>
+        <column name="ELEMENT_ORDER" type="INTEGER"/>
+        <column name="NAME" size="100" type="VARCHAR"/>
+        <column name="TITLE" size="100" type="VARCHAR"/>
+        <column name="SHORT_TITLE" size="40" type="VARCHAR"/>
+        <column name="TEXT" size="100" type="VARCHAR"/>
+        <column name="OPTIONS" size="255" type="VARCHAR"/>
+        <column name="DEPTH" type="INTEGER"/>
+        <column name="IS_PATHS" type="BOOLEANINT"/>
+        <column name="IS_REGEXP" type="BOOLEANINT"/>
+        <column name="PROFILE" size="80" type="VARCHAR"/>
+        <column name="OPTIONS_ORDER" size="255" type="VARCHAR"/>
+        <column name="SKIN" size="80" type="VARCHAR"/>
+        <column name="IS_NEST" type="BOOLEANINT"/>
+        <foreign-key foreignTable="PAGE_MENU" onDelete="cascade">
+            <reference foreign="MENU_ID" local="PARENT_ID"/>
+        </foreign-key>
+        <foreign-key foreignTable="PAGE" onDelete="cascade">
+            <reference foreign="PAGE_ID" local="PAGE_ID"/>
+        </foreign-key>
+        <index name="IX_PAGE_MENU_1">
+            <index-column name="PARENT_ID"/>
+        </index>        
+        <unique name="UN_PAGE_MENU_1">
+            <unique-column name="PAGE_ID"/>
+            <unique-column name="NAME"/>
+        </unique>
+    </table>
+
+    <table name="PAGE_MENU_METADATA">
+        <column name="METADATA_ID" primaryKey="true" required="true" type="INTEGER"/>
+        <column name="MENU_ID" type="INTEGER" required="true"/>
+        <column name="NAME" required="true" size="15" type="VARCHAR"/>
+        <column name="LOCALE" required="true" size="20" type="VARCHAR"/>
+        <column name="VALUE" required="true" size="100" type="VARCHAR"/>
+        <foreign-key foreignTable="PAGE_MENU" onDelete="cascade">
+            <reference foreign="MENU_ID" local="MENU_ID"/>
+        </foreign-key>
+        <index name="IX_PAGE_MENU_METADATA_1">
+            <index-column name="MENU_ID"/>
+        </index>
+        <unique name="UN_PAGE_MENU_METADATA_1">
+            <unique-column name="MENU_ID"/>
+            <unique-column name="NAME"/>
+            <unique-column name="LOCALE"/>
+            <unique-column name="VALUE"/>
         </unique>
     </table>
 

Modified: portals/jetspeed-2/trunk/etc/sql/derby/schema/phase2-schema.sql
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/etc/sql/derby/schema/phase2-schema.sql?rev=351770&r1=351769&r2=351770&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/etc/sql/derby/schema/phase2-schema.sql (original)
+++ portals/jetspeed-2/trunk/etc/sql/derby/schema/phase2-schema.sql Fri Dec  2 08:52:05 2005
@@ -99,6 +99,58 @@
     UNIQUE (FOLDER_ID, NAME));
 
 CREATE  INDEX IX_FOLDER_ORDER_1 ON FOLDER_ORDER (FOLDER_ID);
+-------------------------------------------------------------------------
+-- FOLDER_MENU
+-------------------------------------------------------------------------
+CREATE TABLE FOLDER_MENU
+(
+    MENU_ID INTEGER NOT NULL,
+    CLASS_NAME VARCHAR(100) NOT NULL,
+    PARENT_ID INTEGER,
+    FOLDER_ID INTEGER,
+    ELEMENT_ORDER INTEGER,
+    NAME VARCHAR(100),
+    TITLE VARCHAR(100),
+    SHORT_TITLE VARCHAR(40),
+    TEXT VARCHAR(100),
+    OPTIONS VARCHAR(255),
+    DEPTH INTEGER,
+    IS_PATHS INTEGER,
+    IS_REGEXP INTEGER,
+    PROFILE VARCHAR(80),
+    OPTIONS_ORDER VARCHAR(255),
+    SKIN VARCHAR(80),
+    IS_NEST INTEGER,
+    PRIMARY KEY(MENU_ID),
+    FOREIGN KEY (PARENT_ID) REFERENCES FOLDER_MENU (MENU_ID)
+        ON DELETE CASCADE 
+  ,
+    FOREIGN KEY (FOLDER_ID) REFERENCES FOLDER (FOLDER_ID)
+        ON DELETE CASCADE 
+
+-- Derby doesn't support UNIQUE constraints on nullable columns !!!  
+-- replace UNIQUE (FOLDER_ID, NAME) with IX_FOLDER_MENU_UNIQUE_FN index below...
+  );
+
+CREATE  INDEX IX_FOLDER_MENU_1 ON FOLDER_MENU (PARENT_ID);
+CREATE  INDEX IX_FOLDER_MENU_UNIQUE_FN ON FOLDER_MENU (FOLDER_ID, NAME);
+--------------------------------------------------------------------------
+-- FOLDER_MENU_METADATA
+--------------------------------------------------------------------------
+CREATE TABLE FOLDER_MENU_METADATA
+(
+    METADATA_ID INTEGER NOT NULL,
+    MENU_ID INTEGER NOT NULL,
+    NAME VARCHAR(15) NOT NULL,
+    LOCALE VARCHAR(20) NOT NULL,
+    VALUE VARCHAR(100) NOT NULL,
+    PRIMARY KEY(METADATA_ID),
+    FOREIGN KEY (MENU_ID) REFERENCES FOLDER_MENU (MENU_ID)
+        ON DELETE CASCADE 
+  ,
+    UNIQUE (MENU_ID, NAME, LOCALE, VALUE));
+
+CREATE  INDEX IX_FOLDER_MENU_METADATA_1 ON FOLDER_MENU_METADATA (MENU_ID);
 -----------------------------------------------------------------------------
 -- PAGE
 -----------------------------------------------------------------------------
@@ -186,6 +238,58 @@
     UNIQUE (PAGE_ID, NAME));
 
 CREATE  INDEX IX_PAGE_CONSTRAINTS_REF_1 ON PAGE_CONSTRAINTS_REF (PAGE_ID);
+-------------------------------------------------------------------------
+-- PAGE_MENU
+-------------------------------------------------------------------------
+CREATE TABLE PAGE_MENU
+(
+    MENU_ID INTEGER NOT NULL,
+    CLASS_NAME VARCHAR(100) NOT NULL,
+    PARENT_ID INTEGER,
+    PAGE_ID INTEGER,
+    ELEMENT_ORDER INTEGER,
+    NAME VARCHAR(100),
+    TITLE VARCHAR(100),
+    SHORT_TITLE VARCHAR(40),
+    TEXT VARCHAR(100),
+    OPTIONS VARCHAR(255),
+    DEPTH INTEGER,
+    IS_PATHS INTEGER,
+    IS_REGEXP INTEGER,
+    PROFILE VARCHAR(80),
+    OPTIONS_ORDER VARCHAR(255),
+    SKIN VARCHAR(80),
+    IS_NEST INTEGER,
+    PRIMARY KEY(MENU_ID),
+    FOREIGN KEY (PARENT_ID) REFERENCES PAGE_MENU (MENU_ID)
+        ON DELETE CASCADE 
+  ,
+    FOREIGN KEY (PAGE_ID) REFERENCES PAGE (PAGE_ID)
+        ON DELETE CASCADE 
+
+-- Derby doesn't support UNIQUE constraints on nullable columns !!!  
+-- replace UNIQUE (PAGE_ID, NAME) with IX_PAGE_MENU_UNIQUE_PN index below...
+  );
+
+CREATE  INDEX IX_PAGE_MENU_1 ON PAGE_MENU (PARENT_ID);
+CREATE  INDEX IX_PAGE_MENU_UNIQUE_PN ON PAGE_MENU (PAGE_ID, NAME);
+--------------------------------------------------------------------------
+-- PAGE_MENU_METADATA
+--------------------------------------------------------------------------
+CREATE TABLE PAGE_MENU_METADATA
+(
+    METADATA_ID INTEGER NOT NULL,
+    MENU_ID INTEGER NOT NULL,
+    NAME VARCHAR(15) NOT NULL,
+    LOCALE VARCHAR(20) NOT NULL,
+    VALUE VARCHAR(100) NOT NULL,
+    PRIMARY KEY(METADATA_ID),
+    FOREIGN KEY (MENU_ID) REFERENCES PAGE_MENU (MENU_ID)
+        ON DELETE CASCADE 
+  ,
+    UNIQUE (MENU_ID, NAME, LOCALE, VALUE));
+
+CREATE  INDEX IX_PAGE_MENU_METADATA_1 ON PAGE_MENU_METADATA (MENU_ID);
 -----------------------------------------------------------------------------
 -- FRAGMENT
 -----------------------------------------------------------------------------

Modified: portals/jetspeed-2/trunk/etc/sql/drop.sql
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/etc/sql/drop.sql?rev=351770&r1=351769&r2=351770&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/etc/sql/drop.sql (original)
+++ portals/jetspeed-2/trunk/etc/sql/drop.sql Fri Dec  2 08:52:05 2005
@@ -25,10 +25,14 @@
 DROP TABLE FRAGMENT_CONSTRAINTS_REF;
 DROP TABLE FRAGMENT_CONSTRAINT;
 DROP TABLE FRAGMENT;
+DROP TABLE PAGE_MENU_METADATA;
+DROP TABLE PAGE_MENU;
 DROP TABLE PAGE_CONSTRAINTS_REF;
 DROP TABLE PAGE_CONSTRAINT;
 DROP TABLE PAGE_METADATA;
 DROP TABLE PAGE;
+DROP TABLE FOLDER_MENU_METADATA;
+DROP TABLE FOLDER_MENU;
 DROP TABLE FOLDER_ORDER;
 DROP TABLE FOLDER_CONSTRAINTS_REF;
 DROP TABLE FOLDER_CONSTRAINT;

Modified: portals/jetspeed-2/trunk/etc/sql/oracle/drop.sql
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/etc/sql/oracle/drop.sql?rev=351770&r1=351769&r2=351770&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/etc/sql/oracle/drop.sql (original)
+++ portals/jetspeed-2/trunk/etc/sql/oracle/drop.sql Fri Dec  2 08:52:05 2005
@@ -30,10 +30,14 @@
 DROP TABLE FRAGMENT_CONSTRAINTS_REF;
 DROP TABLE FRAGMENT_CONSTRAINT;
 DROP TABLE FRAGMENT;
+DROP TABLE PAGE_MENU_METADATA;
+DROP TABLE PAGE_MENU;
 DROP TABLE PAGE_CONSTRAINTS_REF;
 DROP TABLE PAGE_CONSTRAINT;
 DROP TABLE PAGE_METADATA;
 DROP TABLE PAGE;
+DROP TABLE FOLDER_MENU_METADATA;
+DROP TABLE FOLDER_MENU;
 DROP TABLE FOLDER_ORDER;
 DROP TABLE FOLDER_CONSTRAINTS_REF;
 DROP TABLE FOLDER_CONSTRAINT;

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/GenericMetadata.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/GenericMetadata.java?rev=351770&r1=351769&r2=351770&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/GenericMetadata.java
(original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/GenericMetadata.java
Fri Dec  2 08:52:05 2005
@@ -98,4 +98,14 @@
      * @return
      */
     LocalizedField createLocalizedField();
-}
\ No newline at end of file
+
+    /**
+     * 
+     * <p>
+     * copyFields
+     * </p>
+     *
+     * @param fields
+     */
+    public void copyFields( Collection fields );
+}

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/SecuredResource.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/SecuredResource.java?rev=351770&r1=351769&r2=351770&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/SecuredResource.java
(original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/common/SecuredResource.java
Fri Dec  2 08:52:05 2005
@@ -54,30 +54,30 @@
     
     /**
      * <p>
-     * setSecurityConstraints
+     * newSecurityConstraints
      * </p>
      *
-     * @param constraints security constraints for resource
+     * @return a newly created SecurityConstraints object for use in SecuredResource
      */
-    void setSecurityConstraints(SecurityConstraints constraints);
+    SecurityConstraints newSecurityConstraints();
 
     /**
      * <p>
-     * newSecurityConstraints
+     * newSecurityConstraint
      * </p>
      *
-     * @return a newly created SecurityConstraints object
+     * @return a newly created SecurityConstraint object for use in SecuredResource
      */
-    SecurityConstraints newSecurityConstraints();
+    SecurityConstraint newSecurityConstraint();
 
     /**
      * <p>
-     * newSecurityConstraint
+     * setSecurityConstraints
      * </p>
      *
-     * @return a newly created SecurityConstraint object
+     * @param constraints security constraints for resource
      */
-    SecurityConstraint newSecurityConstraint();
+    void setSecurityConstraints(SecurityConstraints constraints);
 
     /**
      * <p>

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java?rev=351770&r1=351769&r2=351770&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java
(original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java
Fri Dec  2 08:52:05 2005
@@ -213,6 +213,41 @@
     List getMenuDefinitions();
 
     /**
+     * newMenuDefinition - creates a new empty menu definition
+     *
+     * @return a newly created MenuDefinition object for use in Folder
+     */
+    MenuDefinition newMenuDefinition();
+
+    /**
+     * newMenuExcludeDefinition - creates a new empty menu exclude definition
+     *
+     * @return a newly created MenuExcludeDefinition object for use in Folder
+     */
+    MenuExcludeDefinition newMenuExcludeDefinition();
+
+    /**
+     * newMenuIncludeDefinition - creates a new empty menu include definition
+     *
+     * @return a newly created MenuIncludeDefinition object for use in Folder
+     */
+    MenuIncludeDefinition newMenuIncludeDefinition();
+
+    /**
+     * newMenuOptionsDefinition - creates a new empty menu options definition
+     *
+     * @return a newly created MenuOptionsDefinition object for use in Folder
+     */
+    MenuOptionsDefinition newMenuOptionsDefinition();
+
+    /**
+     * newMenuSeparatorDefinition - creates a new empty menu separator definition
+     *
+     * @return a newly created MenuSeparatorDefinition object for use in Folder
+     */
+    MenuSeparatorDefinition newMenuSeparatorDefinition();
+
+    /**
      * setMenuDefinitions - set list of menu definitions
      *
      * @param definitions definition list

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Page.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Page.java?rev=351770&r1=351769&r2=351770&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Page.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Page.java Fri
Dec  2 08:52:05 2005
@@ -17,6 +17,12 @@
 
 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;
+
 /**
  * This interface represents a complete page document used by Jetspeed
  * to layout a user-customizable portal page.
@@ -109,6 +115,41 @@
      * @return definition list
      */
     List getMenuDefinitions();
+
+    /**
+     * newMenuDefinition - creates a new empty menu definition
+     *
+     * @return a newly created MenuDefinition object for use in Page
+     */
+    MenuDefinition newMenuDefinition();
+
+    /**
+     * newMenuExcludeDefinition - creates a new empty menu exclude definition
+     *
+     * @return a newly created MenuExcludeDefinition object for use in Page
+     */
+    MenuExcludeDefinition newMenuExcludeDefinition();
+
+    /**
+     * newMenuIncludeDefinition - creates a new empty menu include definition
+     *
+     * @return a newly created MenuIncludeDefinition object for use in Page
+     */
+    MenuIncludeDefinition newMenuIncludeDefinition();
+
+    /**
+     * newMenuOptionsDefinition - creates a new empty menu options definition
+     *
+     * @return a newly created MenuOptionsDefinition object for use in Page
+     */
+    MenuOptionsDefinition newMenuOptionsDefinition();
+
+    /**
+     * newMenuSeparatorDefinition - creates a new empty menu separator definition
+     *
+     * @return a newly created MenuSeparatorDefinition object for use in Page
+     */
+    MenuSeparatorDefinition newMenuSeparatorDefinition();
 
     /**
      * setMenuDefinitions - set list of menu definitions

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/PageSecurity.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/PageSecurity.java?rev=351770&r1=351769&r2=351770&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/PageSecurity.java
(original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/PageSecurity.java
Fri Dec  2 08:52:05 2005
@@ -44,21 +44,21 @@
     
     /**
      * <p>
-     * setSecurityConstraintsDefs
+     * newSecurityConstraintsDef
      * </p>
      *
-     * @param defintions security constraints definitions
+     * @return a newly created SecurityConstraintsDef object for use in PageSecurity
      */
-    void setSecurityConstraintsDefs(List definitions);
+    SecurityConstraintsDef newSecurityConstraintsDef();
 
     /**
      * <p>
-     * newSecurityConstraintsDef
+     * setSecurityConstraintsDefs
      * </p>
      *
-     * @return a newly created SecurityConstraintsDef object
+     * @param defintions security constraints definitions
      */
-    SecurityConstraintsDef newSecurityConstraintsDef();
+    void setSecurityConstraintsDefs(List definitions);
 
     /**
      * <p>



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