portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject svn commit: r330589 - in /portals/jetspeed-2/trunk: components/page-manager/src/java/JETSPEED-INF/castor/ components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/ components/page-manager/src/java/org/apache/jetspeed/om/page/ components/page...
Date Thu, 03 Nov 2005 17:39:49 GMT
Author: weaver
Date: Thu Nov  3 09:39:17 2005
New Revision: 330589

URL: http://svn.apache.org/viewcvs?rev=330589&view=rev
Log:
JS2-383: Supporting psml level preference settings.

http://issues.apache.org/jira/browse/JS2-383

Added:
    portals/jetspeed-2/trunk/components/page-manager/src/test/fragment-test.xml   (with props)
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestMappings.java   (with props)
    portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/FragmentPortletDefinition.java   (with props)
    portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPortletPreferenceSet.java   (with props)
    portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPreference.java   (with props)
Modified:
    portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorFragmentImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java
    portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Fragment.java
    portals/jetspeed-2/trunk/xdocs/psml.xml

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml?rev=330589&r1=330588&r2=330589&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/JETSPEED-INF/castor/page-mapping.xml Thu Nov  3 09:39:17 2005
@@ -34,13 +34,13 @@
       <bind-xml name="fragment"/>
     </field>
 
-	<field name="metadataFields"
+    <field name="metadataFields"
            type="org.apache.jetspeed.om.page.PageLocalizedFieldImpl" 
            collection="collection">
       <bind-xml name="metadata"/>
     </field>
 
-	<field name="menuDefinitions"
+    <field name="menuDefinitions"
            type="org.apache.jetspeed.om.folder.psml.MenuDefinitionImpl" 
            collection="collection">
       <bind-xml name="menu"/>
@@ -50,7 +50,7 @@
   <class name="org.apache.jetspeed.om.page.PageLocalizedFieldImpl">
     <map-to xml="metadata"/>
 
-	<field name="name" type="java.lang.String">
+    <field name="name" type="java.lang.String">
       <bind-xml name="name" node="attribute"/>
     </field>
 
@@ -113,6 +113,11 @@
            type="org.apache.jetspeed.om.page.psml.PropertyImpl" collection="vector">
       <bind-xml name="property"/>
     </field>
+    
+    <field name="preferences"
+           type="org.apache.jetspeed.om.preference.impl.FragmentPreference" collection="arraylist">
+      <bind-xml name="preference"/>
+    </field>
   </class>
     
   <class name="org.apache.jetspeed.om.page.psml.LinkImpl">
@@ -143,7 +148,7 @@
       <bind-xml name="short-title"/>
     </field>
     
- 	<field name="metadataFields"
+     <field name="metadataFields"
            type="org.apache.jetspeed.om.page.PageLocalizedFieldImpl" 
            collection="collection">
       <bind-xml name="metadata"/>
@@ -180,13 +185,13 @@
       <bind-xml name="document-order"/>
     </field>    
 
-	<field name="metadataFields"
+    <field name="metadataFields"
            type="org.apache.jetspeed.om.page.PageLocalizedFieldImpl" 
            collection="collection">
       <bind-xml name="metadata"/>
     </field>
 
-	<field name="menuDefinitions"
+    <field name="menuDefinitions"
            type="org.apache.jetspeed.om.folder.psml.MenuDefinitionImpl" 
            collection="collection">
       <bind-xml name="menu"/>
@@ -236,13 +241,13 @@
       <bind-xml name="short-title"/>
     </field>
     
-	<field name="metadataFields"
+    <field name="metadataFields"
            type="org.apache.jetspeed.om.page.PageLocalizedFieldImpl" 
            collection="collection">
       <bind-xml name="metadata"/>
     </field>
 
-	<field name="menuElementImpls"
+    <field name="menuElementImpls"
            type="org.apache.jetspeed.om.folder.psml.MenuElementImpl" 
            collection="collection">
       <bind-xml name="menu-element"/>
@@ -329,7 +334,7 @@
       <bind-xml node="text"/>
     </field>
     
-	<field name="metadataFields"
+    <field name="metadataFields"
            type="org.apache.jetspeed.om.page.PageLocalizedFieldImpl" 
            collection="collection">
       <bind-xml name="metadata"/>
@@ -391,7 +396,7 @@
   <class name="org.apache.jetspeed.om.page.psml.SecurityConstraintsImpl">
     <map-to xml="security-constraints"/>
 
-	<field name="owner" type="java.lang.String">
+    <field name="owner" type="java.lang.String">
       <bind-xml name="owner"/>
     </field>
 
@@ -411,15 +416,15 @@
   <class name="org.apache.jetspeed.om.page.psml.SecurityConstraintImpl">
     <map-to xml="security-constraint"/>
 
-	<field name="users" type="java.lang.String">
+    <field name="users" type="java.lang.String">
       <bind-xml name="users"/>
     </field>
 
