portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r553340 - in /portals/jetspeed-2/trunk: components/cm/src/java/org/apache/jetspeed/cache/impl/ components/cm/src/test/org/apache/jetspeed/cache/ components/portal/src/java/org/apache/jetspeed/container/state/impl/ components/portal/src/java...
Date Wed, 04 Jul 2007 22:00:12 GMT
Author: taylor
Date: Wed Jul  4 15:00:09 2007
New Revision: 553340

URL: http://svn.apache.org/viewvc?view=rev&rev=553340
Log:
The decorator cache is in place. Contribution from myself and Woonsan Ko, a little pair programming across the Pacific ;)
It is disabled by default, as I believe the performance gains are not worthwhile until you get into heavy loads
It now supports both JetspeedCache and session caching
My opinion is that the entire Decoration code, and especially Content* classes, should be greatly improved on in the next release (2.2.) 

Added:
    portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhDecorationContentCacheElementImpl.java
    portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhDecorationContentCacheImpl.java
    portals/jetspeed-2/trunk/components/cm/src/test/org/apache/jetspeed/cache/TestDecorationContentCache.java
Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/PortletWindowSessionNavigationalStates.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/SessionFullNavigationalState.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/SessionNavigationalState.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationValve.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java
    portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java
    portals/jetspeed-2/trunk/layout-portlets/src/webapp/WEB-INF/jetspeed-portlet.xml
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/cache.xml
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/jetspeed-services.xml
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/pipelines.xml
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/portal-url-generation.xml

