You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by rw...@apache.org on 2009/11/18 19:24:53 UTC

svn commit: r881862 [15/16] - in /portals/jetspeed-2/portal/trunk: ./ applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/ applications/jetspeed/src/main/webapp/WEB-INF/templates/ applications/jetspeed/src/main/webapp/decorations/layout/greenearth/...

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentFragment.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentFragment.java?rev=881862&r1=881861&r2=881862&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentFragment.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentFragment.java Wed Nov 18 18:24:48 2009
@@ -17,39 +17,264 @@
 package org.apache.jetspeed.om.page;
 
 import java.util.List;
+import java.util.Map;
 
 import org.apache.jetspeed.aggregator.PortletContent;
 import org.apache.jetspeed.decoration.Decoration;
-
+import org.apache.jetspeed.layout.PageLayoutComponent;
 
 /**
- * 
- * ContentFragment provides a volatile wrapper interface for
- * actual {@link org.apache.jetspeed.om.page.Fragment} metadata
- * objects.  Since Fragments are cached and are not request specific
- * they cannot be used to store request-level content.  This is where
- * we use the <code>ContentFragment</code> to solve this problem.
+ * ContentFragment is a read-only version of the {@link org.apache.jetspeed.om.page.Fragment}
+ * object for use in rendering. <code>Fragment</code> objects are persistent, single-instance 
+ * metadata objects that should not be used to hold per-request content. ContentFragment
+ * solves this by providing a parallel interface that can be used for rendering
+ * requested content associated with the current user-request. 
  * 
  * @author weaver@apache.org
  *
  */