-	<field name="roles" type="java.lang.String">
+    <field name="roles" type="java.lang.String">
       <bind-xml name="roles"/>
     </field>
 
-	<field name="groups" type="java.lang.String">
+    <field name="groups" type="java.lang.String">
       <bind-xml name="groups"/>
     </field>
 
@@ -447,7 +452,7 @@
   <class name="org.apache.jetspeed.om.page.psml.SecurityConstraintsDefImpl">
     <map-to xml="security-constraints-def"/>
 
-	<field name="name" type="java.lang.String">
+    <field name="name" type="java.lang.String">
       <bind-xml name="name" node="attribute"/>
     </field>
 
@@ -455,6 +460,25 @@
            type="org.apache.jetspeed.om.page.psml.SecurityConstraintImpl"
            collection="collection">
       <bind-xml name="security-constraint"/>
+    </field>
+  </class>
+  
+
+  <class name="org.apache.jetspeed.om.preference.impl.FragmentPreference">
+    <map-to xml="preference"/>
+
+    <field name="name" type="string">
+      <bind-xml name="name" node="attribute"/>
+    </field>
+    
+    <field name="readOnly" type="boolean">
+      <bind-xml name="readOnly" node="attribute"/>
+    </field>
+    
+    <field name="valueList"
+           type="java.lang.String" 
+           collection="arraylist" >
+      <bind-xml name="value" node="element" />
     </field>
   </class>
 

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java?rev=330589&r1=330588&r2=330589&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java Thu Nov  3 09:39:17 2005
@@ -142,7 +142,7 @@
         pageMetadata.setFields(fields);
         return pageMetadata;
     }
-
+    
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.folder.Folder#isRootFolder()
      */
@@ -157,7 +157,7 @@
      */
     public List getDocumentOrder()
     {
-        return null; //NYI
+        return null; // NYI
     }
     
     /* (non-Javadoc)
@@ -340,5 +340,5 @@
     public String getType()
     {
         return FOLDER_TYPE;
-    }
+}
 }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java?rev=330589&r1=330588&r2=330589&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentFragmentImpl.java Thu Nov  3 09:39:17 2005
@@ -148,7 +148,7 @@
      */
     public Map getProperties()
     {
-
+        
         return fragment.getProperties();
     }
 
@@ -663,6 +663,12 @@
         
         
 
+    }
+
+
+    public List getPreferences()
+    {
+        return fragment.getPreferences();
     }
     
 }

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java?rev=330589&r1=330588&r2=330589&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/impl/FragmentImpl.java Thu Nov  3 09:39:17 2005
@@ -134,10 +134,10 @@
         if (properties != null)
         {
             return (String)properties.get(propName);
-        }
+    }
         return null;
     }
-
+    
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#getProperty(java.lang.String,java.lang.String)
      */
@@ -149,11 +149,11 @@
             if (propValue != null)
             {
                 return Integer.parseInt(propValue);
-            }
+    }
         }
         return -1;
     }
-
+    
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#getProperties()
      */
@@ -163,7 +163,7 @@
         if (properties == null)
         {
             properties = new HashMap(4);
-        }
+    }
         return properties;
     }
     
@@ -175,7 +175,7 @@
         // get standard int property
         return getIntProperty(ROW_PROPERTY_NAME);
     }
-    
+
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#setLayoutRow(int)
      */
@@ -185,13 +185,13 @@
         if (row >= 0)
         {
             getProperties().put(ROW_PROPERTY_NAME, String.valueOf(row));
-        }
+    }
         else if (properties != null)
         {
             properties.remove(ROW_PROPERTY_NAME);
         }
     }
-    
+
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#getLayoutColumn()
      */
@@ -210,13 +210,13 @@
         if (column >= 0)
         {
             getProperties().put(COLUMN_PROPERTY_NAME, String.valueOf(column));
-        }
+    }
         else if (properties != null)
         {
             properties.remove(COLUMN_PROPERTY_NAME);
         }
     }
-    
+
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#getLayoutSizes()
      */
@@ -225,7 +225,7 @@
         // get standard string property
         return getProperty(SIZES_PROPERTY_NAME);
     }
-
+    
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#setLayoutSizes(java.lang.String)
      */
@@ -235,7 +235,7 @@
         if (sizes != null)
         {
             getProperties().put(SIZES_PROPERTY_NAME, sizes);
-        }
+    }
         else if (properties != null)
         {
             properties.remove(SIZES_PROPERTY_NAME);
@@ -249,14 +249,14 @@
     {
         return false; // NYI
     }
-
+    
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#clone()
      */
     public Object clone() throws CloneNotSupportedException
     {
         return null; // NYI
-    }    
+    }
 
     /* (non-Javadoc)
      * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeInsert(org.apache.ojb.broker.PersistenceBroker)
@@ -275,7 +275,7 @@
         // execute update hook
         afterUpdate(broker);
     }
-
+    
     /* (non-Javadoc)
      * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeUpdate(org.apache.ojb.broker.PersistenceBroker)
      */