Added: portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhDecorationContentCacheElementImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhDecorationContentCacheElementImpl.java?view=auto&rev=553340
==============================================================================
--- portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhDecorationContentCacheElementImpl.java (added)
+++ portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhDecorationContentCacheElementImpl.java Wed Jul  4 15:00:09 2007
@@ -0,0 +1,93 @@
+/* 
+ * 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.cache.impl;
+
+import net.sf.ehcache.Element;
+
+import org.apache.jetspeed.cache.ContentCacheElement;
+import org.apache.jetspeed.cache.ContentCacheKey;
+
+/**
+ * Wrapper around actual cache element implementation
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class EhDecorationContentCacheElementImpl implements ContentCacheElement
+{
+    Element element;
+    ContentCacheKey cckey;
+    
+    public static final String KEY_SEPARATOR = "/";
+    
+	public EhDecorationContentCacheElementImpl(Element element, ContentCacheKey cckey)
+    {
+        this.element = element;
+        this.cckey = cckey;
+    }
+
+    public Object getKey()
+    {
+        return element.getObjectKey();
+    }
+        
+    public Object getContent()
+    {
+        return element.getObjectValue();
+    }
+
+    public int getTimeToIdleSeconds()
+    {
+        return element.getTimeToIdle();
+    }
+
+    public int getTimeToLiveSeconds()
+    {
+        return element.getTimeToLive();
+    }
+
+    public boolean isEternal()
+    {
+        return element.isEternal();
+    }
+
+    public Element getImplElement()
+    {
+        return element;
+    }
+
+    public void setEternal(boolean eternal)
+    {
+        element.setEternal(eternal);
+    }
+
+    public void setTimeToIdleSeconds(int timeToIdle)
+    {
+        element.setTimeToIdle(timeToIdle);
+    }
+
+    public void setTimeToLiveSeconds(int timeToLive)
+    {
+        element.setTimeToLive(timeToLive);
+    }
+
+    public ContentCacheKey getContentCacheKey()
+    {
+        return cckey;
+    }
+}
\ No newline at end of file

Added: portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhDecorationContentCacheImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhDecorationContentCacheImpl.java?view=auto&rev=553340
==============================================================================
--- portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhDecorationContentCacheImpl.java (added)
+++ portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhDecorationContentCacheImpl.java Wed Jul  4 15:00:09 2007
@@ -0,0 +1,336 @@
+/* 
+ * 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.cache.impl;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.Element;
+
+import org.apache.jetspeed.cache.CacheElement;
+import org.apache.jetspeed.cache.ContentCacheElement;
+import org.apache.jetspeed.cache.ContentCacheKey;
+import org.apache.jetspeed.cache.ContentCacheKeyGenerator;
+import org.apache.jetspeed.cache.JetspeedCache;
+import org.apache.jetspeed.cache.JetspeedCacheEventListener;
+import org.apache.jetspeed.cache.JetspeedContentCache;
+import org.apache.jetspeed.cache.impl.JetspeedContentCacheKey;
+import org.apache.jetspeed.decoration.Theme;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.jetspeed.om.page.ContentPage;
+
+/**
+ * Wrapper around actual cache implementation
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class EhDecorationContentCacheImpl extends EhCacheImpl implements JetspeedContentCache, JetspeedCacheEventListener
+{
+
+	JetspeedCache preferenceCache = null;
+    ContentCacheKeyGenerator keyGenerator = null;    
+
+    public EhDecorationContentCacheImpl(Cache ehcache, JetspeedCache preferenceCache, ContentCacheKeyGenerator keyGenerator)
+    {
+        this(ehcache);
+        this.preferenceCache = preferenceCache;
+        this.keyGenerator = keyGenerator;
+        preferenceCache.addEventListener(this,false); //only listen to remote events
+    }
+    
+    public EhDecorationContentCacheImpl(Cache ehcache, JetspeedCache preferenceCache)
+    {
+        this(ehcache);
+        this.preferenceCache = preferenceCache;
+        preferenceCache.addEventListener(this,false); //only listen to remote events
+    }
+        
+    public EhDecorationContentCacheImpl(Cache ehcache)
+    {
+        super(ehcache);
+    }
+
+    public EhDecorationContentCacheImpl(Cache ehcache, ContentCacheKeyGenerator keyGenerator)
+    {
+        this(ehcache);
+        this.keyGenerator = keyGenerator;
+    }
+    
+
+	public void notifyElementAdded(JetspeedCache cache, boolean local, Object key, Object element)
+	{
+	}
+
+	public void notifyElementChanged(JetspeedCache cache, boolean local, Object key, Object element)
+	{
+	}
+
+	public void notifyElementEvicted(JetspeedCache cache, boolean local, Object key, Object element)
+	{
+	}
+
+	public void notifyElementExpired(JetspeedCache cache, boolean local, Object key, Object element)
+	{
+		notifyElementRemoved(cache,local,key,element);
+	}
+
+
+    public static final String KEY_THEME_KEY = 
+        EhDecorationContentCacheElementImpl.KEY_SEPARATOR + "theme" + EhDecorationContentCacheElementImpl.KEY_SEPARATOR ;
+	public static final int KEY_THEME_KEY_LENGTH = KEY_THEME_KEY.length();
+    
+	public void notifyElementRemoved(JetspeedCache cache, boolean local,
+            Object key, Object element)
+    {
+        if (local) return; // not interested in local changes
+
+        // System.out.println("notifying DecorationContent that element " +
+        // key.toString() + " has been removed");
+        if (!(key instanceof String)) return;
+        String s = (String) key;
+        if (!(s.startsWith(KEY_THEME_KEY))) return;
+        StringTokenizer st = new StringTokenizer(s,
+                EhDecorationContentCacheElementImpl.KEY_SEPARATOR);
+        int count = 0;
+        String te = null;
+        String user = null;
+        while (st.hasMoreTokens())
+        {
+            String temp = st.nextToken();
+            switch (count)
+            {
+            case 0:
+                break;
+            case 1:
+                te = temp; 
+                break;
+            case 2:
+                user = temp;
+                break;
+            }
+            count++;
+            if (count > 2) break;
+        }
+        if (te != null)
+        {
+            removeUserEntry(user, "theme", te);     
+        }
+    }
+
+    void removeUserEntry(String username, String pipeline, String windowId)
+    {        
+        ContentCacheKey key = keyGenerator.createUserCacheKey(username, pipeline, windowId);
+        if (ehcache.remove(key.getKey()))
+        {
+            Element userElement = ehcache.get(username);
+                
+            if (userElement != null)
+            {
+                Map map = (Map)userElement.getObjectValue();
+                if (map != null)
+                {
+                    map.remove(windowId);
+                }
+            }
+        }
+    }
+    
+    public CacheElement get(Object key)
+    {
+        ContentCacheKey cckey = (ContentCacheKey)key;
+        Element element = ehcache.get(cckey.getKey());
+        if (element == null)
+            return null;
+        return new EhDecorationContentCacheElementImpl(element, cckey);
+    }
+
+    public int getTimeToIdleSeconds()
+    {
+        return (int)ehcache.getTimeToIdleSeconds();
+    }
+
+    public int getTimeToLiveSeconds()
+    {
+        return (int)ehcache.getTimeToLiveSeconds();
+    }
+
+    public boolean isKeyInCache(Object key)
+    {
+        ContentCacheKey cckey = (ContentCacheKey)key;        
+        return ehcache.isKeyInCache(cckey.getKey());
+    }
+
+    public void put(CacheElement element)
+    {
+        ContentCacheElement ccElement = (ContentCacheElement)element;
+        EhDecorationContentCacheElementImpl impl = (EhDecorationContentCacheElementImpl)element;
+        Element ehl = impl.getImplElement();        
+        String userKey = ccElement.getContentCacheKey().getSessionId();
+        if (userKey == null)
+        {
+            userKey = ccElement.getContentCacheKey().getUsername();
+        }
+        String windowId = ccElement.getContentCacheKey().getWindowId();
+        try
+        {
+            ehcache.put(ehl);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        Element userElement = ehcache.get(userKey);
+        if (userElement == null)
+        {
+            Map map = Collections.synchronizedMap(new HashMap());
+            map.put(windowId, ccElement.getContentCacheKey());
+            userElement = new Element(userKey, map);
+            ehcache.put(userElement);           
+        }
+        else
+        {
+            Map map = (Map)userElement.getObjectValue();
+            map.put(windowId, ccElement.getContentCacheKey());
+        }        
+    }
+    
+    public CacheElement createElement(Object key, Object content)
+    {
+        ContentCacheKey cckey = (ContentCacheKey)key;
+        Element cachedElement = new Element(cckey.getKey(), content);        
+        return new EhDecorationContentCacheElementImpl(cachedElement, cckey);
+    }
+
+    public boolean remove(Object key)
+    {
+        CacheElement element = this.get(key);
+        boolean removed = false;
+        if (element == null)
+            return false;
+        
+        ContentCacheElement ccElement = (ContentCacheElement)element;
+        EhDecorationContentCacheElementImpl impl = (EhDecorationContentCacheElementImpl)element;
+        Element ehl = impl.getImplElement();        
+        String userKey = ccElement.getContentCacheKey().getSessionId();
+        if (userKey == null)
+        {
+            userKey = ccElement.getContentCacheKey().getUsername();
+        }        
+        String windowId = ccElement.getContentCacheKey().getWindowId();        
+        removed = ehcache.remove(ccElement.getContentCacheKey().getKey());
+        Element userElement = ehcache.get(userKey);
+        if (userElement != null)
+        {
+            Map map = (Map)userElement.getObjectValue();
+            if (map != null)
+            {
+                map.remove(windowId);
+            }
+        }
+        return removed;
+    }
+        
+    public void evictContentForUser(String username)
+    {
+        Element userElement = saveGet(username);
+        if (userElement != null)
+        {
+            Map map = (Map)userElement.getObjectValue();
+            if (map != null)
+            {
+                Iterator entities = map.values().iterator();
+                while (entities.hasNext())
+                {
+                    ContentCacheKey ccKey = (ContentCacheKey)entities.next();
+                    ehcache.remove(ccKey.getKey());
+                }
+            }
+            ehcache.remove(username);
+        }
+    }
+
+    public void evictContentForSession(String session)
+    {
+        Element userElement = saveGet(session);
+        if (userElement != null)
+        {
+            Map map = (Map)userElement.getObjectValue();
+            if (map != null)
+            {
+                Iterator entities = map.values().iterator();
+                while (entities.hasNext())
+                {
+                    ContentCacheKey ccKey = (ContentCacheKey)entities.next();
+                    ehcache.remove(ccKey.getKey());
+                }
+            }
+            ehcache.remove(session);
+        }
+    }
+    
+    public void clear()
+    {
+        ehcache.removeAll();
+    }
+        
+    public ContentCacheKey createCacheKey(RequestContext context, String windowId)
+    {
+        return this.keyGenerator.createCacheKey(context, windowId);        
+    }
+    
+    protected Element saveGet(Object key)
+    {
+        try
+        {
+            return ehcache.get(key);
+        }
+        catch (IllegalStateException ise)
+        {
+            // can be thrown during shutdown for instance
+            return null;
+        }
+    }
+    
+    public String createSessionKey(RequestContext context)
+    {
+        boolean isAjaxRequest = (context == null);
+        String mode = isAjaxRequest ? "-d-" : "-p-";
+        String user = context.getRequest().getRemoteUser();
+        if (user == null)
+            user = "guest";        
+        return user + mode + context.getPage().getId();        
+    }
+    
+    public void invalidate(RequestContext context)
+    {
+        ContentPage page = context.getPage();
+        ContentCacheKey themeContentCacheKey = createCacheKey(context, page.getId());
+        CacheElement themeCacheElem = get(themeContentCacheKey);
+        
+        if (themeCacheElem != null)
+        {
+            Theme theme = (Theme) themeCacheElem.getContent();
+            theme.setInvalidated(true);
+        }
+    }
+}
\ No newline at end of file

Added: portals/jetspeed-2/trunk/components/cm/src/test/org/apache/jetspeed/cache/TestDecorationContentCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/cm/src/test/org/apache/jetspeed/cache/TestDecorationContentCache.java?view=auto&rev=553340
==============================================================================
--- portals/jetspeed-2/trunk/components/cm/src/test/org/apache/jetspeed/cache/TestDecorationContentCache.java (added)
+++ portals/jetspeed-2/trunk/components/cm/src/test/org/apache/jetspeed/cache/TestDecorationContentCache.java Wed Jul  4 15:00:09 2007
@@ -0,0 +1,272 @@
+/*
+ * 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.cache;
+
+import java.io.Serializable;
+import java.security.Principal;
+import java.util.LinkedList;
+import java.util.List;
+
+import junit.framework.TestCase;
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheManager;
+
+import org.apache.jetspeed.cache.impl.EhDecorationContentCacheImpl;
+import org.apache.jetspeed.cache.impl.JetspeedCacheKeyGenerator;
+import org.apache.jetspeed.mockobjects.request.MockRequestContext;
+
+import com.mockrunner.mock.web.MockHttpServletRequest;
+import com.mockrunner.mock.web.MockHttpServletResponse;
+import com.mockrunner.mock.web.MockHttpSession;
+
+/**
+ * <p>
+ * Test Content Cache
+ * </p>
+ * <p>
+ *
+ * </p>
+ * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
+ * @version $Id: TestCachingInterceptors.java 516448 2007-03-09 16:25:47Z ate $
+ *
+ */
+public class TestDecorationContentCache extends TestCase
+{
+       
+    public void testContentCacheByUser() throws Exception
+    {
+        // initialize ehCache
+        CacheManager cacheManager = new CacheManager();
+        Cache ehContentCache = new Cache("ehDecorationContentCache", 10000, false, false, 28800, 28800);
+        cacheManager.addCache(ehContentCache);
+        ehContentCache.setCacheManager(cacheManager);       
+        
+        // initial Jetspeed caches
+        List segments = new LinkedList();
+        segments.add("username");
+        segments.add("pipeline");
+        segments.add("windowid");
+        ContentCacheKeyGenerator generator = new JetspeedCacheKeyGenerator(segments);
+        JetspeedCache contentCache = new EhDecorationContentCacheImpl(ehContentCache, generator);
+        
+        // create the mock request context
+        MockHttpServletRequest request = new MockHttpServletRequest();       
+        MockHttpServletResponse response = new MockHttpServletResponse();
+        request.setUserPrincipal(new MockPrincipal("david"));
+        MockRequestContext context = new MockRequestContext(request, response);
+        
+        // create a simple key
+        String window1 = "/default-page.psml";
+        ContentCacheKey cckey1 = contentCache.createCacheKey(context, window1);
+        assertEquals(cckey1.getKey(), "david/portal//default-page.psml");
+
+        // create a another key for desktop
+        String window2 = "/about.psml";
+        context.getParameterMap().put("encoder", "desktop");
+        ContentCacheKey cckey2 = contentCache.createCacheKey(context, window2);
+        assertEquals(cckey2.getKey(), "david/desktop//about.psml");
+        
+        // create some PortletContent mock objects
+        MockTheme theme1 = new MockTheme("/default-page.psml");
+        MockTheme theme2 = new MockTheme("/about.psml");
+        
+        // put it in the cache
+        CacheElement element1 = contentCache.createElement(cckey1, theme1);
+        contentCache.put(element1);
+        CacheElement element2 = contentCache.createElement(cckey2, theme2);
+        contentCache.put(element2);
+        
+        // assert the gets
+        Object result1 = contentCache.get(cckey1);
+        assertNotNull(result1);
+        System.out.println("result 1 = " + result1);
+        Object result2 = contentCache.get(cckey2);
+        assertNotNull(result2);
+        System.out.println("result 2 = " + result2);
+        
+        // assert isKey Apis        
+        assertTrue(contentCache.isKeyInCache(cckey1));
+
+        
+        // test removes
+        contentCache.remove(cckey1);
+        assertFalse(contentCache.isKeyInCache(cckey1));        
+        assertTrue(contentCache.isKeyInCache(cckey2));
+        
+        // test user stuff
+        request.setUserPrincipal(new MockPrincipal("sean"));        
+        // create a simple key
+        String window3 = "/default-page.psml";
+        ContentCacheKey cckey3 = contentCache.createCacheKey(context, window3);
+        assertEquals(cckey3.getKey(), "sean/desktop//default-page.psml");
+
+        // create a another key for desktop
+        String window4 = "/about.psml";
+        ContentCacheKey cckey4 = contentCache.createCacheKey(context, window4);
+        assertEquals(cckey4.getKey(), "sean/desktop//about.psml");
+        
+        // create some MockTheme objects
+        MockTheme theme3 = new MockTheme("/default-page.psml");
+        MockTheme theme4 = new MockTheme("/about.psml");
+        
+        // put it in the cache
+        CacheElement element3 = contentCache.createElement(cckey3, theme3);
+        contentCache.put(element3);
+        CacheElement element4 = contentCache.createElement(cckey4, theme4);
+        contentCache.put(element4);
+
+        // assert 3 and 4
+        assertTrue(contentCache.isKeyInCache(cckey3));
+        assertTrue(contentCache.isKeyInCache(cckey4));
+        
+        // remove for user
+        contentCache.evictContentForUser("sean");
+        assertFalse(contentCache.isKeyInCache(cckey3));
+        assertFalse(contentCache.isKeyInCache(cckey4));
+        assertTrue(contentCache.isKeyInCache(cckey2));        
+    }
+    
+    public void testContentCacheBySession() throws Exception
+    {
+        // initialize ehCache
+        CacheManager cacheManager = new CacheManager();
+        Cache ehContentCache = new Cache("ehDecorationContentCache", 10000, false, false, 28800, 28800);
+        cacheManager.addCache(ehContentCache);
+        ehContentCache.setCacheManager(cacheManager);       
+        
+        // initial Jetspeed caches
+        List segments = new LinkedList();
+        segments.add("sessionid");
+        segments.add("pipeline");
+        segments.add("windowid");
+        ContentCacheKeyGenerator generator = new JetspeedCacheKeyGenerator(segments);
+        JetspeedCache contentCache = new EhDecorationContentCacheImpl(ehContentCache, generator);
+        
+        // create the mock request context
+        MockHttpServletRequest request = new MockHttpServletRequest();       
+        MockHttpServletResponse response = new MockHttpServletResponse();
+        request.setUserPrincipal(new MockPrincipal("david"));
+        MockHttpSession session = new MockHttpSession();
+        request.setSession(session);
+        String sessionId = session.getId();
+
+        MockRequestContext context = new MockRequestContext(request, response);
+        
+        // create a simple key
+        String window1 = "/default-page.psml";
+        ContentCacheKey cckey1 = contentCache.createCacheKey(context, window1);
+        assertEquals(cckey1.getKey(), sessionId + "/portal//default-page.psml");
+
+        // create a another key for desktop
+        String window2 = "/about.psml";
+        context.getParameterMap().put("encoder", "desktop");
+        ContentCacheKey cckey2 = contentCache.createCacheKey(context, window2);
+        assertEquals(cckey2.getKey(), sessionId + "/desktop//about.psml");
+        
+        // create some MockTheme objects
+        MockTheme theme1 = new MockTheme("/default-page.psml");
+        MockTheme theme2 = new MockTheme("/about.psml");
+        
+        // put it in the cache
+        CacheElement element1 = contentCache.createElement(cckey1, theme1);
+        contentCache.put(element1);
+        CacheElement element2 = contentCache.createElement(cckey2, theme2);
+        contentCache.put(element2);
+        
+        // assert the gets
+        Object result1 = contentCache.get(cckey1);
+        assertNotNull(result1);
+        System.out.println("result 1 = " + result1);
+        Object result2 = contentCache.get(cckey2);
+        assertNotNull(result2);
+        System.out.println("result 2 = " + result2);
+        
+        // assert isKey Apis        
+        assertTrue(contentCache.isKeyInCache(cckey1));
+                
+        
+        // test removes
+        contentCache.remove(cckey1);
+        assertFalse(contentCache.isKeyInCache(cckey1));        
+        assertTrue(contentCache.isKeyInCache(cckey2));
+        
+        // test user stuff
+        session = new MockHttpSession();
+        request.setSession(session);        
+        sessionId = session.getId();        
+        request.setUserPrincipal(new MockPrincipal("sean"));        
+        // create a simple key
+        String window3 = "/default-page.psml";
+        ContentCacheKey cckey3 = contentCache.createCacheKey(context, window3);
+        assertEquals(cckey3.getKey(), sessionId + "/desktop//default-page.psml");
+
+        // create a another key for desktop
+        String window4 = "about.psml";
+        ContentCacheKey cckey4 = contentCache.createCacheKey(context, window4);
+        assertEquals(cckey4.getKey(), sessionId + "/desktop/about.psml");
+        
+        // create some PortletContent mock objects
+        MockTheme theme3 = new MockTheme("/default-page.psml");
+        MockTheme theme4 = new MockTheme("/about.psml");
+        
+        // put it in the cache
+        CacheElement element3 = contentCache.createElement(cckey3, theme3);
+        contentCache.put(element3);
+        CacheElement element4 = contentCache.createElement(cckey4, theme4);
+        contentCache.put(element4);
+
+        // assert 3 and 4
+        assertTrue(contentCache.isKeyInCache(cckey3));
+        assertTrue(contentCache.isKeyInCache(cckey4));
+        
+        // remove for user
+        contentCache.evictContentForSession(sessionId);
+        assertFalse(contentCache.isKeyInCache(cckey3));
+        assertFalse(contentCache.isKeyInCache(cckey4));
+        assertTrue(contentCache.isKeyInCache(cckey2));                      
+    }
+    
+    class MockPrincipal implements Principal
+    {
+        private String name;
+        public MockPrincipal(String name)
+        {
+            this.name = name;
+        }
+        
+        public String getName()
+        {
+            return name;
+        }
+    }
+    
+    class MockTheme implements Serializable
+    {
+        private String pageId;
+        
+        public MockTheme(String pageId)
+        {
+            this.pageId = pageId;
+        }
+        
+        public String toString()
+        {
+            return this.pageId;
+        }
+    } 
+    
+}

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java?view=diff&rev=553340&r1=553339&r2=553340
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java Wed Jul  4 15:00:09 2007
@@ -41,13 +41,20 @@
     private NavigationalStateCodec codec;
     private PortletWindowRequestNavigationalStates requestStates;
     protected JetspeedContentCache cache;
