portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r887690 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ jetspeed-api/src/main/java/org/apache/jetspeed/om/page/
Date Sun, 06 Dec 2009 15:15:50 GMT
Author: ate
Date: Sun Dec  6 15:15:47 2009
New Revision: 887690

URL: http://svn.apache.org/viewvc?rev=887690&view=rev
Log:
Adding lookup of ContentFragment by underlying PSML Fragment id to support decorators actively
pulling in specific fragments at a specific place within the markup

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentPageImpl.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/page/ContentPage.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java?rev=887690&r1=887689&r2=887690&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java
Sun Dec  6 15:15:47 2009
@@ -745,6 +745,31 @@
     }
 
     /**
+     * Get content fragment by underlying PSML Fragment id.
+     * 
+     * @param id PSML fragment id
+     * @return content fragment
+     */
+    public ContentFragmentImpl getFragmentByFragmentId(String id)
+    {
+        if (fragment != null && fragment.getId().equals(id))
+        {
+            return this;
+        }
+        Iterator fragmentIter = getFragments().iterator();
+        while (fragmentIter.hasNext())
+        {
+            ContentFragmentImpl childFragment = (ContentFragmentImpl)fragmentIter.next();
+            ContentFragmentImpl fragment = childFragment.getFragmentByFragmentId(id);
+            if (fragment != null)
+            {
+                return fragment;
+            }
+        }
+        return null;
+    }
+
+    /**
      * Get content fragment nesting level.
      * 
      * @param fragmentId fragment id to find

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentPageImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentPageImpl.java?rev=887690&r1=887689&r2=887690&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentPageImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentPageImpl.java
Sun Dec  6 15:15:47 2009
@@ -154,6 +154,18 @@
     }
 
     /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.page.ContentPage#getFragmentByFragmentId(java.lang.String)
+     */
+    public ContentFragment getFragmentByFragmentId(String id)
+    {
+        if (rootContentFragment != null)
+        {
+            return rootContentFragment.getFragmentByFragmentId(id);
+        }
+        return null;
+    }
+
+    /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.ContentPage#getFragmentsByName(java.lang.String)
      */
     public List getFragmentsByName(String name)

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=887690&r1=887689&r2=887690&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
Sun Dec  6 15:15:47 2009
@@ -159,6 +159,13 @@
     ContentFragment getFragmentById(String id);
 
     /**
+     * Returns a ContentFragment represented by the underlying PSML Fragment fragment id
argument.
+     * @param id unique id of the ContentFragment we want to retrieve.
+     * @return
+     */
+    ContentFragment getFragmentByFragmentId(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



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