@@ -302,7 +302,7 @@
                     if (propName.equals(ROW_PROPERTY_NAME))
                     {
                         layoutRowProperty = Integer.parseInt(propValue);
-                    }
+    }
                     else if (propName.equals(COLUMN_PROPERTY_NAME))
                     {
                         layoutColumnProperty = Integer.parseInt(propValue);
@@ -333,7 +333,13 @@
     {
         // nothing to do by default
     }
-
+    
+    public List getPreferences()
+    {
+      // TODO This needs to be implemented in the DB version
+      throw new UnsupportedOperationException("Not Yet Implemented"); // NYI
+    }
+    
     /* (non-Javadoc)
      * @see org.apache.ojb.broker.PersistenceBrokerAware#beforeDelete(org.apache.ojb.broker.PersistenceBroker)
      */
@@ -341,6 +347,7 @@
     {
         // nothing to do by default
     }
+    
 
     /* (non-Javadoc)
      * @see org.apache.ojb.broker.PersistenceBrokerAware#afterDelete(org.apache.ojb.broker.PersistenceBroker)

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java?rev=330589&r1=330588&r2=330589&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java Thu Nov  3 09:39:17 2005
@@ -44,7 +44,9 @@
     private List fragments = new Vector();
 
     private List propertiesList = new Vector();
-
+    
+    private List preferences = new ArrayList();
+    
     private Map propertiesMap = new HashMap();
 
     private String name;
@@ -108,7 +110,7 @@
     public Vector getPropertiesList()
     {
         return (Vector) this.propertiesList;
-    }
+            }
 
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#getProperty(java.lang.String,java.lang.String)
@@ -116,20 +118,20 @@
     public String getProperty(String propName)
     {
         return (String)propertiesMap.get(propName);
-    }
+        }
 
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#getProperty(java.lang.String,java.lang.String)
      */
     public int getIntProperty(String propName)
-    {
+        {
         String prop = (String)propertiesMap.get(propName);
         if (prop != null)
-        {
+            {
             return Integer.parseInt(prop);
-        }
+            }
         return -1;
-    }
+        }
 
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#getProperties()
@@ -137,7 +139,7 @@
     public Map getProperties()
     {
         return propertiesMap;
-    }
+            }
 
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#getLayoutRow()
@@ -148,7 +150,7 @@
         if (prop != null)
         {
             return Integer.parseInt(prop);
-        }
+            }
         return -1;
     }
 
@@ -162,10 +164,10 @@
             propertiesMap.put(ROW_PROPERTY_NAME, String.valueOf(row));
         }
         else
-        {
+            {
             propertiesMap.remove(ROW_PROPERTY_NAME);
+            }
         }
-    }
     
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#getLayoutColumn()
@@ -176,7 +178,7 @@
         if (prop != null)
         {
             return Integer.parseInt(prop);
-        }
+            }
         return -1;
     }
 
@@ -190,10 +192,10 @@
             propertiesMap.put(COLUMN_PROPERTY_NAME, String.valueOf(column));
         }
         else
-        {
+            {
             propertiesMap.remove(COLUMN_PROPERTY_NAME);
+            }
         }
-    }
     
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#getLayoutSizes()
@@ -201,7 +203,7 @@
     public String getLayoutSizes()
     {
         return (String)propertiesMap.get(SIZES_PROPERTY_NAME);
-    }
+            }
     
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.Fragment#setLayoutSizes(java.lang.String)
@@ -213,10 +215,10 @@
             propertiesMap.put(SIZES_PROPERTY_NAME, sizes);
         }
         else
-        {
+            {
             propertiesMap.remove(SIZES_PROPERTY_NAME);
+            }
         }
-    }
     
     public Object clone() throws java.lang.CloneNotSupportedException
     {
@@ -298,7 +300,17 @@
 
     }
 
-    /**
+    public List getPreferences()
+    {
+        return preferences;
+    }
+
+    public void setPreferences(List preferences)
+    {
+        this.preferences = preferences;  
+    } 
+    
+        /**
      * unmarshalled - notification that this instance has been
      *                loaded from the persistent store
      */
@@ -368,4 +380,4 @@
         // notify super class implementation
         super.marshalling();
     }
-}
+}
\ No newline at end of file