+    protected JetspeedContentCache decorationCache;
     
     public AbstractNavigationalState(NavigationalStateCodec codec, JetspeedContentCache cache)
     {
+        this(codec, cache, null);
+    }
+
+    public AbstractNavigationalState(NavigationalStateCodec codec, JetspeedContentCache cache, JetspeedContentCache decorationCache)
+    {
         this.codec = codec;
         this.cache = cache;
+        this.decorationCache = decorationCache;
     }
-
+    
     public void init(String encodedState, String characterEncoding)
     throws UnsupportedEncodingException
     {

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/PortletWindowSessionNavigationalStates.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/PortletWindowSessionNavigationalStates.java?view=diff&rev=553340&r1=553339&r2=553340
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/PortletWindowSessionNavigationalStates.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/PortletWindowSessionNavigationalStates.java Wed Jul  4 15:00:09 2007
@@ -48,7 +48,7 @@
         this.storeParameters = storeParameters;
     }
     
-    public void sync(RequestContext context, Page page, PortletWindowRequestNavigationalStates requestStates, JetspeedContentCache cache)
+    public void sync(RequestContext context, Page page, PortletWindowRequestNavigationalStates requestStates, JetspeedContentCache cache, JetspeedContentCache decorationCache)    
     {
         PageState pageState = (PageState)pageStates.get(page.getId());
         if ( pageState == null )
@@ -147,6 +147,7 @@
             if (changed)
             {
                 removeFromCache(context, requestState.getWindowId(), cache);
+                removeFromCache(context, page.getId(), decorationCache);
                 if (storeParameters)
                 {
                     ((PortletWindowExtendedNavigationalState)sessionState).resetDecoratorActionEncodings();
@@ -169,6 +170,7 @@
                 if (changed)
                 {
                     removeFromCache(context, requestState.getWindowId(), cache);
+                    removeFromCache(context, page.getId(), decorationCache);                    
                     if (storeParameters)
                     {
                         ((PortletWindowExtendedNavigationalState)sessionState).resetDecoratorActionEncodings();
@@ -327,6 +329,8 @@
     
     protected void removeFromCache(RequestContext context, String id, JetspeedContentCache cache)
     {
+        if (cache == null)
+            return;
         ContentCacheKey cacheKey = cache.createCacheKey(context, id);
         if (cache.isKeyInCache(cacheKey))
         {

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/SessionFullNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/SessionFullNavigationalState.java?view=diff&rev=553340&r1=553339&r2=553340
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/SessionFullNavigationalState.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/SessionFullNavigationalState.java Wed Jul  4 15:00:09 2007
@@ -31,6 +31,11 @@
     {
         super(codec, cache);
     }
+    
+    public SessionFullNavigationalState(NavigationalStateCodec codec, JetspeedContentCache cache, JetspeedContentCache decorationCache)
+    {
+        super(codec, cache, decorationCache);
+    }
 
     public boolean isRenderParameterStateFull()
     {

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/SessionNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/SessionNavigationalState.java?view=diff&rev=553340&r1=553339&r2=553340
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/SessionNavigationalState.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/SessionNavigationalState.java Wed Jul  4 15:00:09 2007
@@ -24,6 +24,7 @@
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.cache.JetspeedContentCache;
 import org.apache.jetspeed.container.state.NavigationalState;
+import org.apache.jetspeed.om.page.ContentPage;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.request.RequestContext;
 
@@ -41,6 +42,11 @@
     {
         super(codec, cache);
     }
+    
+    public SessionNavigationalState(NavigationalStateCodec codec, JetspeedContentCache cache, JetspeedContentCache decorationCache)
+    {
+        super(codec, cache, decorationCache);
+    }    
 
     public synchronized void sync(RequestContext context)
     {
@@ -80,6 +86,8 @@
                     if ( sessionStates != null )
                     {
                         sessionStates.removeFromCache(context, clearCacheWindowId, cache);
+                        ContentPage page = context.getPage();
+                        sessionStates.removeFromCache(context, page.getId(), decorationCache);                        
                     }
                 }
             }
@@ -96,7 +104,7 @@
                     session.setAttribute(NavigationalState.NAVSTATE_SESSION_KEY, sessionStates);
                 }
                 Page page = context.getPage();
-                sessionStates.sync(context, page, requestStates, cache);
+                sessionStates.sync(context, (Page) context.getPage(), requestStates, cache, decorationCache);
                 if (isNavigationalParameterStateFull() && isRenderParameterStateFull())
                 {
                     currentPageWindowStates = sessionStates.getWindowStates(page);

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationValve.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationValve.java?view=diff&rev=553340&r1=553339&r2=553340
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationValve.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationValve.java Wed Jul  4 15:00:09 2007
@@ -30,6 +30,8 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.cache.CacheElement;
+import org.apache.jetspeed.cache.ContentCacheKey;
 import org.apache.jetspeed.cache.JetspeedContentCache;
 import org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException;
 import org.apache.jetspeed.container.url.PortalURL;
@@ -82,6 +84,9 @@
     private DecoratorActionsFactory defaultDecoratorActionsFactory;
 
     private JetspeedContentCache cache = null;
+    
+    private boolean useSessionForThemeCaching = false;
+    
     private boolean maxOnEdit = false;
          
      /**
@@ -97,12 +102,20 @@
      public DecorationValve(DecorationFactory decorationFactory, PortletWindowAccessor windowAccessor,
                             SecurityAccessController accessController, JetspeedContentCache cache)
      {    
+         this(decorationFactory, windowAccessor, accessController, cache, false);
+     }
+     
+     public DecorationValve(DecorationFactory decorationFactory, PortletWindowAccessor windowAccessor,
+                                 SecurityAccessController accessController, JetspeedContentCache cache,
+                                 boolean useSessionForThemeCaching)
+     {       
         this.decorationFactory = decorationFactory;
         this.windowAccessor = windowAccessor;
         this.defaultDecoratorActionsFactory = new DefaultDecoratorActionsFactory();        
         //added the accessController in portlet decorater for checking the actions
         this.accessController = accessController;        
         this.cache = cache;
+        this.useSessionForThemeCaching = useSessionForThemeCaching;
     }
     
     public void invoke(RequestContext requestContext, ValveContext context) throws PipelineException
@@ -138,29 +151,37 @@
         }
         
         PageActionAccess pageActionAccess = (PageActionAccess)requestContext.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
-        
         String themeCacheKey = null;
+        ContentCacheKey themeContentCacheKey = null;
         Theme theme = null;
         
         if (useCache())
         {
-            // user helps us with the funky way jetspeed doesn't create  a new session on login
-            themeCacheKey = cache.createSessionKey(requestContext);
-            theme = (Theme) requestContext.getSessionAttribute(themeCacheKey);
-        }        
+            if (pageActionAccess.isEditing() == false)
+            {
+                // user helps us with the funky way jetspeed doesn't create  a new session on login
+                if (this.useSessionForThemeCaching)
+                {
+                    themeCacheKey = cache.createSessionKey(requestContext);
+                    theme = (Theme) requestContext.getSessionAttribute(themeCacheKey);
+                }
+                else
+                {
+                    themeContentCacheKey = cache.createCacheKey(requestContext, page.getId());
+                    CacheElement themeCacheElem = cache.get(themeContentCacheKey);
+                    
+                    if (themeCacheElem != null)
+                    {
+                        theme = (Theme) themeCacheElem.getContent();
+                    }
+                }
+            }
+        }
 
         if (theme != null)
         {
             theme.init(page, decorationFactory, requestContext);
             requestContext.setAttribute(PortalReservedParameters.PAGE_THEME_ATTRIBUTE, theme);
-            
-            Page themePage = ((PageTheme) theme).getPage();
-            Fragment themeFragment = themePage.getRootFragment();
-            page.setRootFragment(themeFragment);
-            
-            ContentPage contentThemePage = ((PageTheme)theme).getContentPage();
-            ContentFragment contentThemeFragment = contentThemePage.getRootContentFragment();
-            page.setRootContentFragment(contentThemeFragment);                        
             boolean solo = isSoloMode(requestContext);            
             SessionPathResolverCache sessionPathResolver = new SessionPathResolverCache( requestContext.getRequest().getSession() );
             initDepthFragmentDecorations(requestContext, theme, page.getRootContentFragment(),
@@ -170,7 +191,15 @@
             
             if (theme.isInvalidated() && !solo)
             {
-                requestContext.setSessionAttribute(themeCacheKey, theme);
+                if (this.useSessionForThemeCaching)
+                {
+                    requestContext.setSessionAttribute(themeCacheKey, theme);
+                }
+                else
+                {                    
+                    CacheElement themeCacheElem = cache.createElement(themeContentCacheKey, theme);
+                    cache.put(themeCacheElem);
+                }
                 theme.setInvalidated(false);                            
             }                        
             return;
@@ -191,11 +220,34 @@
                 initFragment(requestContext, theme, fragment, pageActionAccess, isAjaxRequest);
             }
         }
-        if (useCache())
+        
+        if (useCache() && !isSoloMode(requestContext))
         {
-            if (!isSoloMode(requestContext))
+            if (themeContentCacheKey == null && themeCacheKey == null)
+            {
+                if (this.useSessionForThemeCaching)
+                {
+                    themeCacheKey = cache.createSessionKey(requestContext);                    
+                    requestContext.getRequest().getSession().removeAttribute(themeCacheKey);
+                }
+                else
+                {
+                    themeContentCacheKey = cache.createCacheKey(requestContext, page.getId());
+                    cache.remove(themeContentCacheKey);
+                }                
+            }
+            else
             {
-                requestContext.setSessionAttribute(themeCacheKey, theme);
+                if (this.useSessionForThemeCaching)
+                {
+                    themeContentCacheKey = cache.createCacheKey(requestContext, page.getId());
+                    requestContext.setSessionAttribute(themeCacheKey, theme);
+                }
+                else
+                {
+                    CacheElement themeCacheElem = cache.createElement(themeContentCacheKey, theme);
+                    cache.put(themeCacheElem);
+                }
             }
         }                
     }

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java?view=diff&rev=553340&r1=553339&r2=553340
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java Wed Jul  4 15:00:09 2007
@@ -352,10 +352,34 @@
         String ipAddress = (String)se.getSession().getAttribute(SecurityValve.IP_ADDRESS);
         statistics.logUserLogout(ipAddress, subjectUserPrincipal.getName(), sessionLength);    
         JetspeedCache portletContentCache = (JetspeedCache)engine.getComponentManager().getComponent("portletContentCache");
+        JetspeedCache decorationContentCache = null;
+        
+        try
+        {
+            decorationContentCache = (JetspeedCache)engine.getComponentManager().getComponent("decorationContentCache");
+        }
+        catch (Exception e)
+        {
+        }
+        
         ContentCacheKeyGenerator generator = (ContentCacheKeyGenerator)engine.getComponentManager().getComponent("ContentCacheKeyGenerator");
+        
         if (generator.isCacheBySessionId())
+        {
             portletContentCache.evictContentForUser(se.getSession().getId());
+            
+            if (decorationContentCache != null)
+            {
+                decorationContentCache.evictContentForUser(se.getSession().getId());
+            }
+        }
         else
-            portletContentCache.evictContentForUser(subjectUserPrincipal.getName());        
+        {
+            portletContentCache.evictContentForUser(subjectUserPrincipal.getName());
+            
+            if (decorationContentCache != null)
+            {
+                decorationContentCache.evictContentForUser(subjectUserPrincipal.getName());            }
+        }
     }
 }

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java?view=diff&rev=553340&r1=553339&r2=553340
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java Wed Jul  4 15:00:09 2007
@@ -51,4 +51,6 @@
     public final static String CPS_PORTLET_TRACKING_MANAGER = "cps:PortletTrackingManager";
     public final static String CPS_PORTAL_CONFIGURATION = "cps:PortalConfiguration";
     public final static String CPS_IMPORTER_MANAGER = "cps:ImporterManager";
+    public final static String CPS_DECORATOR_CACHE = "cps:decorationContentCache";
+    public final static String CPS_PORTLET_CACHE = "cps:portletContentCache";
 }

Modified: portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java?view=diff&rev=553340&r1=553339&r2=553340
==============================================================================
--- portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java (original)
+++ portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java Wed Jul  4 15:00:09 2007
@@ -36,6 +36,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.CommonPortletServices;
 import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.cache.JetspeedContentCache;
 import org.apache.jetspeed.decoration.DecorationFactory;
 import org.apache.jetspeed.decoration.PageEditAccess;
 import org.apache.jetspeed.desktop.JetspeedDesktop;
@@ -68,6 +69,7 @@
     private String editorType = null;
     protected DecorationFactory decorators;
     protected JetspeedDesktop desktop;
+    protected JetspeedContentCache decoratorCache;
 
     public void init( PortletConfig config ) throws PortletException
     {
@@ -107,6 +109,8 @@
         }
         
         this.desktop = (JetspeedDesktop)getPortletContext().getAttribute(CommonPortletServices.CPS_DESKTOP);
+        
+        this.decoratorCache = (JetspeedContentCache)getPortletContext().getAttribute(CommonPortletServices.CPS_DECORATOR_CACHE);
     }
 
     public void doView( RenderRequest request, RenderResponse response ) throws PortletException, IOException
@@ -187,6 +191,8 @@
             // Targetting this portlet with an ActionRequest REQUIRES that the ProfilerValve has been invoked!
             throw new PortletException("Current request page or PageEditAccess not available.");
         }
+
+        decoratorCache.invalidate(requestContext);
         
         String pageMode = request.getParameter("pageMode");
         if ( pageMode != null )

Modified: portals/jetspeed-2/trunk/layout-portlets/src/webapp/WEB-INF/jetspeed-portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/layout-portlets/src/webapp/WEB-INF/jetspeed-portlet.xml?view=diff&rev=553340&r1=553339&r2=553340
==============================================================================
--- portals/jetspeed-2/trunk/layout-portlets/src/webapp/WEB-INF/jetspeed-portlet.xml (original)
+++ portals/jetspeed-2/trunk/layout-portlets/src/webapp/WEB-INF/jetspeed-portlet.xml Wed Jul  4 15:00:09 2007
@@ -39,6 +39,8 @@
 		<js:service name='WindowAccessor'/>
         <js:service name='WindowAccessor'/>
         <js:service name='Desktop'/>
+        <js:service name='decorationContentCache'/>
+        <js:service name='portletContentCache'/>        
 	</js:services>
 	
 </portlet-app>

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/cache.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/cache.xml?view=diff&rev=553340&r1=553339&r2=553340
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/cache.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/cache.xml Wed Jul  4 15:00:09 2007
@@ -67,6 +67,27 @@
 		   <ref bean="ContentCacheKeyGenerator"/>
 		</constructor-arg>
 	</bean>
+    
+	<bean id="ehDecorationContentCache"
+		class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+		<property name="cacheManager">
+			<ref local="cacheManager" />
+		</property>
+		<property name="cacheName" value="decorationContentCache" />
+	</bean>
+
+	<bean id="decorationContentCache"
+		class="org.apache.jetspeed.cache.impl.EhDecorationContentCacheImpl">
+		<constructor-arg index="0">
+			<ref bean="ehDecorationContentCache" />
+		</constructor-arg>
+		<constructor-arg index="1">
+			<ref bean="preferencesCache" />
+		</constructor-arg>
+		<constructor-arg index="2">
+		   <ref bean="ContentCacheKeyGenerator"/>
+		</constructor-arg>
+	</bean>
 
 	<bean id="ehPreferencesCache"
 		class="org.springframework.cache.ehcache.EhCacheFactoryBean">

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/jetspeed-services.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/jetspeed-services.xml?view=diff&rev=553340&r1=553339&r2=553340
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/jetspeed-services.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/jetspeed-services.xml Wed Jul  4 15:00:09 2007
@@ -117,7 +117,12 @@
           <entry key="ImporterManager">
             <ref bean="importerCastorPageManager"/>
           </entry>          
-          
+          <entry key="decorationContentCache">
+          	<ref bean="decorationContentCache"/>
+          </entry>
+          <entry key="portletContentCache">
+          	<ref bean="portletContentCache"/>
+          </entry>          
 <!-- first uncomment the below service bean in security-spi-atn.xml
          <entry key="PasswordEncodingService">
            <ref bean="org.apache.jetspeed.security.PasswordEncodingService" />

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/pipelines.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/pipelines.xml?view=diff&rev=553340&r1=553339&r2=553340
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/pipelines.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/pipelines.xml Wed Jul  4 15:00:09 2007
@@ -261,7 +261,7 @@
 		</constructor-arg>
 		<!-- 
        <constructor-arg index='3'>
-        	<ref bean="portletContentCache"/>
+	        <ref bean="decorationContentCache"/>
         </constructor-arg>       		
          -->
          <!-- When clicking on Edit Mode, also switch to Maximize -->

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/portal-url-generation.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/portal-url-generation.xml?view=diff&rev=553340&r1=553339&r2=553340
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/portal-url-generation.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/portal-url-generation.xml Wed Jul  4 15:00:09 2007
@@ -33,7 +33,10 @@
        <constructor-arg><ref bean="NavigationalStateCodec"/></constructor-arg>
        <constructor-arg>
         	<ref bean="portletContentCache"/>
-        </constructor-arg>       
+       </constructor-arg>       
+       <constructor-arg>
+        	<ref bean="decorationContentCache"/>
+       </constructor-arg>       
   </bean>
   
   <!-- PortalURL we are currently using -->



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