-public interface ContentFragment extends Fragment
+public interface ContentFragment
 {
+    /************** SecuredResource **************/
+
     /**
-     * Provides a list of of child ContentFragments that wrap
-     * the actual Fragment metadata objects.
-     * @return
+     * Check security access to fragment.
+     *
+     * @param actions list to be checked against in CSV string form
+     * @throws SecurityException
+     */
+    void checkAccess(String actions) throws SecurityException;
+    
+    /************** BaseElement **************/
+
+    /**
+     * Returns the unique Id of this element. This id is guaranteed to be unique
+     * from the complete portal and is suitable to be used as a unique key.
+     *
+     * @return the unique id of this element.
+     */
+    String getId();
+
+    /**
+     * Returns the title in the default Locale
+     *
+     * @return the page title
+     */
+    String getTitle();
+
+    /**
+     * Returns the short title in the default Locale
+     *
+     * @return the page short title
+     */
+    String getShortTitle();
+
+    /************** BaseFragmentElement **************/
+
+    /**
+     * row standard layout property name
+     */
+    String ROW_PROPERTY_NAME = BaseFragmentElement.ROW_PROPERTY_NAME;
+
+    /**
+     * column standard layout property name
+     */
+    String COLUMN_PROPERTY_NAME = BaseFragmentElement.COLUMN_PROPERTY_NAME;
+
+    /**
+     * sizes standard layout property name
+     */
+    String SIZES_PROPERTY_NAME = BaseFragmentElement.SIZES_PROPERTY_NAME;
+
+    /**
+     * x coordinate standard layout property name
+     */
+    String X_PROPERTY_NAME = BaseFragmentElement.X_PROPERTY_NAME;
+
+    /**
+     * y coordinate standard layout property name
+     */
+    String Y_PROPERTY_NAME = BaseFragmentElement.Y_PROPERTY_NAME;
+
+    /**
+     * z coordinate standard layout property name
+     */
+    String Z_PROPERTY_NAME = BaseFragmentElement.Z_PROPERTY_NAME;
+
+    /**
+     * width standard layout property name
+     */
+    String WIDTH_PROPERTY_NAME = BaseFragmentElement.WIDTH_PROPERTY_NAME;
+
+    /**
+     * height standard layout property name
+     */
+    String HEIGHT_PROPERTY_NAME = BaseFragmentElement.HEIGHT_PROPERTY_NAME;
+
+    /**
+     * Returns the name of the skin associated to this fragment
+     */
+    String getSkin();
+
+    /**
+     * Returns the name of the decorator bound to this fragment
+     */
+    String getDecorator();
+
+    /**
+     * Returns the display state of this fragment. The state may have the
+     * following values: "Normal","Minimized","Maximized","Hidden"
+     */
+    String getState();
+
+    /**
+     * Returns the display mode of this fragment. The mode may have the
+     * following values: "View","Edit","Help","Config","Print","Custom"
+     */
+    String getMode();
+
+    /**
+     * getProperty
+     *
+     * Get named property value.
+     *
+     * @param propName property name
+     * @return value
+     */
+    String getProperty(String propName);
+    
+    /**
+     * getIntProperty
+     * 
+     * Get named property value as integer.
+     *
+     * @param propName property name
+     * @return int value
+     */
+    int getIntProperty(String propName);
+    
+    /**
+     * getFloatProperty
+     * 
+     * Get named property value as float.
+     *
+     * @param propName property name
+     * @return float value
+     */
+    float getFloatProperty(String propName);
+    
+    /**
+     * getProperties
+     * 
+     * Get writable Map of properties by name.
+     *
+     * @return properties map
+     */
+    Map getProperties();
+
+    /**
+     * get layout row property
+     *
+     * @return row layout property
+     **/
+    int getLayoutRow();
+
+    /**
+     * get layout column property
+     *
+     * @return column layout property
+     **/
+    int getLayoutColumn();
+
+    /**
+     * get layout sizes property, (i.e. "25%,75%")
+     * 
+     * @return sizes layout property
+     **/
+    String getLayoutSizes();
+    
+    /**
+     * get layout x coordinate property
+     *
+     * @return the x coordinate value
+     **/
+    float getLayoutX();
+
+    /**
+     * get layout y coordinate property
+     *
+     * @return the y coordinate value
+     **/
+    float getLayoutY();
+
+    /**
+     * get layout z coordinate property
+     *
+     * @return the z coordinate value
+     **/
+    float getLayoutZ();
+
+    /**
+     * get layout width property
+     *
+     * @return the width value
+     **/
+    float getLayoutWidth();
+
+    /**
+     * get layout height property
+     *
+     * @return the height value
+     **/
+    float getLayoutHeight();
+
+    /**
+     * Get collection of fragment preference objects used
+     * to initialize user preferences
+     * 
+     * @return list of FragmentPreference objects
      */
-   List getContentFragments();
+    List getPreferences();    
+    
+    /************** Fragment **************/
+    
+    /**
+     * A fragment of type PORTLET is considered to be a compliant portlet
+     * in the sense of the JSR 168.
+     */
+    String PORTLET = Fragment.PORTLET;
 
-    /**     
-     * Overridden to make it clear to the implemetor the {@link List}
-     * returned <strong>MUST</strong> ContentFragments and not
-     * just regular {@link org.apache.jetspeed.om.page.Fragment}s
+    /**
+     * A fragment of type LAYOUT is a specific JSR 168 compliant portlet
+     * that knows how to layout a Page and depends on the Jetspeed
+     * layout service.
+     */
+    String LAYOUT = Fragment.LAYOUT;
+    
+    /**
+     * Returns the administrative name of this fragment. This name should map
+     * to a component name in the component repository defined by the type
+     * attribute.
+     * If the name is not mapped to any component, the fragment is discarded
+     * from the rendering process, as well as any inner fragment.
      *
-     * @return a collection containing ContentFragment objects
+     * @return the administrative name
+     */
+    String getName();
+
+    /**
+     * Returns the type of the class bound to this fragment
+     */
+    String getType();
+
+    /**
+     * Provides a list of of child ContentFragment objects.
+     * 
+     * @return ContentFragment list
      */
-    public List getFragments();
+    List getFragments();
+    
+    /************** ContentFragment **************/
 
     /**
      * 
@@ -65,7 +290,7 @@
      * @return The raw,undecorated content of this fragment.
      * @throws java.lang.IllegalStateException if the content has not yet been set.
      */
-    public String getRenderedContent() throws IllegalStateException;
+    String getRenderedContent() throws IllegalStateException;
 
     /**
      * 
@@ -79,12 +304,13 @@
      *
      * @param contnent
      */
-    public void overrideRenderedContent(String contnent);
+    void overrideRenderedContent(String contnent);
 
     /**
      * @return the overridden content set by overrideRenderedContent
      */
-    public String getOverriddenContent();
+    String getOverriddenContent();
+    
     /**
      * 
      * <p>
@@ -93,14 +319,14 @@
      *
      * @param portletContent
      */
-    public void setPortletContent(PortletContent portletContent);
+    void setPortletContent(PortletContent portletContent);
 
     /**
      * Retrieve the content for this fragment
      * 
      * @return PortletContent
      */
-    public PortletContent getPortletContent();
+    PortletContent getPortletContent();
     
     /**
      * Retrieves the actual <code>org.apache.jetspeed.decoration.decorator</code>
@@ -121,6 +347,86 @@
     /**
      * Checks if the content is instantly rendered from JPT.
      */
-    public boolean isInstantlyRendered();
+    boolean isInstantlyRendered();
+
+    /**
+     * Returns the PageLayoutComponent that generated this ContentPage
+     * 
+     * @return PageLayoutComponent instance.
+     */
+    PageLayoutComponent getPageLayoutComponent();
+    
+    /************** PageLayoutComponent Operations **************/
 
+    /**
+     * Add portlet to fragment with specified row and column returning
+     * associated content fragment.
+     * 
+     * @param type portlet type
+     * @param name portlet name
+     * @param row fragment row position
+     * @param column fragment column position
+     * @return new content fragment added to fragment
+     */
+    ContentFragment addPortlet(String type, String name, int row, int column);
+    
+    /**
+     * Add portlet to fragment returning associated content fragment.
+     * 
+     * @param type portlet type
+     * @param name portlet name
+     * @return new content fragment added to fragment
+     */
+    ContentFragment addPortlet(String type, String name);
+    
+    /**
+     * Update fragment portlet decorator.
+     *  
+     * @param decoratorName portlet decorator name
+     */
+    void updateDecorator(String decoratorName);
+    
+    /**
+     * Update fragment name.
+     * 
+     * @param name fragment name
+     */
+    void updateName(String name);
+
+    /**
+     * Update fragment layout position.
+     * 
+     * @param x fragment X coordinate or -1
+     * @param y fragment Y coordinate or -1
+     * @param z fragment Z level or -1
+     * @param width fragment portlet width or -1
+     * @param height fragment portlet height or -1
+     */
+    void updatePosition(float x, float y, float z, float width, float height);
+    
+    /**
+     * Update preferences with new preferences set, accepting
+     * Map of strings, string arrays, FragmentPreference or
+     * PortletPreference. Existing preferences are removed and
+     * replaced with the specified preferences.
+     * 
+     * @param preferences map of new preferences set.
+     */
+    void updatePreferences(Map preferences);
+
+    /**
+     * Update fragment row and column layout position.
+     * 
+     * @param row fragment row position
+     * @param column fragment column position
+     */
+    void updateRowColumn(int row, int column);
+    
+    /**
+     * Update fragment portlet state and/or mode.
+     * 
+     * @param portletState fragment portlet state or null
+     * @param portletMode fragment portlet mode or null
+     */
+    void updateStateMode(String portletState, String portletMode);
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentPage.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentPage.java?rev=881862&r1=881861&r2=881862&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentPage.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentPage.java Wed Nov 18 18:24:48 2009
@@ -17,82 +17,323 @@
 package org.apache.jetspeed.om.page;
 
 import java.util.List;
+import java.util.Locale;
+
+import org.apache.jetspeed.layout.PageLayoutComponent;
+import org.apache.jetspeed.om.portlet.GenericMetadata;
 
 /**
- * PageFragment is a volatile wrapper around a 
- * {@link org.apache.jetspeed.om.page.Page} metadata
- * object for use in rendering.  As with 
- * the {@link org.apache.jetspeed.om.page.Fragment} object,
- * <code>Page</code> objects are persistent, single-instance 
- * metadata objects that should not be used to hold per-request
- * content.  ContentPage solves this by providing a thin, wrapper
- * interface that can be used for rendering requested content associated
- * with the wrapped page relative to the currect user-request. 
+ * ContentPage is a read-only version of the {@link org.apache.jetspeed.om.page.Page}
+ * object for use in rendering. <code>Page</code> objects are persistent, single-instance 
+ * metadata objects that should not be used to hold per-request content. ContentPage
+ * solves this by providing a parallel interface that can be used for rendering
+ * requested content associated with the current user-request. 
  * 
  * @author weaver@apache.org
  *
  */
-public interface ContentPage extends Page
+public interface ContentPage
 {
-  /**
-   * Provides access to a per-request safe ContentFragment.
-   * ContentFragments add the additional ability to temporarily
-   * store rendered content of the current request along with
-   * original, persistent metadata of the Fragment itself.
-   * 
-   * @return ContentFragment wrapping the actual root Fragment.
-   */
-  ContentFragment getRootContentFragment();
-  
-  void setRootContentFragment(ContentFragment frag);
-
-  /**
-   * Returns a ContentFragment that wraps the actual
-   * Fragment metadata represented by the id argument.
-   * @param id unique id of the Fragment we want to retrieve.
-   * @return
-   */
-  ContentFragment getContentFragmentById(String id);
-
-
-
-  /**
-   * Returns a list of ContentFragment that wrap the actual
-   * Fragment metadata represented by the name argument.
-   * @param name name of the Fragments we want to retrieve.
-   * @return
-   */
-  List getContentFragmentsByName(String name);
-
-
-
-/**
- * Overridden to to indicate that the {@link Fragment} returned
- * must also be an instance of ContentFragment.
- *
- * @param id the fragment id to look for
- * @return the found ContentFragment object or null if not found
- */
- Fragment getFragmentById(String id);
+    /************** SecuredResource **************/
 
-
-
-/**
- * Overridden to to indicate that the list of {@link Fragment}
- * instances returned must also be instances of ContentFragment.
- *
- * @param name the fragments name to look for
- * @return the list of found ContentFragment object or null if not found
- */
- List getFragmentsByName(String name);
-
-
-
-/**
- * Overridden to to indicate that the {@link Fragment} returned
- * must also be an instance of ContentFragment.
- *
- * @return the base Fragment object for this page.
- */    
- Fragment getRootFragment();
+    /**
+     * Check security access to page.
+     *
+     * @param actions list to be checked against in CSV string form
+     * @throws SecurityException
+     */
+    void checkAccess(String actions) throws SecurityException;
+    
+    /************** BaseElement **************/
+    
+    /**
+     * Returns the unique Id of this element. This id is guaranteed to be unique
+     * from the complete portal and is suitable to be used as a unique key.
+     *
+     * @return the unique id of this element.
+     */
+    String getId();
+
+    /**
+     * Returns the title in the default Locale
+     *
+     * @return the page title
+     */
+    String getTitle();
+
+    /**
+     * Returns the short title in the default Locale
+     *
+     * @return the page short title
+     */
+    String getShortTitle();
+    
+    /************** Node **************/
+    
+    /**
+     * Return page metadata.
+     *
+     * @return page metadata
+     */
+    GenericMetadata getMetadata();
+
+    /**
+     * Returns the name of this page.
+     *
+     * @return page name
+     */
+    String getName();
+    
+    /**
+     * Returns the path of this page.
+     * 
+     * @return page path
+     */
+    String getPath();
+
+    /**
+     * Returns the short title for the specified locale.
+     *
+     * @param locale
+     * @return localized title of this Node.
+     */
+    String getShortTitle(Locale locale);
+    
+    /**
+     * Returns the title for the specified locale.
+     *
+     * @param locale
+     * @return localized title of this Node.
+     */
+    String getTitle(Locale locale);
+
+    /**
+     * Returns URL of page.
+     * 
+     * @return page URL
+     */
+    String getUrl();
+    
+    /**
+     * Whether or not this Node should be hidden in terms of the view.
+     *   
+     * @return hidden flag
+     */
+    boolean isHidden();
+
+    /************** BasePageElement **************/
+
+    /**
+     * Returns the name of the default skin that applies to this
+     * page.
+     *
+     * @return the page default skin name
+     */
+    String getSkin();
+
+    /**
+     * Returns the name of the default decorator that applies in this page
+     * to fragments of the specified type
+     *
+     * @param fragmentType the type of fragment considered
+     * @return the decorator name for the selected type
+     */
+    String getDefaultDecorator(String fragmentType);
+
+    /**
+     * Provides access to a per-request safe ContentFragment.
+     * ContentFragments add the additional ability to temporarily
+     * store rendered content of the current request along with
+     * original.
+     * 
+     * @return root ContentFragment fragment.
+     */
+    ContentFragment getRootFragment();
+
+    /**
+     * Returns a ContentFragment represented by the fragment id argument.
+     * @param id unique id of the ContentFragment we want to retrieve.
+     * @return
+     */
+    ContentFragment getFragmentById(String id);
+
+    /**
+     * Returns a list of ContentFragment fragments represented by the name argument.
+     * @param name name of the ContentFragments we want to retrieve.
+     * @return list of ContentFragment
+     */
+    List getFragmentsByName(String name);
+    
+    /************** BaseConcretePageElement **************/
+
+    /**
+     * Returns the name of the default decorator as set here or
+     * in parent folders that applies in this page to fragments
+     * of the specified type.
+     *
+     * @param fragmentType the type of fragment considered
+     * @return the decorator name for the selected type
+     */
+    String getEffectiveDefaultDecorator(String fragmentType);
+
+    /************** ContentPage **************/
+
+    /**
+     * Access underlying concrete persistent page or null
+     * if page is transient or constructed dynamically.
+     * 
+     * @return persistent page or null
+     */
+    Page getPage();
+    
+    /**
+     * Returns the PageLayoutComponent that generated this ContentPage
+     * 
+     * @return PageLayoutComponent instance.
+     */
+    PageLayoutComponent getPageLayoutComponent();
+
+    /**
+     * Override page default decorator.
+     *  
+     * @param decoratorName decorator name
+     * @param fragmentType decorator fragment type
+     */
+    void overrideDefaultDecorator(String decoratorName, String fragmentType);
+    
+    /************** PageLayoutComponent Operations **************/
+
+    /**
+     * Add fragment to page at specified row column layout position.
+     * 
+     * @param fragment externally constructed fragment to add
+     * @param row fragment row position
+     * @param column fragment column position
+     */
+    ContentFragment addFragmentAtRowColumn(ContentFragment fragment, int row, int column);                        
+    
+    /**
+     * Add portlet to page returning associated content fragment.
+     * 
+     * @param type portlet type
+     * @param name portlet name
+     * @return new content fragment added to page
+     */
+    ContentFragment addPortlet(String type, String name);
+
+    /**
+     * Decrement position of folder in parent folder document order.
+     */
+    void decrementFolderInDocumentOrder();
+
+    /**
+     * Decrement position of page in folder document order.
+     */
+    void decrementInDocumentOrder();
+
+    /**
+     * Compute fragment nesting level of fragment by id. Fragment
+     * level returned is 0 if root fragment, 1 if in root fragment
+     * collection, etc. 
+     * 
+     * @param fragmentId target fragment id
+     * @return fragment nesting level or -1 if not found
+     */
+    int getFragmentNestingLevel(String fragmentId);
+    
+    /**
+     * Increment position of folder in parent folder document order.
+     */
+    void incrementFolderInDocumentOrder();
+
+    /**
+     * Increment position of page in folder document order.
+     */
+    void incrementInDocumentOrder();
+    
+    /**
+     * Move fragment from current parent layout fragment to another
+     * layout fragment in the same page.
+     *
+     * @param fragmentId fragment id of fragment to move
+     * @param fromFragmentId fragment id of current parent layout fragment
+     * @param toFragmentId fragment id of new parent layout fragment
+     */
+    void moveFragment(String fragmentId, String fromFragmentId, String toFragmentId);
+
+    /**
+     * Create a new sibling folder with specified configuration and
+     * new default page. Also, adds folder to end of page folder
+     * document order list. The default page is added to the new
+     * folder document order list. Both title and short title
+     * parameters default to page name if not specified. The layout
+     * fragment name for the default page is cloned from this content
+     * page if not specified. Default decorators are cloned from this
+     * content page.
+     *  
+     * @param folderName unique new folder name, (also used as
+     *                   default page title)
+     * @param folderTitle new folder title or null
+     * @param folderShortTitle new folder short title or null
+     * @param defaultPageLayoutName root level layout fragment name
+     *                              for default page
+     */
+    void newSiblingFolder(String folderName, String folderTitle, String folderShortTitle, String defaultPageLayoutName);
+    
+    /**
+     * Create new sibling page with specified configuration and add
+     * new page at end of folder document order list. Both title and
+     * short title parameters default to page name if not specified.
+     * The layout fragment name is cloned from this content page if
+     * not specified. Default decorators are cloned from this content
+     * page.
+     * 
+     * @param pageName unique new page name
+     * @param layoutName root level layout fragment name or null 
+     * @param pageTitle new page title or null
+     * @param pageShortTitle new page short title or null
+     */
+    void newSiblingPage(String pageName, String layoutName, String pageTitle, String pageShortTitle);
+    
+    /**
+     * Remove fragment from page by id.
+     * 
+     * @param fragmentId id of fragment to remove
+     * @return flag indicating removed
+     */
+    void removeFragment(String fragmentId);
+    
+    /**
+     * Remove page and remove from folder document order list.
+     */
+    void remove();
+    
+    /**
+     * Remove folder and remove from parent folder document order list.
+     */
+    void removeFolder();
+    
+    /**
+     * Update page default decorator.
+     *  
+     * @param decoratorName decorator name
+     * @param fragmentType decorator fragment type
+     */
+    void updateDefaultDecorator(String decoratorName, String fragmentType);
+    
+    /**
+     * Update folder titles.
+     * 
+     * @param title folder title
+     * @param shortTitle folder short title
+     */
+    void updateFolderTitles(String title, String shortTitle);
+
+    /**
+     * Update page titles.
+     * 
+     * @param title page title
+     * @param shortTitle page short title
+     */
+    void updateTitles(String title, String shortTitle);
 }

Added: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/DynamicPage.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/DynamicPage.java?rev=881862&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/DynamicPage.java (added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/DynamicPage.java Wed Nov 18 18:24:48 2009
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.page;
+
+import java.io.Serializable;
+
+/**
+ * This interface represents a dynamic page document used by Jetspeed
+ * to define a user-customizable portal page.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public interface DynamicPage extends BaseConcretePageElement, Serializable
+{
+    String DOCUMENT_TYPE = ".dpsml";
+
+    /**
+     * Get the page type name that applies to this page.
+     *
+     * @return the page type name name
+     */
+    String getPageType();
+
+    /**
+     * Set the page type name for this page.
+     *
+     * @param pageType the name of the page type for the page
+     */
+    void setPageType(String pageType);
+}

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/Fragment.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/Fragment.java?rev=881862&r1=881861&r2=881862&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/Fragment.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/Fragment.java Wed Nov 18 18:24:48 2009
@@ -17,8 +17,8 @@
 
 package org.apache.jetspeed.om.page;
 
+import java.io.Serializable;
 import java.util.List;
-import java.util.Map;
 
 /**
  * <p>A <code>Fragment</code> is the basic element handled by the aggregation
@@ -28,7 +28,7 @@
  * is defined by two properties:<p>
  * <ul>
  *   <li><b>type</b>: defines the general class of layout component, enabling
- *       the engine to retrieve its exact defintion from its component
+ *       the engine to retrieve its exact definition from its component
  *       repository.
  *   </li>
  *   <li><b>name</b>: this is the exact name of the component. This name must
@@ -43,68 +43,20 @@
  *
  * @version $Id$
  */
-public interface Fragment extends BaseElement, java.io.Serializable
+public interface Fragment extends BaseFragmentElement, Serializable
 {
     /**
      * A fragment of type PORTLET is considered to be a compliant portlet
      * in the sense of the JSR 168.
      */
-     public String PORTLET = "portlet";
+    String PORTLET = "portlet";
 
     /**
      * A fragment of type LAYOUT is a specific JSR 168 compliant portlet
      * that knows how to layout a Page and depends on the Jetspeed
      * layout service.
      */
-     public String LAYOUT = "layout";
-
-    /**
-     * row standard layout property name
-     */
-     public String ROW_PROPERTY_NAME = "row";
-
-    /**
-     * column standard layout property name
-     */
-     public String COLUMN_PROPERTY_NAME = "column";
-
-    /**
-     * sizes standard layout property name
-     */
-     public String SIZES_PROPERTY_NAME = "sizes";
-
-    /**
-     * x coordinate standard layout property name
-     */
-     public String X_PROPERTY_NAME = "x";
-
-    /**
-     * y coordinate standard layout property name
-     */
-     public String Y_PROPERTY_NAME = "y";
-
-    /**
-     * z coordinate standard layout property name
-     */
-     public String Z_PROPERTY_NAME = "z";
-
-    /**
-     * width standard layout property name
-     */
-     public String WIDTH_PROPERTY_NAME = "width";
-
-    /**
-     * height standard layout property name
-     */
-     public String HEIGHT_PROPERTY_NAME = "height";
-
-    /**
-     * Sets the unique Id of this fragment. This id must be unique from the
-     * complete portal and must be suitable as a unique key.
-     *
-     * @param fragmentId the unique id of this fragment.
-     */
-    public void setId(String fragmentId);
+    String LAYOUT = "layout";
 
     /**
      * Returns the administrative name of this fragment. This name should map
@@ -115,259 +67,50 @@
      *
      * @return the administrative name
      */
-    public String getName();
+    String getName();
 
     /**
      * Binds an administrative name to this fragment
      *
      * @param name the administrative name
      */
-    public void setName(String name);
+    void setName(String name);
 
     /**
      * Returns the type of the class bound to this fragment
      */
-    public String getType();
+    String getType();
 
     /**
      * Binds a type to this fragment
      *
      * @param type the type
      */
-    public void setType(String type);
-
-    /**
-     * Returns the name of the skin associated to this fragment
-     */
-    public String getSkin();
-
-    /**
-     * Defines the skin for this fragment. This skin should be
-     * known by the portal.
-     *
-     * @param skinName the name of the new skin applied to this fragment
-     */
-    public void setSkin(String skinName);
-
-    /**
-     * Returns the name of the decorator bound to this fragment
-     */
-    public String getDecorator();
-
-    /**
-     * Defines the decorator for this fragment. This decorator should be
-     * known by the portal.
-     *
-     * @param decoratorName the name of the decorator applied to this fragment
-     */
-    public void setDecorator(String decoratorName);
-
-    /**
-     * Returns the display state of this fragment. The state may have the
-     * following values: "Normal","Minimized","Maximized","Hidden"
-     */
-    public String getState();
-
-    /**
-     * Sets the display state of this fragment.
-     * Valid states are: "Normal","Minimized","Maximized","Hidden"
-     *
-     * @param state the new fragment state
-     */
-    public void setState(String state);
-
-    /**
-     * Returns the display mode of this fragment. The mode may have the
-     * following values: "View","Edit","Help","Config","Print","Custom"
-     */
-    public String getMode();
-
-    /**
-     * Sets the display mode of this fragment.
-     * Valid modes are: "View","Edit","Help","Config","Print","Custom"
-     *
-     * @param mode the new fragment mode
-     */
-    public void setMode(String mode);
-
+    void setType(String type);
+    
     /**
      * Returns all fragments used in this node. This may be
      * a page fragment or even directly a portlet fragment
      *
-     * @return a collection containing Fragment objects
-     */
-    public List getFragments();
-
-    /**
-     * getProperty
-     *
-     * Get named property value.
-     *
-     * @param propName property name
-     * @return value
-     */
-    public String getProperty(String propName);
-    
-    /**
-     * getIntProperty
-     * 
-     * Get named property value as integer.
-     *
-     * @param propName property name
-     * @return int value
+     * @return a collection containing BaseFragmentElement objects
      */
-    public int getIntProperty(String propName);
+    List getFragments();
     
     /**
-     * getFloatProperty
-     * 
-     * Get named property value as float.
+     * Retrieves the fragment contained within this fragment, with the
+     * specified Id.
      *
-     * @param propName property name
-     * @return float value
+     * @param id the fragment id to look for
+     * @return the found Fragment object or null if not found
      */
-    public float getFloatProperty(String propName);
-    
-    /**
-     * getProperties
-     * 
-     * Get writable Map of properties by name.
-     *
-     * @return properties map
-     */
-    public Map getProperties();
-
-    /**
-     * get layout row property
-     *
-     * @return row layout property
-     **/
-    public int getLayoutRow();
+    BaseFragmentElement getFragmentById(String id);
 
     /**
-     * set the layout row property
+     * Removes the fragment contained within this fragment, with the
+     * specified Id.
      *
-     * @param row
-     */
-    public void setLayoutRow(int row);
-
-    /**
-     * get layout column property
-     *
-     * @return column layout property
-     **/
-    public int getLayoutColumn();
-
-    /**
-     * set the layout column property
-     * 
-     * @param column
-     */
-    public void setLayoutColumn(int column);
-    
-    /**
-     * get layout sizes property, (i.e. "25%,75%")
-     * 
-     * @return sizes layout property
-     **/
-    public String getLayoutSizes();
-    
-    /**
-     * set the layout sizes
-     * 
-     * @param sizes
-     */
-    public void setLayoutSizes(String sizes);
-    
-    /**
-     * get layout x coordinate property
-     *
-     * @return the x coordinate value
-     **/
-    public float getLayoutX();
-
-    /**
-     * set the layout x coordinate property
-     *
-     * @param x the coordinate value
-     */
-    public void setLayoutX(float x);
-
-    /**
-     * get layout y coordinate property
-     *
-     * @return the y coordinate value
-     **/
-    public float getLayoutY();
-
-    /**
-     * set the layout y coordinate property
-     *
-     * @param y the coordinate value
-     */
-    public void setLayoutY(float y);
-
-    /**
-     * get layout z coordinate property
-     *
-     * @return the z coordinate value
-     **/
-    public float getLayoutZ();
-
-    /**
-     * set the layout z coordinate property
-     *
-     * @param z the coordinate value
-     */
-    public void setLayoutZ(float z);
-
-    /**
-     * get layout width property
-     *
-     * @return the width value
-     **/
-    public float getLayoutWidth();
-
-    /**
-     * set the layout width property
-     *
-     * @param width the value
-     */
-    public void setLayoutWidth(float width);
-
-    /**
-     * get layout height property
-     *
-     * @return the height value
-     **/
-    public float getLayoutHeight();
-
-    /**
-     * set the layout height property
-     *
-     * @param height the value
-     */
-    public void setLayoutHeight(float height);
-
-    /**
-     * Test if this fragment is actually a reference to an external fragment.
-     *
-     * @return true is this element is a reference
-     */
-    public boolean isReference();
-
-    /**
-     * Get collection of fragment preference objects used
-     * to initialize user preferences
-     * 
-     * @return list of FragmentPreference objects
-     */
-    public List getPreferences();    
-
-    /**
-     * Set collection of fragment preference objects
-     * 
-     * @param preferences list of FragmentPreference objects
+     * @param id the fragment id to remove
+     * @return the removed Fragment object or null if not found
      */
-    public void setPreferences(List preferences);    
+    BaseFragmentElement removeFragmentById(String id);
 }

Added: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/FragmentDefinition.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/FragmentDefinition.java?rev=881862&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/FragmentDefinition.java (added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/FragmentDefinition.java Wed Nov 18 18:24:48 2009
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.page;
+
+/**
+ * This interface represents a document that defines a fragment
+ * hierarchy that can be referenced by other fragments.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public interface FragmentDefinition extends BaseFragmentsElement
+{
+    String DOCUMENT_TYPE = ".fpsml";
+
+    /**
+     * Returns the id of the defined root fragment element.
+     *
+     * @return the defined root fragment id.
+     */
+    String getDefId();
+}

Added: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/FragmentReference.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/FragmentReference.java?rev=881862&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/FragmentReference.java (added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/FragmentReference.java Wed Nov 18 18:24:48 2009
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.page;
+
+import java.io.Serializable;
+
+/**
+ * <p>A <code>FragmentReference</code> is a fragment element that represents
+ * a place holder for a referenced fragment in a Page. It also contains all
+ * base fragment information that can override/augment the target fragment
+ * configuration.</p>
+ *
+ * @version $Id:$
+ */
+public interface FragmentReference extends BaseFragmentElement, Serializable
+{
+    /**
+     * Returns the id of the referenced fragment element.
+     *
+     * @return the referenced fragment id.
+     */
+    String getRefId();
+
+    /**
+     * Sets the id of the referenced fragment element.
+     *
+     * @param refId the id of the referenced fragment element.
+     */
+    void setRefId(String refId);
+}

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/Link.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/Link.java?rev=881862&r1=881861&r2=881862&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/Link.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/Link.java Wed Nov 18 18:24:48 2009
@@ -16,8 +16,6 @@
  */
 package org.apache.jetspeed.om.page;
 
-
-
 /**
  * <p>
  * Link

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/Page.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/Page.java?rev=881862&r1=881861&r2=881862&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/Page.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/Page.java Wed Nov 18 18:24:48 2009
@@ -16,156 +16,16 @@
  */
 package org.apache.jetspeed.om.page;
 
-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;
+import java.io.Serializable;
 
 /**
  * This interface represents a complete page document used by Jetspeed
- * to layout a user-customizable portal page.
+ * to define a user-customizable portal page.
  *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
  * @version $Id$
  */
-public interface Page extends Document, java.io.Serializable
+public interface Page extends BaseConcretePageElement, Serializable
 {
     String DOCUMENT_TYPE = ".psml";
-    
-    /**
-     * Returns the name of the default skin that applies to this
-     * page.
-     *
-     * @return the page default skin name
-     */
-    String getSkin();
-
-    /**
-     * Modifies the skin for this page.
-     *
-     * @param skinName the name of the new skin for the page
-     */
-    void setSkin(String skinName);
-
-    /**
-     * Returns the name of the default decorator as set here or
-     * in parent folders that applies in this page to fragments
-     * of the specified type.
-     *
-     * @param fragmentType the type of fragment considered
-     * @return the decorator name for the selected type
-     */
-    String getEffectiveDefaultDecorator(String fragmentType);
-
-    /**
-     * Returns the name of the default decorator that applies in this page
-     * to fragments of the specified type
-     *
-     * @param fragmentType the type of fragment considered
-     * @return the decorator name for the selected type
-     */
-    String getDefaultDecorator(String fragmentType);
-
-    /**
-     * Modifies the default decorator for the specified fragment type.
-     *
-     * @param decoratorName the name of the new decorator for the type
-     * @param fragmentType the type of fragment considered
-     */
-    void setDefaultDecorator(String decoratorName, String fragmentType);
-
-    /**
-     * Retrieves the top level fragment of this page. This Fragment should
-     * never be null.
-     *
-     * @return the base Fragment object for this page.
-     */
-    Fragment getRootFragment();
-
-    /**
-     * Sets the top level fragment of this page. This Fragment should
-     * never be null.
-     *
-     * @return the base Fragment object for this page.
-     */    
-    void setRootFragment(Fragment fragment);
-
-    /**
-     * Retrieves the fragment contained within this page, with the
-     * specified Id.
-     *
-     * @param id the fragment id to look for
-     * @return the found Fragment object or null if not found
-     */
-    Fragment getFragmentById(String id);
-
-    /**
-     * Removes the fragment contained within this page, with the
-     * specified Id.
-     *
-     * @param id the fragment id to remove
-     * @return the removed Fragment object or null if not found
-     */
-    Fragment removeFragmentById(String id);
-
-    /**
-     * Retrieves the fragments contained within this page, with the
-     * specified name.
-     *
-     * @param name the fragment name to look for
-     * @return the list of found Fragment objects or null if not found
-     */
-    List getFragmentsByName(String name);
-
-    /**
-     * getMenuDefinitions - get list of menu definitions
-     *
-     * @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
-     *
-     * @param definitions definition list
-     */
-    void setMenuDefinitions(List definitions);    
 }
-

Added: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/PageFragment.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/PageFragment.java?rev=881862&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/PageFragment.java (added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/PageFragment.java Wed Nov 18 18:24:48 2009
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.page;
+
+import java.io.Serializable;
+
+/**
+ * <p>A <code>PageFragment</code> is a fragment element that represents
+ * a place holder for a root fragment of a page rendered with a page
+ * template. It also contains all base fragment information that can
+ * override/augment the target page root fragment configuration.</p>
+ *
+ * @version $Id:$
+ */
+public interface PageFragment extends BaseFragmentElement, Serializable
+{
+}

Added: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/PageTemplate.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/PageTemplate.java?rev=881862&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/PageTemplate.java (added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/PageTemplate.java Wed Nov 18 18:24:48 2009
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.page;
+
+import java.io.Serializable;
+
+/**
+ * This interface represents a page template document used by Jetspeed
+ * to define portal pages.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public interface PageTemplate extends BasePageElement, Serializable
+{
+    String DOCUMENT_TYPE = ".tpsml";
+}

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/GenericMetadata.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/GenericMetadata.java?rev=881862&r1=881861&r2=881862&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/GenericMetadata.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/GenericMetadata.java Wed Nov 18 18:24:48 2009
@@ -110,4 +110,13 @@
      * @param fields
      */
     public void copyFields( Collection<LocalizedField> fields );
+
+    /**
+     * Get localized text from metadata
+     * 
+     * @param name text name
+     * @param locale preferred locale
+     * @return localized text or null if not available
+     */
+    public String getText(String name, Locale locale);
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java?rev=881862&r1=881861&r2=881862&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java Wed Nov 18 18:24:48 2009
@@ -29,11 +29,16 @@
 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.ContentPage;
+import org.apache.jetspeed.om.page.BaseFragmentElement;
+import org.apache.jetspeed.om.page.DynamicPage;
 import org.apache.jetspeed.om.page.Fragment;
+import org.apache.jetspeed.om.page.FragmentDefinition;
+import org.apache.jetspeed.om.page.FragmentReference;
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
+import org.apache.jetspeed.om.page.PageFragment;
 import org.apache.jetspeed.om.page.PageSecurity;
+import org.apache.jetspeed.om.page.PageTemplate;
 import org.apache.jetspeed.om.page.SecurityConstraintsDef;
 import org.apache.jetspeed.om.preference.FragmentPreference;
 import org.apache.jetspeed.page.document.DocumentException;
@@ -90,6 +95,27 @@
     public Page newPage(String path);
 
     /**
+     * Creates a new empty PageTemplate instance
+     *
+     * @return a newly created PageTemplate object
+     */
+    public PageTemplate newPageTemplate(String path);
+
+    /**
+     * Creates a new empty DynamicPage instance
+     *
+     * @return a newly created DynamicPage object
+     */
+    public DynamicPage newDynamicPage(String path);
+
+    /**
+     * Creates a new empty FragmentDefinition instance
+     *
+     * @return a newly created FragmentDefinition object
+     */
+    public FragmentDefinition newFragmentDefinition(String path);
+
+    /**
      * Create a new empty Folder instance
      *
      * @return a newly created Folder object
@@ -125,6 +151,20 @@
     public Fragment newPortletFragment();
     
     /**
+     * Creates a new FragmentReference instance
+     *
+     * @return a newly created Fragment object
+     */    
+    public FragmentReference newFragmentReference();
+    
+    /**
+     * Creates a new PageFragment instance
+     *
+     * @return a newly created Fragment object
+     */    
+    public PageFragment newPageFragment();
+    
+    /**
      * newFolderMenuDefinition - creates a new empty menu definition
      *
      * @return a newly created MenuDefinition object to be used in Folder
@@ -265,20 +305,43 @@
     
     /**
      * <p>
-     * ContentPage
+     * getPageTemplate
      * </p>
      *
-     * Returns a PSML document suitable for use in content
-     * rendering, for the given key
+     * Returns a PageTemplate based on its path
      *
-     * @see ContentPage
-     * @see Fragment
-     * @param locator The locator descriptor of the document to be retrieved.
+     * @param path
      * @throws PageNotFoundException if the page cannot be found
      * @throws NodeException
      */
-    public ContentPage getContentPage(String path) throws PageNotFoundException, NodeException;
-    
+    public PageTemplate getPageTemplate(String path) throws PageNotFoundException, NodeException;
+
+    /**
+     * <p>
+     * getDynamicPage
+     * </p>
+     *
+     * Returns a DynamicPage based on its path
+     *
+     * @param path
+     * @throws PageNotFoundException if the page cannot be found
+     * @throws NodeException
+     */
+    public DynamicPage getDynamicPage(String path) throws PageNotFoundException, NodeException;
+
+    /**
+     * <p>
+     * getFragmentDefinition
+     * </p>
+     *
+     * Returns a FragmentDefinition based on its path
+     *
+     * @param path
+     * @throws PageNotFoundException if the page cannot be found
+     * @throws NodeException
+     */
+    public FragmentDefinition getFragmentDefinition(String path) throws PageNotFoundException, NodeException;
+
     /**
      * <p>
      * getLink
@@ -377,6 +440,60 @@
     
     /**
      * <p>
+     * getPageTemplates
+     * </p>
+     *
+     * Locates documents within a specified parent folder.
+     * Returned documents are filtered according to security
+     * constraints and/or permissions.
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getPageTemplates(org.apache.jetspeed.om.folder.Folder)
+     *
+     * @param folder The parent folder.
+     * @return A <code>NodeSet</code> of all the PageTemplates referenced
+     *         by this Folder.
+     * @throws NodeException
+     */
+    public NodeSet getPageTemplates(Folder folder) throws NodeException;
+    
+    /**
+     * <p>
+     * getDynamicPages
+     * </p>
+     *
+     * Locates documents within a specified parent folder.
+     * Returned documents are filtered according to security
+     * constraints and/or permissions.
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getDynamicPages(org.apache.jetspeed.om.folder.Folder)
+     *
+     * @param folder The parent folder.
+     * @return A <code>NodeSet</code> of all the DynamicPages referenced
+     *         by this Folder.
+     * @throws NodeException
+     */
+    public NodeSet getDynamicPages(Folder folder) throws NodeException;
+    
+    /**
+     * <p>
+     * getFragmentDefinition
+     * </p>
+     *
+     * Locates documents within a specified parent folder.
+     * Returned documents are filtered according to security
+     * constraints and/or permissions.
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getFragmentDefinition(org.apache.jetspeed.om.folder.Folder)
+     *
+     * @param folder The parent folder.
+     * @return A <code>NodeSet</code> of all the FragmentDefinitions referenced
+     *         by this Folder.
+     * @throws NodeException
+     */
+    public NodeSet getFragmentDefinitions(Folder folder) throws NodeException;
+    
+    /**
+     * <p>
      * getPage
      * </p>
      *
@@ -396,6 +513,63 @@
     
     /**
      * <p>
+     * getPageTemplate
+     * </p>
+     *
+     * Locates documents within a specified parent folder.
+     * Returned documents are filtered according to security
+     * constraints and/or permissions.
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getPageTemplate(org.apache.jetspeed.om.folder.Folder,java.lang.String)
+     *
+     * @param folder The parent folder.
+     * @param name The name of page template to retrieve.
+     * @return A PageTemplate referenced by this folder.
+     * @throws PageNotFoundException if the PageTemplate requested could not be found.
+     * @throws NodeException
+     */
+    public PageTemplate getPageTemplate(Folder folder, String name) throws PageNotFoundException, NodeException;
+    
+    /**
+     * <p>
+     * getDynamicPage
+     * </p>
+     *
+     * Locates documents within a specified parent folder.
+     * Returned documents are filtered according to security
+     * constraints and/or permissions.
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getDynamicPage(org.apache.jetspeed.om.folder.Folder,java.lang.String)
+     *
+     * @param folder The parent folder.
+     * @param name The name of dynamic page to retrieve.
+     * @return A DynamicPage referenced by this folder.
+     * @throws PageNotFoundException if the DynamicPage requested could not be found.
+     * @throws NodeException
+     */
+    public DynamicPage getDynamicPage(Folder folder, String name) throws PageNotFoundException, NodeException;
+    
+    /**
+     * <p>
+     * getFragmentDefinition
+     * </p>
+     *
+     * Locates documents within a specified parent folder.
+     * Returned documents are filtered according to security
+     * constraints and/or permissions.
+     *
+     * @see org.apache.jetspeed.om.folder.Folder#getFragmentDefinition(org.apache.jetspeed.om.folder.Folder,java.lang.String)
+     *
+     * @param folder The parent folder.
+     * @param name The name of fragment definition to retrieve.
+     * @return A DynamicPage referenced by this folder.
+     * @throws PageNotFoundException if the FragmentDefinition requested could not be found.
+     * @throws NodeException
+     */
+    public FragmentDefinition getFragmentDefinition(Folder folder, String name) throws PageNotFoundException, NodeException;
+    
+    /**
+     * <p>
      * getLinks
      * </p>
      *
@@ -466,57 +640,108 @@
      */
     public NodeSet getAll(Folder folder) throws DocumentException;
 
-    /** Update a page in persistent storage
+    /**
+     * Update a page in persistent storage
      *
      * @param page The page to be updated.
      */
     public void updatePage(Page page) throws NodeException, PageNotUpdatedException;
 
-    /** Remove a document.
+    /**
+     * Remove a page.
      *
      * @param page The page to be removed.
      */
     public void removePage(Page page) throws NodeException, PageNotRemovedException;
 
-    /** Update a folder and all child folders
-     *  and documents in persistent storage
+    /**
+     * Update a page template in persistent storage
+     *
+     * @param pageTemplate The page template to be updated.
+     */
+    public void updatePageTemplate(PageTemplate pageTemplate) throws NodeException, PageNotUpdatedException;
+
+    /**
+     * Remove a page template.
+     *
+     * @param pageTemplate The page template to be removed.
+     */
+    public void removePageTemplate(PageTemplate pageTemplate) throws NodeException, PageNotRemovedException;
+
+    /**
+     * Update a dynamic page in persistent storage
+     *
+     * @param dynamicPage The dynamic page to be updated.
+     */
+    public void updateDynamicPage(DynamicPage dynamicPage) throws NodeException, PageNotUpdatedException;
+
+    /**
+     * Remove a dynamic page.
+     *
+     * @param dynamicPage The dynamic page to be removed.
+     */
+    public void removeDynamicPage(DynamicPage dynamicPage) throws NodeException, PageNotRemovedException;
+
+    /**
+     * Update a fragment definition in persistent storage
+     *
+     * @param dynamicPage The fragment definition to be updated.
+     */
+    public void updateFragmentDefinition(FragmentDefinition fragmentDefinition) throws NodeException, PageNotUpdatedException;
+
+    /**
+     * Remove a fragment definition.
+     *
+     * @param dynamicPage The fragment definition to be removed.
+     */
+    public void removeFragmentDefinition(FragmentDefinition fragmentDefinition) throws NodeException, PageNotRemovedException;
+    
+    /**
+     * Update a folder and all child folders
+     * and documents in persistent storage
      *
      * @param folder The folder to be updated.
      */
     public void updateFolder(Folder folder) throws NodeException, FolderNotUpdatedException;
 
-    /** Update a folder in persistent storage
+    /**
+     * Update a folder in persistent storage
      *
      * @param folder The folder to be updated.
      * @param deep Flag to control recursive deep updates.
      */
     public void updateFolder(Folder folder, boolean deep) throws NodeException, FolderNotUpdatedException;
 
-    /** Remove a folder.
+    /**
+     * Remove a folder.
      *
      * @param page The folder to be removed.
      */
     public void removeFolder(Folder folder) throws NodeException, FolderNotRemovedException;
 
-    /** Update a link in persistent storage
+    /**
+     * Update a link in persistent storage
      *
      * @param link The link to be updated.
      */
     public void updateLink(Link link) throws NodeException, LinkNotUpdatedException;
 
-    /** Remove a link.
+    /**
+     * Remove a link.
      *
      * @param link The link to be removed.
      */
     public void removeLink(Link link) throws NodeException, LinkNotRemovedException;
 
-    /** Update a page security document in persistent storage
+    /**
+     * Update a page security document in persistent storage
      *
      * @param pageSecurity The document to be updated.
      */
     public void updatePageSecurity(PageSecurity pageSecurity) throws NodeException, FailedToUpdateDocumentException;
 
-    /** Remove a page security document.
+    /**
+     * Remove a page security document.
      *
      * @param pageSecurity The document to be removed.
      */
@@ -549,8 +774,8 @@
 
     /** 
      * Copy the source page creating and returning a new copy of the page  
-     * with the same portlet and fragment collection as the source
-     * All fragments are created with new fragment ids
+     * with the same portlet and fragment collection as the source.
+     * All fragments are created with new fragment ids.
      * 
      * @param source The source Page object to be copied 
      * @param path a PSML normalized path to the new page to be created
@@ -572,6 +797,78 @@
         throws NodeException;
 
     /** 
+     * Copy the source page template creating and returning a new copy of the page  
+     * template with the same portlet and fragment collection as the source.
+     * All fragments are created with new fragment ids.
+     * 
+     * @param source The source PageTemplate object to be copied 
+     * @param path a PSML normalized path to the new page template to be created
+     * @return a new PageTemplate object copied from the source, with new fragment ids
+     */
+    public PageTemplate copyPageTemplate(PageTemplate source, String path) 
+        throws NodeException;
+
+    /** 
+     * Copy the source page template creating and returning a new copy of the page  
+     * template with the same portlet and fragment collection as the source.
+     * 
+     * @param source The source PageTemplate object to be copied 
+     * @param path a PSML normalized path to the new page template to be created
+     * @param copyIds flag indicating whether to use new or copied ids
+     * @return a new PageTemplate object copied from the source
+     */
+    public PageTemplate copyPageTemplate(PageTemplate source, String path, boolean copyIds)
+        throws NodeException;
+
+    /** 
+     * Copy the source dynamic page creating and returning a new copy of the dynamic  
+     * page with the same portlet and fragment collection as the source.
+     * All fragments are created with new fragment ids.
+     * 
+     * @param source The source DynamicPage object to be copied 
+     * @param path a PSML normalized path to the new dynamic page to be created
+     * @return a new DynamicPage object copied from the source, with new fragment ids
+     */
+    public DynamicPage copyDynamicPage(DynamicPage source, String path) 
+        throws NodeException;
+
+    /** 
+     * Copy the source dynamic page creating and returning a new copy of the dynamic  
+     * page with the same portlet and fragment collection as the source.
+     * 
+     * @param source The source DynamicPage object to be copied 
+     * @param path a PSML normalized path to the new dynamic page to be created
+     * @param copyIds flag indicating whether to use new or copied ids
+     * @return a new DynamicPage object copied from the source
+     */
+    public DynamicPage copyDynamicPage(DynamicPage source, String path, boolean copyIds)
+        throws NodeException;
+
+    /** 
+     * Copy the source fragment definition creating and returning a new copy of  
+     * the fragment definition with the same portlet and fragment collection as the
+     * source. All fragments are created with new fragment ids.
+     * 
+     * @param source The source FragmentDefinition object to be copied 
+     * @param path a PSML normalized path to the new fragment definition to be created
+     * @return a new FragmentDefinition object copied from the source, with new fragment ids
+     */
+    public FragmentDefinition copyFragmentDefinition(FragmentDefinition source, String path) 
+        throws NodeException;
+
+    /** 
+     * Copy the source fragment definition creating and returning a new copy of
+     * the fragment definition with the same portlet and fragment collection as the source.
+     * 
+     * @param source The source FragmentDefinition object to be copied 
+     * @param path a PSML normalized path to the new fragment definition to be created
+     * @param copyIds flag indicating whether to use new or copied ids
+     * @return a new FragmentDefinition object copied from the source
+     */
+    public FragmentDefinition copyFragmentDefinition(FragmentDefinition source, String path, boolean copyIds)
+        throws NodeException;
+
+    /** 
      * Copy the source link creating and returning a new copy of the link  
      * 
      * @param source The source Link object to be copied 
@@ -598,10 +895,11 @@
      * The fragment is created with a new fragment id
      * 
      * @param source The source Fragment object to be copied 
-     * @param the new fragment name, can be the same as source fragment name
+     * @param name the new fragment name, can be the same as source fragment name
+     *             or null to copy existing name
      * @return a new Fragment object copied from the source
      */
-    public Fragment copyFragment(Fragment source, String name) 
+    public BaseFragmentElement copyFragment(BaseFragmentElement source, String name) 
         throws NodeException;
 
     /** 
@@ -609,11 +907,12 @@
      * with the parameter collection as the source
      * 
      * @param source The source Fragment object to be copied 
-     * @param the new fragment name, can be the same as source fragment name
+     * @param name the new fragment name, can be the same as source fragment name
+     *             or null to copy existing name
      * @param copyIds flag indicating whether to use new or copied ids
      * @return a new Fragment object copied from the source
      */
-    public Fragment copyFragment(Fragment source, String name, boolean copyIds) 
+    public BaseFragmentElement copyFragment(BaseFragmentElement source, String name, boolean copyIds) 
         throws NodeException;
 
     /**
@@ -718,6 +1017,30 @@
     public boolean pageExists(String pageName);
     
     /**
+     * Check if a page template exists for the given page name
+     * 
+     * @param pageName
+     * @return
+     */
+    public boolean pageTemplateExists(String pageName);
+    
+    /**
+     * Check if a dynamic page exists for the given page name
+     * 
+     * @param pageName
+     * @return
+     */
+    public boolean dynamicPageExists(String pageName);
+    
+    /**
+     * Check if a fragment definition exists for the given name
+     * 
+     * @param name
+     * @return
+     */
+    public boolean fragmentDefinitionExists(String name);
+    
+    /**
      * Check if a link exists for the given link name
      * 
      * @param linkName

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/request/RequestContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/request/RequestContext.java?rev=881862&r1=881861&r2=881862&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/request/RequestContext.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/request/RequestContext.java Wed Nov 18 18:24:48 2009
@@ -30,6 +30,7 @@
 import org.apache.jetspeed.capabilities.CapabilityMap;
 import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.container.url.PortalURL;
+import org.apache.jetspeed.layout.PageLayoutComponent;
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.om.page.ContentPage;
 import org.apache.jetspeed.om.portlet.Language;
@@ -394,9 +395,10 @@
      * from a generalized non-profiled path to the first page matching the path
      * 
      *  @param profiler The profiler component to use in the search
+     *  @param pageLayoutComponent The page layout component used to assemble the returned page
      *  @return A Content Page located by the profiler, or null if not found
      */
-    ContentPage locatePage(Profiler profiler, String nonProfiledPath);
+    ContentPage locatePage(Profiler profiler, PageLayoutComponent pageLayoutComponent, String nonProfiledPath);
     
     /**
      * Return a map of Jetspeed Request Context objects configured via Spring Map

Copied: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/GenericMetadataImpl.java (from r830800, portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/GenericMetadataImpl.java)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/GenericMetadataImpl.java?p2=portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/GenericMetadataImpl.java&p1=portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/GenericMetadataImpl.java&r1=830800&r2=881862&rev=881862&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/GenericMetadataImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/GenericMetadataImpl.java Wed Nov 18 18:24:48 2009
@@ -14,16 +14,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jetspeed.om.portlet.impl;
+package org.apache.jetspeed.om.portlet;
 
 import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Collections;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Locale;
+import java.util.Map;
 
-import org.apache.commons.collections.map.MultiValueMap;
 import org.apache.jetspeed.om.portlet.GenericMetadata;
 import org.apache.jetspeed.om.portlet.LocalizedField;
+import org.apache.jetspeed.util.ArgUtil;
 
 /**
  * GenericMetadataImpl
@@ -37,9 +40,12 @@
 public abstract class GenericMetadataImpl implements GenericMetadata
 {   
     private Collection<LocalizedField> fields = null;
-    private transient MultiValueMap fieldMap = null;
+
+    private transient Map<String,Collection<LocalizedField>> fieldMap = null;
+
+    private transient Map<String,Map<Locale,LocalizedField>> localizedText = null;
     
-    private MultiValueMap getFieldMap(boolean create)
+    private Map<String,Collection<LocalizedField>> getFieldMap(boolean create)
     {
         if (fieldMap == null && create)
         {
@@ -47,13 +53,25 @@
             {
                 if (fieldMap == null)
                 {
-                    fieldMap = new MultiValueMap();
+                    fieldMap = new HashMap<String,Collection<LocalizedField>>();
                 }
             }
         }
         return fieldMap;
     }
-
+    
+    private void addFieldMap(LocalizedField field)
+    {
+        Map<String,Collection<LocalizedField>> fieldMap = getFieldMap(true);
+        String fieldMapKey = field.getName();
+        Collection<LocalizedField> fields = fieldMap.get(fieldMapKey);
+        if (fields == null)
+        {
+            fields = new ArrayList<LocalizedField>();
+            fieldMap.put(fieldMapKey, fields);
+        }
+        fields.add(field);
+    }
     
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.common.GenericMetadata#addField(java.util.Locale, java.lang.String, java.lang.String)
@@ -73,24 +91,23 @@
      */
     public void addField(LocalizedField field)
     {
-        if(fields == null)
+        if (fields == null)
         {
             fields = new ArrayList<LocalizedField>();
-        }
-        
+        }        
         fields.add(field);
-        getFieldMap(true).put(field.getName(), field);
+        
+        addFieldMap(field);
     }
 
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.common.GenericMetadata#getFields(java.lang.String)
      */
-    @SuppressWarnings("unchecked")
     public Collection<LocalizedField> getFields(String name)
     {
     	//TODO:  return an immutable version?
-        MultiValueMap fieldMap = getFieldMap(false);
-        return (Collection<LocalizedField>)(fieldMap !=null ? fieldMap.get(name) : null);
+        Map<String,Collection<LocalizedField>> fieldMap = getFieldMap(false);
+        return (fieldMap !=null ? fieldMap.get(name) : null);
     }
 
     /* (non-Javadoc)
@@ -98,7 +115,7 @@
      */
     public void setFields(String name, Collection<LocalizedField> values)
     {
-        MultiValueMap fieldMap = getFieldMap(false);
+        Map<String,Collection<LocalizedField>> fieldMap = getFieldMap(false);
         if (fieldMap != null)
         {
             fieldMap.remove(name);
@@ -120,7 +137,7 @@
             while(iter.hasNext())
             {
                 LocalizedField field = (LocalizedField)iter.next();
-                getFieldMap(true).put(field.getName(), field);
+                addFieldMap(field);
             }
             
             fields.addAll(values);
@@ -142,7 +159,7 @@
     {
         this.fields = fields;
 
-        MultiValueMap fieldMap = getFieldMap(false);
+        Map<String,Collection<LocalizedField>> fieldMap = getFieldMap(false);
         if (fieldMap != null)
         {
             fieldMap.clear();
@@ -156,7 +173,7 @@
                 LocalizedField field = (LocalizedField)fieldIter.next();
                 if (field.getName() != null)
                 {
-                    getFieldMap(true).put(field.getName(), field);
+                    addFieldMap(field);
                 }
             }
         }
@@ -205,7 +222,7 @@
         }
         
         // update field map
-        MultiValueMap fieldMap = getFieldMap(false);
+        Map<String,Collection<LocalizedField>> fieldMap = getFieldMap(false);
         if (fieldMap != null)
         {
             fieldMap.clear();
@@ -217,8 +234,61 @@
             while (fieldIter.hasNext())
             {
                 LocalizedField field = (LocalizedField)fieldIter.next();
-                getFieldMap(true).put(field.getName(), field);
+                addFieldMap(field);
+            }
+        }
+    }
+    
+    /**
+     * getText - get localized text from metadata
+     * 
+     * @param name text name
+     * @param locale preferred locale
+     * @return localized text or null if not available
+     */
+    public String getText(String name, Locale locale)
+    {
+        // validate parameters
+        ArgUtil.assertNotNull(String.class, name, this, "getText(String, Locale)");
+        ArgUtil.assertNotNull(Locale.class, locale, this, "getText(String, Locale)");
+
+        // populate cache for named text by locale
+        Map<Locale,LocalizedField> namedLocalizedText = ((localizedText != null) ? localizedText.get(name) : null);
+        if ((namedLocalizedText == null) && (getFields() != null))
+        {
+            Collection<LocalizedField> fields = getFields(name);
+            if ((fields != null) && !fields.isEmpty())
+            {
+                namedLocalizedText = new HashMap<Locale,LocalizedField>(getFields().size());
+                if (localizedText == null)
+                {
+                    localizedText = Collections.synchronizedMap(new HashMap<String,Map<Locale,LocalizedField>>(getFields().size()));
+                }
+                localizedText.put(name, namedLocalizedText);
+                Iterator<LocalizedField> fieldsItr = fields.iterator();
+                while (fieldsItr.hasNext())
+                {
+                    LocalizedField field = fieldsItr.next();
+                    namedLocalizedText.put(field.getLocale(), field);
+                }
+            }
+        }
+
+        // retrieve cached named text by locale if found
+        if ((namedLocalizedText != null) && !namedLocalizedText.isEmpty())
+        {
+            // test locale
+            if (namedLocalizedText.containsKey(locale) )
+            {
+                return namedLocalizedText.get(locale).getValue().trim();
+            }
+            // test language only locale
+            Locale languageOnly = new Locale(locale.getLanguage());
+            if (namedLocalizedText.containsKey(languageOnly))
+            {
+                return namedLocalizedText.get(languageOnly).getValue().trim();
             }
         }
+        return null;
     }
 }

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/GenericMetadataImpl.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.1

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/GenericMetadataImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/GenericMetadataImpl.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/GenericMetadataImpl.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/LocalizedFieldImpl.java (from r830800, portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/LocalizedFieldImpl.java)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/LocalizedFieldImpl.java?p2=portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/LocalizedFieldImpl.java&p1=portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/LocalizedFieldImpl.java&r1=830800&r2=881862&rev=881862&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/LocalizedFieldImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/LocalizedFieldImpl.java Wed Nov 18 18:24:48 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jetspeed.om.portlet.impl;
+package org.apache.jetspeed.om.portlet;
 import java.util.Locale;
 
 import org.apache.jetspeed.om.portlet.LocalizedField;
@@ -103,6 +103,10 @@
 
             this.locale = new Locale(language, country, variant);
         }
+		else
+		{
+            this.locale = null;		    
+		}
     }
 
     public String getLanguage()

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/LocalizedFieldImpl.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.2

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/LocalizedFieldImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/LocalizedFieldImpl.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/om/portlet/LocalizedFieldImpl.java
------------------------------------------------------------------------------
    svn:mergeinfo = 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org