Added: portals/jetspeed-2/trunk/components/page-manager/src/test/fragment-test.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/fragment-test.xml?rev=330589&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/fragment-test.xml (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/fragment-test.xml Thu Nov  3 09:39:17 2005
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fragment id="test" type="portlet" name="demo::BookmarkPortlet">
+    <property name="row" value="2" layout="TwoColumns"/>
+    <property name="column" value="1" layout="TwoColumns"/>
+    <preference name="Google" readOnly="false">
+       <value>http://www.google.com</value>
+    </preference>
+</fragment>
\ No newline at end of file

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/test/fragment-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestMappings.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestMappings.java?rev=330589&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestMappings.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestMappings.java Thu Nov  3 09:39:17 2005
@@ -0,0 +1,40 @@
+package org.apache.jetspeed.page;
+
+import java.util.Iterator;
+
+import junit.framework.TestCase;
+
+import org.apache.jetspeed.om.page.Fragment;
+import org.apache.pluto.om.common.Preference;
+import org.exolab.castor.mapping.Mapping;
+import org.exolab.castor.xml.Unmarshaller;
+import org.xml.sax.InputSource;
+
+public class TestMappings extends TestCase
+{
+
+    public void testFragmentMapping() throws Exception
+    {
+        Mapping mapping = new Mapping();
+
+        // 1. Load the mapping information from the file
+        mapping.loadMapping(new InputSource(getClass().getClassLoader().getResourceAsStream(
+                "JETSPEED-INF/castor/page-mapping.xml")));
+
+        // 2. Unmarshal the data
+        Unmarshaller unmar = new Unmarshaller(mapping);
+        Fragment fragment = (Fragment) unmar.unmarshal(new InputSource(getClass().getClassLoader().getResourceAsStream(
+                "fragment-test.xml")));
+        
+        assertNotNull(fragment);
+        assertEquals(1, fragment.getPreferences().size());
+        Preference pref = (Preference) fragment.getPreferences().get(0);
+        
+        assertEquals("Google", pref.getName());
+        assertEquals(false, pref.isReadOnly());
+        Iterator itr = pref.getValues();
+        String value = (String )itr.next();
+        assertEquals("http://www.google.com", value );
+
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestMappings.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorFragmentImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorFragmentImpl.java?rev=330589&r1=330588&r2=330589&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorFragmentImpl.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletAggregatorFragmentImpl.java Thu Nov  3 09:39:17 2005
@@ -302,5 +302,11 @@
     public Object clone() throws CloneNotSupportedException
     {
         return null;
+    }
+
+    public List getPreferences()
+    {
+        // TODO Auto-generated method stub
+        return null;
     }    
 }

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java?rev=330589&r1=330588&r2=330589&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java Thu Nov  3 09:39:17 2005
@@ -32,6 +32,7 @@
 import org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException;
 import org.apache.jetspeed.container.window.FailedToRetrievePortletWindow;
 import org.apache.jetspeed.container.window.PortletWindowAccessor;
+import org.apache.jetspeed.om.common.portlet.MutablePortletEntity;
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.util.JetspeedObjectID;
@@ -217,7 +218,7 @@
                         + fragment.getId() + ", " + fragment.getName());
             }
             PortletEntity portletEntity = portletWindow.getPortletEntity();
-
+            ((MutablePortletEntity)portletEntity).setFragment(fragment);
             return portletWindow;
 
     }

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java?rev=330589&r1=330588&r2=330589&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJobImpl.java Thu Nov  3 09:39:17 2005
@@ -24,6 +24,7 @@
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.aggregator.PortletContent;
 import org.apache.jetspeed.aggregator.RenderingJob;
+import org.apache.jetspeed.om.common.portlet.MutablePortletEntity;
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.request.RequestContext;
 import org.apache.pluto.PortletContainer;
@@ -62,7 +63,8 @@
         this.response = response;
         this.requestContext = requestContext; 
         this.window = window;
-        this.portletContent = portletContent;     
+        this.portletContent = portletContent; 
+        ((MutablePortletEntity)window.getPortletEntity()).setFragment(fragment);
         
     }
 

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java?rev=330589&r1=330588&r2=330589&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java Thu Nov  3 09:39:17 2005
@@ -24,6 +24,9 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.om.common.portlet.MutablePortletEntity;
+import org.apache.jetspeed.om.page.Fragment;
+import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.pipeline.PipelineException;
 import org.apache.jetspeed.pipeline.valve.AbstractValve;
 import org.apache.jetspeed.pipeline.valve.ActionValve;
@@ -69,6 +72,7 @@
             PortletWindow actionWindow = request.getActionWindow();
             if (actionWindow != null)
             {
+                initWindow(actionWindow, request);
                 HttpServletResponse response = request.getResponseForWindow(actionWindow);
                 HttpServletRequest requestForWindow = request.getRequestForWindow(actionWindow);
                 requestForWindow.setAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE, request);
@@ -127,6 +131,19 @@
     {
         // TODO Auto-generated method stub
         return "ActionValveImpl";
+    }
+    
+    /**
+     * Makes sure that this PortletWindow's PortletEntity is set to have the
+     * current requests fragment.
+     * @param window
+     * @param request
+     */
+    protected void initWindow(PortletWindow window, RequestContext request)
+    {
+        Page page = request.getPage();
+        Fragment fragment = page.getFragmentById(window.getId().toString());
+        ((MutablePortletEntity)window.getPortletEntity()).setFragment(fragment);
     }
 
 }

Modified: portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java?rev=330589&r1=330588&r2=330589&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java (original)
+++ portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java Thu Nov  3 09:39:17 2005
@@ -38,6 +38,7 @@
 import org.apache.jetspeed.om.common.portlet.PrincipalAware;
 import org.apache.jetspeed.om.common.preference.PreferenceSetComposite;
 import org.apache.jetspeed.om.page.Fragment;
+import org.apache.jetspeed.om.portlet.impl.FragmentPortletDefinition;
 import org.apache.jetspeed.om.preference.impl.PrefsPreference;
 import org.apache.jetspeed.om.preference.impl.PrefsPreferenceSetImpl;
 import org.apache.jetspeed.om.window.impl.PortletWindowListImpl;
@@ -99,7 +100,7 @@
     
     public PortletEntityImpl(Fragment fragment)
     {
-        this.fragment = fragment;
+        setFragment(fragment);
     }
 
     public PortletEntityImpl()
@@ -212,8 +213,10 @@
         if(this.portletDefinition == null)
         {
             setPortletDefinition(registry.getPortletDefinitionByIdentifier(getPortletUniqueName()));
-        }
-        return this.portletDefinition;
+        }        
+        
+        // Wrap the portlet defintion every request
+        return new FragmentPortletDefinition(this.portletDefinition, fragment);
     }
 
     public PortletApplicationEntity getPortletApplicationEntity()

Added: portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/FragmentPortletDefinition.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/FragmentPortletDefinition.java?rev=330589&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/FragmentPortletDefinition.java (added)
+++ portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/FragmentPortletDefinition.java Thu Nov  3 09:39:17 2005
@@ -0,0 +1,341 @@
+/*
+ * Copyright 2000-2001,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.om.portlet.impl;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Locale;
+
+import org.apache.jetspeed.om.common.GenericMetadata;
+import org.apache.jetspeed.om.common.ParameterComposite;
+import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
+import org.apache.jetspeed.om.common.preference.PreferenceComposite;
+import org.apache.jetspeed.om.common.preference.PreferenceSetComposite;
+import org.apache.jetspeed.om.page.Fragment;
+import org.apache.jetspeed.om.preference.impl.FragmentPortletPreferenceSet;
+import org.apache.pluto.om.common.Description;
+import org.apache.pluto.om.common.DescriptionSet;
+import org.apache.pluto.om.common.DisplayName;
+import org.apache.pluto.om.common.DisplayNameSet;
+import org.apache.pluto.om.common.Language;
+import org.apache.pluto.om.common.LanguageSet;
+import org.apache.pluto.om.common.ObjectID;
+import org.apache.pluto.om.common.ParameterSet;
+import org.apache.pluto.om.common.Preference;
+import org.apache.pluto.om.common.PreferenceSet;
+import org.apache.pluto.om.common.SecurityRoleRef;
+import org.apache.pluto.om.common.SecurityRoleRefSet;
+import org.apache.pluto.om.portlet.ContentType;
+import org.apache.pluto.om.portlet.ContentTypeSet;
+import org.apache.pluto.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.om.servlet.ServletDefinition;
+
+/**
+ * Per-request wrapper for a PortletDefinition that allows for
+ * the supplementaton of psml-based portlet Preferences. 
+ * The Preferences are transparently accessed as default Preferences in
+ * the exact same way default Preferences that are provided via the portelt.xml
+ * are. 
+ * 
+ * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
+ *
+ */
+public class FragmentPortletDefinition implements PortletDefinitionComposite
+{
+    private final PortletDefinitionComposite portletDefinition;
+    private final Fragment fragment;
+    
+    public FragmentPortletDefinition(PortletDefinitionComposite portletDefinition, Fragment fragment)
+    {
+        this.portletDefinition = portletDefinition;
+        this.fragment = fragment;
+    }
+
+    public void addContentType(ContentType cType)
+    {
+        portletDefinition.addContentType(cType);
+    }
+
+    public void addContentType(String contentType, Collection modes)
+    {
+        portletDefinition.addContentType(contentType, modes);
+    }
+
+    public void addDescription(Locale locale, String description)
+    {
+        portletDefinition.addDescription(locale, description);
+    }
+
+    public void addDisplayName(DisplayName displayName)
+    {
+        portletDefinition.addDisplayName(displayName);
+    }
+
+    public void addDisplayName(Locale locale, String displayName)
+    {
+        portletDefinition.addDisplayName(locale, displayName);
+    }
+
+    public ParameterComposite addInitParameter(String name, String value, DescriptionSet description)
+    {
+        return portletDefinition.addInitParameter(name, value, description);
+    }
+
+    public ParameterComposite addInitParameter(String name, String value, String description, Locale locale)
+    {
+        return portletDefinition.addInitParameter(name, value, description, locale);
+    }
+
+    public ParameterComposite addInitParameter(String name, String value)
+    {
+        return portletDefinition.addInitParameter(name, value);
+    }
+
+    public void addLanguage(Language lang)
+    {
+        portletDefinition.addLanguage(lang);
+    }
+
+    public void addLanguage(String title, String shortTitle, String keywords, Locale locale)
+    {
+        portletDefinition.addLanguage(title, shortTitle, keywords, locale);
+    }
+
+    public void addPreference(Preference preference)
+    {
+        portletDefinition.addPreference(preference);
+    }
+
+    public PreferenceComposite addPreference(String name, String[] values)
+    {
+        return portletDefinition.addPreference(name, values);
+    }
+
+    public void addSecurityRoleRef(SecurityRoleRef securityRef)
+    {
+        portletDefinition.addSecurityRoleRef(securityRef);
+    }
+
+    public SecurityRoleRef addSecurityRoleRef(String roleName, String roleLink)
+    {
+        return portletDefinition.addSecurityRoleRef(roleName, roleLink);
+    }
+
+    public String getClassName()
+    {
+        return portletDefinition.getClassName();
+    }
+
+    public ContentTypeSet getContentTypeSet()
+    {
+        return portletDefinition.getContentTypeSet();
+    }
+
+    public Description getDescription(Locale arg0)
+    {
+        return portletDefinition.getDescription(arg0);
+    }
+
+    public DescriptionSet getDescriptionSet()
+    {
+        return portletDefinition.getDescriptionSet();
+    }
+
+    public String getDescriptionText(Locale locale)
+    {
+        return portletDefinition.getDescriptionText(locale);
+    }
+
+    public DisplayName getDisplayName(Locale arg0)
+    {
+        return portletDefinition.getDisplayName(arg0);
+    }
+
+    public DisplayNameSet getDisplayNameSet()
+    {
+        return portletDefinition.getDisplayNameSet();
+    }
+
+    public String getDisplayNameText(Locale locale)
+    {
+        return portletDefinition.getDisplayNameText(locale);
+    }
+
+    public String getExpirationCache()
+    {
+        return portletDefinition.getExpirationCache();
+    }
+
+    public ObjectID getId()
+    {
+        return portletDefinition.getId();
+    }
+
+    public ParameterSet getInitParameterSet()
+    {
+        return portletDefinition.getInitParameterSet();
+    }
+
+    public SecurityRoleRefSet getInitSecurityRoleRefSet()
+    {
+        return portletDefinition.getInitSecurityRoleRefSet();
+    }
+
+    public LanguageSet getLanguageSet()
+    {
+        return portletDefinition.getLanguageSet();
+    }
+
+    public GenericMetadata getMetadata()
+    {
+        return portletDefinition.getMetadata();
+    }
+
+    public String getName()
+    {
+        return portletDefinition.getName();
+    }
+
+    public PortletApplicationDefinition getPortletApplicationDefinition()
+    {
+        return portletDefinition.getPortletApplicationDefinition();
+    }
+
+    public ClassLoader getPortletClassLoader()
+    {
+        return portletDefinition.getPortletClassLoader();
+    }
+
+    public String getPortletIdentifier()
+    {
+        return portletDefinition.getPortletIdentifier();
+    }
+
+    public PreferenceSet getPreferenceSet()
+    {
+        return new FragmentPortletPreferenceSet((PreferenceSetComposite) portletDefinition.getPreferenceSet(), fragment);
+    }
+
+    public String getPreferenceValidatorClassname()
+    {
+        return portletDefinition.getPreferenceValidatorClassname();
+    }
+
+    public String getResourceBundle()
+    {
+        return portletDefinition.getResourceBundle();
+    }
+
+    public ServletDefinition getServletDefinition()
+    {
+        return portletDefinition.getServletDefinition();
+    }
+
+    public Collection getSupportedLocales()
+    {
+        return portletDefinition.getSupportedLocales();
+    }
+
+    public String getUniqueName()
+    {
+        return portletDefinition.getUniqueName();
+    }
+
+    public void setClassName(String arg0)
+    {
+        portletDefinition.setClassName(arg0);
+    }
+
+    public void setContentTypeSet(ContentTypeSet contentTypes)
+    {
+        portletDefinition.setContentTypeSet(contentTypes);
+    }
+
+    public void setDescriptions(DescriptionSet arg0)
+    {
+        portletDefinition.setDescriptions(arg0);
+    }
+
+    public void setDisplayNames(DisplayNameSet arg0)
+    {
+        portletDefinition.setDisplayNames(arg0);
+    }
+
+    public void setExpirationCache(String cache)
+    {
+        portletDefinition.setExpirationCache(cache);
+    }
+
+    public void setId(String arg0)
+    {
+        portletDefinition.setId(arg0);
+    }
+
+    public void setInitParameterSet(ParameterSet parameters)
+    {
+        portletDefinition.setInitParameterSet(parameters);
+    }
+
+    public void setInitSecurityRoleRefSet(SecurityRoleRefSet securityRefs)
+    {
+        portletDefinition.setInitSecurityRoleRefSet(securityRefs);
+    }
+
+    public void setLanguageSet(LanguageSet languages)
+    {
+        portletDefinition.setLanguageSet(languages);
+    }
+
+    public void setMetadata(GenericMetadata metadata)
+    {
+        portletDefinition.setMetadata(metadata);
+    }
+
+    public void setName(String arg0)
+    {
+        portletDefinition.setName(arg0);
+    }
+
+    public void setPortletApplicationDefinition(PortletApplicationDefinition pad)
+    {
+        portletDefinition.setPortletApplicationDefinition(pad);
+    }
+
+    public void setPortletClassLoader(ClassLoader arg0)
+    {
+        portletDefinition.setPortletClassLoader(arg0);
+    }
+
+    public void setPortletIdentifier(String portletIndentifier)
+    {
+        portletDefinition.setPortletIdentifier(portletIndentifier);
+    }
+
+    public void setPreferenceSet(PreferenceSet preferences)
+    {
+        portletDefinition.setPreferenceSet(preferences);
+    }
+
+    public void setPreferenceValidatorClassname(String classname)
+    {
+        portletDefinition.setPreferenceValidatorClassname(classname);
+    }
+
+    public void store() throws IOException
+    {
+        portletDefinition.store();
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/FragmentPortletDefinition.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPortletPreferenceSet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPortletPreferenceSet.java?rev=330589&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPortletPreferenceSet.java (added)
+++ portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPortletPreferenceSet.java Thu Nov  3 09:39:17 2005
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2000-2001,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.om.preference.impl;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.portlet.PreferencesValidator;
+
+import org.apache.jetspeed.om.common.preference.PreferenceSetComposite;
+import org.apache.jetspeed.om.page.Fragment;
+import org.apache.pluto.om.common.Preference;
+
+/**
+ * This is a per-request wrapper for a PreferenceSet that allows 
+ * the use of fragment-specified Preferences within a portlet instance
+ * in a page.
+ * 
+ * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
+ *
+ */
+public class FragmentPortletPreferenceSet implements PreferenceSetComposite
+{
+    private final PreferenceSetComposite preferenceSet;
+    private final Fragment fragment;
+    private final Map prefs;
+    
+    public FragmentPortletPreferenceSet(PreferenceSetComposite preferenceSet, Fragment fragment)
+    {
+        this.preferenceSet = preferenceSet;
+        this.fragment = fragment;
+        this.prefs = new HashMap(fragment.getPreferences().size());
+        Iterator itr = fragment.getPreferences().iterator();
+        
+        while(itr.hasNext())
+        {
+            Preference pref = (Preference) itr.next();
+            prefs.put(pref.getName(), pref);
+        }
+        
+        
+        itr = preferenceSet.iterator();
+        while(itr.hasNext())
+        {
+            Preference pref = (Preference) itr.next();
+            prefs.put(pref.getName(), pref);
+        }        
+    }
+
+    public Preference add(String arg0, List arg1)
+    {        
+        Preference pref = preferenceSet.add(arg0, arg1);
+        prefs.put(arg0, pref);
+        return pref;
+    }
+
+    public Preference get(String name)
+    {
+        return (Preference) prefs.get(name);
+    }
+
+    public Set getNames()
+    {
+        return prefs.keySet();
+    }
+
+    public PreferencesValidator getPreferencesValidator()
+    {
+        return preferenceSet.getPreferencesValidator();
+    }
+
+    public Iterator iterator()
+    {
+        return prefs.values().iterator();
+    }
+
+    public void remove(Preference pref)
+    {
+        prefs.remove(pref.getName());
+        preferenceSet.remove(pref);
+    }
+
+    public Preference remove(String name)
+    {
+        Preference pref = (Preference) prefs.remove(name);
+        preferenceSet.remove(name);
+        return pref;
+    }
+
+    public void setPreferenceValidator(PreferencesValidator validator)
+    {
+        preferenceSet.setPreferenceValidator(validator);
+    }
+
+    public int size()
+    {
+        return prefs.size();
+    }
+}

Propchange: portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPortletPreferenceSet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPreference.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPreference.java?rev=330589&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPreference.java (added)
+++ portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPreference.java Thu Nov  3 09:39:17 2005
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2000-2001,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.jetspeed.om.preference.impl;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.pluto.om.common.Preference;
+import org.apache.pluto.om.common.PreferenceCtrl;
+
+/**
+ * 
+ * Castor-friendly Preference implementation to be used with Fragment-based
+ * portlet Preferences.
+ * 
+ * @author <href a="mailto:weaver@apache.org">Scott T. Weaver</a>
+ *
+ */
+public class FragmentPreference implements Preference, PreferenceCtrl
+{
+    private String name;
+    private List values;
+    private boolean readOnly;
+    
+    public String getName()
+    {
+        return name;
+    }
+    
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+    
+    public boolean isReadOnly()
+    {
+        return readOnly;
+    }
+    
+    public void setReadOnly(boolean readOnly)
+    {
+        this.readOnly = readOnly;
+    }
+    
+    public void setReadOnly(String arg0)
+    {
+        readOnly = new Boolean(arg0).booleanValue();        
+    }
+    
+    public Iterator getValues()
+    {
+        return getValueList().iterator();
+    }
+    
+    public List getValueList()
+    {
+        return this.values;
+    }
+    
+    public void setValues(List values)
+    {
+        this.values = values;
+    }
+    
+    public void setValueList(List values)
+    {
+        setValues(values);
+    }
+
+    public boolean isValueSet()
+    {
+        return values != null && values.size() > 0;
+    }
+
+
+}

Propchange: portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPreference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Fragment.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Fragment.java?rev=330589&r1=330588&r2=330589&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Fragment.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/Fragment.java Thu Nov  3 09:39:17 2005
@@ -163,7 +163,7 @@
     
     /**
      * getIntProperty
-     *
+     * 
      * Get named property value as integer.
      *
      * @param propName property name
@@ -173,7 +173,7 @@
     
     /**
      * getProperties
-     *
+     * 
      * Get writable Map of properties by name.
      *
      * @return properties map
@@ -186,14 +186,14 @@
      * @return row layout property
      **/
     public int getLayoutRow();
-    
+
     /**
      * set the layout row property
-     * 
+     *
      * @param row
      */
     public void setLayoutRow(int row);
-    
+
     /**
      * get layout column property
      *
@@ -210,11 +210,11 @@
     
     /**
      * get layout sizes property, (i.e. "25%,75%")
-     *
+     * 
      * @return sizes layout property
      **/
     public String getLayoutSizes();
-
+    
     /**
      * set the layout sizes
      * 
@@ -234,5 +234,11 @@
      */
     public Object clone()
         throws java.lang.CloneNotSupportedException;
+    
+    /**
+     * 
+     * @return
+     */
+    List getPreferences();
     
 }

Modified: portals/jetspeed-2/trunk/xdocs/psml.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/xdocs/psml.xml?rev=330589&r1=330588&r2=330589&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/xdocs/psml.xml (original)
+++ portals/jetspeed-2/trunk/xdocs/psml.xml Thu Nov  3 09:39:17 2005
@@ -25,11 +25,12 @@
   <body>
 <section name="PSML">
 <ul>
-	 <li><a href="#Page">Page</a></li>	      
-	 <li><a href="#Defaults">Defaults</a></li>	 
+     <li><a href="#Page">Page</a></li>          
+     <li><a href="#Defaults">Defaults</a></li>     
     <li><a href="#Title_and_Metadata">Title and Metadata</a></li>
     <li><a href="#Layout_Fragments">Layout Fragments</a></li>    
     <li><a href="#Portlet_Fragments">Portlet Fragments</a></li>    
+    <li><a href="#Preferences">Portlet Preferences</a></li>
     <li><a href="#PSML_Security_Constraints">Security Constraints</a></li>        
 </ul>
     
@@ -51,10 +52,10 @@
   />
   <title>Welcome to Jetspeed 2</title>
   <metadata name="title" xml:lang="fr">
-		Ma Premiere Page de PSML
+        Ma Premiere Page de PSML
   </metadata>
   <metadata name="title" xml:lang="ja">
-		Jetspeed 2 へようこそ
+        Jetspeed 2 へようこそ
   </metadata>
 
   <fragment id="dp-1" type="layout" name="jetspeed::VelocityTwoColumns">
@@ -221,6 +222,49 @@
 </table>
 <p>Example:</p>  
 <source><![CDATA[
+
+]]></source>
+</section>
+
+<section name='Preferences'>
+<p>
+    The &lt;preference&gt; elements allows for the defining of portlet preferences.  
+	This provides an eaiser avenue for the setting of default portlet prefences for a portlet
+    instance on a page without having to duplicate a portlet definition within
+    the portlet application's portlet.xml.
+	<br/><br/>
+	A fragment can contain 0..n &lt;preference&gt; elements.
+	<br/><br/>
+	Preference precedence: User Defined > Fragment Defined > portlet.xml Defined.
+</p>
+<table>
+    <tr>
+    <th>Attribute: name</th>
+    <th>Attribute: readOnly</th>
+    <th>Element: value</th>    
+    </tr>
+    <tr>
+    <td>The name of the preference.</td>
+    <td>Whether or not the user can change the value of this preference.</td>
+    <td>There can be 1..n <i>&lt;value&gt;</i> elements assigned to a single preference.</td>    
+    </tr>
+    <tr>
+    <td></td>
+    <td></td>
+    <td></td>    
+    </tr>
+</table>
+<p>Example:</p>  
+<source><![CDATA[
+
+    <fragment id="uhtemp-1012" type="portlet" name="demo::BookmarkPortlet">
+      <property layout="TwoColumns" name="row" value="2" />
+      <property layout="TwoColumns" name="column" value="1" />
+      <preference name="Google" readOnly="false">
+        <value>http://www.google.com</value>
+      </preference>
+    </fragment>
+
 ]]></source>
 </section>
 



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