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 ta...@apache.org on 2007/06/26 03:41:36 UTC
svn commit: r550655 - in /portals/jetspeed-2/trunk:
components/cm/src/java/org/apache/jetspeed/cache/impl/
components/page-manager/src/java/org/apache/jetspeed/om/page/
components/page-manager/src/java/org/apache/jetspeed/om/page/psml/
components/page-...
Author: taylor
Date: Mon Jun 25 18:41:35 2007
New Revision: 550655
URL: http://svn.apache.org/viewvc?view=rev&rev=550655
Log:
https://issues.apache.org/jira/browse/JS2-739
Checkpoint
Functional and passing tests, need a few more areas of improvement, checking in for review
Added:
portals/jetspeed-2/trunk/components/page-manager/testdata/pages/pageWithSomeIds.psml
portals/jetspeed-2/trunk/components/page-manager/testdata/pages/pageWithoutIds.psml
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedContentCache.java
Modified:
portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhPortletContentCacheImpl.java
portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java
portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java
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/HybridNavigationalState.java
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/PathNavigationalState.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/BaseDecoration.java
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.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/decoration/PageTheme.java
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java
portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/container/state/TestNavigationalState.java
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Theme.java
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/ContentPage.java
portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java
portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/pipelines.xml
portals/jetspeed-2/trunk/src/webapp/WEB-INF/web.xml
Modified: portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhPortletContentCacheImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhPortletContentCacheImpl.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhPortletContentCacheImpl.java (original)
+++ portals/jetspeed-2/trunk/components/cm/src/java/org/apache/jetspeed/cache/impl/EhPortletContentCacheImpl.java Mon Jun 25 18:41:35 2007
@@ -32,6 +32,8 @@
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.decoration.Theme;
import org.apache.jetspeed.request.RequestContext;
/**
@@ -40,7 +42,7 @@
* @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
* @version $Id: $
*/
-public class EhPortletContentCacheImpl extends EhCacheImpl implements JetspeedCache, JetspeedCacheEventListener
+public class EhPortletContentCacheImpl extends EhCacheImpl implements JetspeedContentCache, JetspeedCacheEventListener
{
JetspeedCache preferenceCache = null;
@@ -306,5 +308,22 @@
// 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)
+ {
+ String themeCacheKey = createSessionKey(context);
+ Theme theme = (Theme)context.getRequest().getSession().getAttribute(themeCacheKey);
+ theme.setInvalidated(true);
}
}
Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/ContentPageImpl.java Mon Jun 25 18:41:35 2007
@@ -38,11 +38,16 @@
private final Page page;
private final Map cachedFragments;
private ContentFragment rootContentFragment;
-
+
public ContentPageImpl(Page page)
{
this.page = page;
this.cachedFragments = new HashMap();
+ }
+
+ public void setRootContentFragment(ContentFragment frag)
+ {
+ this.rootContentFragment = frag;
}
public String toString()
Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java (original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java Mon Jun 25 18:41:35 2007
@@ -159,7 +159,10 @@
public void setRootFragment( Fragment root )
{
this.root = root;
- ((FragmentImpl)root).setPage(this);
+ if (root instanceof FragmentImpl)
+ {
+ ((FragmentImpl)root).setPage(this);
+ }
}
public Fragment getFragmentById( String id )
Added: portals/jetspeed-2/trunk/components/page-manager/testdata/pages/pageWithSomeIds.psml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/page-manager/testdata/pages/pageWithSomeIds.psml?view=auto&rev=550655
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/testdata/pages/pageWithSomeIds.psml (added)
+++ portals/jetspeed-2/trunk/components/page-manager/testdata/pages/pageWithSomeIds.psml Mon Jun 25 18:41:35 2007
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<page id="test001" version='2.77'
+ xmlns="http://portals.apache.org/jetspeed"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/psml.xsd">
+ <title>Test Page</title>
+ <metadata name="description">Test001 description</metadata>
+ <metadata name="description" xml:lang="en">En Descr</metadata>
+ <metadata name="subject">Test Subject</metadata>
+ <defaults
+ skin="test-skin"
+ layout-decorator="test-layout"
+ portlet-decorator="test-portlet"
+ />
+ <fragment id="pe001" type="layout" name="TwoColumns">
+ <fragment type="portlet" name="JMXPortlet">
+ <property layout="TwoColumns" name="row" value="0" />
+ <property layout="TwoColumns" name="column" value="1" />
+ </fragment>
+ <fragment type="portlet" name="JMXPortlet">
+ <property layout="TwoColumns" name="row" value="0" />
+ <property layout="TwoColumns" name="column" value="1" />
+ </fragment>
+ <fragment id="pe003" type="portlet" name="JMXPortlet">
+ <property layout="TwoColumns" name="row" value="0" />
+ <property layout="TwoColumns" name="column" value="1" />
+ </fragment>
+ <fragment type="portlet" name="JMXPortlet">
+ <property layout="TwoColumns" name="row" value="0" />
+ <property layout="TwoColumns" name="column" value="1" />
+ </fragment>
+ </fragment>
+
+ <menu name="simple">
+ <options>/folder1/folder1</options>
+ <options>/folder1/folder2</options>
+ </menu>
+
+</page>
Added: portals/jetspeed-2/trunk/components/page-manager/testdata/pages/pageWithoutIds.psml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/page-manager/testdata/pages/pageWithoutIds.psml?view=auto&rev=550655
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/testdata/pages/pageWithoutIds.psml (added)
+++ portals/jetspeed-2/trunk/components/page-manager/testdata/pages/pageWithoutIds.psml Mon Jun 25 18:41:35 2007
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<page id="test001" version='2.77'
+ xmlns="http://portals.apache.org/jetspeed"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/psml.xsd">
+ <title>Test Page</title>
+ <metadata name="description">Test001 description</metadata>
+ <metadata name="description" xml:lang="en">En Descr</metadata>
+ <metadata name="subject">Test Subject</metadata>
+ <defaults
+ skin="test-skin"
+ layout-decorator="test-layout"
+ portlet-decorator="test-portlet"
+ />
+ <fragment id="" type="layout" name="TwoColumns">
+ <fragment type="portlet" name="JMXPortlet">
+ <property layout="TwoColumns" name="row" value="0" />
+ <property layout="TwoColumns" name="column" value="1" />
+ </fragment>
+ <fragment type="portlet" name="JMXPortlet">
+ <property layout="TwoColumns" name="row" value="0" />
+ <property layout="TwoColumns" name="column" value="1" />
+ </fragment>
+ <fragment id="" type="portlet" name="JMXPortlet">
+ <property layout="TwoColumns" name="row" value="0" />
+ <property layout="TwoColumns" name="column" value="1" />
+ </fragment>
+ <fragment type="portlet" name="JMXPortlet">
+ <property layout="TwoColumns" name="row" value="0" />
+ <property layout="TwoColumns" name="column" value="1" />
+ </fragment>
+ </fragment>
+
+ <menu name="simple">
+ <options>/folder1/folder1</options>
+ <options>/folder1/folder2</options>
+ </menu>
+
+</page>
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=550655&r1=550654&r2=550655
==============================================================================
--- 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 Mon Jun 25 18:41:35 2007
@@ -25,7 +25,7 @@
import javax.portlet.WindowState;
import org.apache.jetspeed.JetspeedActions;
-import org.apache.jetspeed.cache.JetspeedCache;
+import org.apache.jetspeed.cache.JetspeedContentCache;
import org.apache.jetspeed.container.state.MutableNavigationalState;
import org.apache.jetspeed.om.common.portlet.PortletApplication;
import org.apache.pluto.om.window.PortletWindow;
@@ -40,9 +40,9 @@
{
private NavigationalStateCodec codec;
private PortletWindowRequestNavigationalStates requestStates;
- protected JetspeedCache cache;
+ protected JetspeedContentCache cache;
- public AbstractNavigationalState(NavigationalStateCodec codec, JetspeedCache cache)
+ public AbstractNavigationalState(NavigationalStateCodec codec, JetspeedContentCache cache)
{
this.codec = codec;
this.cache = cache;
Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java Mon Jun 25 18:41:35 2007
@@ -24,7 +24,7 @@
import javax.portlet.PortletMode;
import javax.portlet.WindowState;
-import org.apache.jetspeed.cache.JetspeedCache;
+import org.apache.jetspeed.cache.JetspeedContentCache;
import org.apache.pluto.om.window.PortletWindow;
/**
@@ -39,7 +39,7 @@
{
protected String prefix;
- public HybridNavigationalState(NavigationalStateCodec codec, String prefix, JetspeedCache cache)
+ public HybridNavigationalState(NavigationalStateCodec codec, String prefix, JetspeedContentCache cache)
{
super(codec, cache);
this.prefix = prefix;
Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/PathNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/PathNavigationalState.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/PathNavigationalState.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/state/impl/PathNavigationalState.java Mon Jun 25 18:41:35 2007
@@ -16,7 +16,7 @@
*/
package org.apache.jetspeed.container.state.impl;
-import org.apache.jetspeed.cache.JetspeedCache;
+import org.apache.jetspeed.cache.JetspeedContentCache;
import org.apache.jetspeed.request.RequestContext;
/**
@@ -29,7 +29,7 @@
public class PathNavigationalState extends AbstractNavigationalState
{
- public PathNavigationalState(NavigationalStateCodec codec, JetspeedCache cache)
+ public PathNavigationalState(NavigationalStateCodec codec, JetspeedContentCache cache)
{
super(codec, cache);
}
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=550655&r1=550654&r2=550655
==============================================================================
--- 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 Mon Jun 25 18:41:35 2007
@@ -26,7 +26,7 @@
import org.apache.jetspeed.Jetspeed;
import org.apache.jetspeed.cache.ContentCacheKey;
-import org.apache.jetspeed.cache.JetspeedCache;
+import org.apache.jetspeed.cache.JetspeedContentCache;
import org.apache.jetspeed.container.window.PortletWindowAccessor;
import org.apache.jetspeed.om.page.Page;
import org.apache.jetspeed.request.RequestContext;
@@ -48,7 +48,7 @@
this.storeParameters = storeParameters;
}
- public void sync(RequestContext context, Page page, PortletWindowRequestNavigationalStates requestStates, JetspeedCache cache)
+ public void sync(RequestContext context, Page page, PortletWindowRequestNavigationalStates requestStates, JetspeedContentCache cache)
{
PageState pageState = (PageState)pageStates.get(page.getId());
if ( pageState == null )
@@ -174,8 +174,8 @@
{
if (req == null)
{
- if (ses != null && !ses.equals(PortletMode.VIEW))
- return true;
+ //if (ses != null && !ses.equals(PortletMode.VIEW))
+ // return true;
return false;
}
else
@@ -194,8 +194,8 @@
{
if (req == null)
{
- if (ses != null && !ses.equals(WindowState.NORMAL))
- return true;
+ //if (ses != null && !ses.equals(WindowState.NORMAL))
+ // return true;
return false;
}
else
@@ -317,13 +317,13 @@
return false;
}
- protected void removeFromCache(RequestContext context, String id, JetspeedCache cache)
+ protected void removeFromCache(RequestContext context, String id, JetspeedContentCache cache)
{
ContentCacheKey cacheKey = cache.createCacheKey(context, id);
if (cache.isKeyInCache(cacheKey))
{
cache.remove(cacheKey);
}
-
+ cache.invalidate(context);
}
}
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=550655&r1=550654&r2=550655
==============================================================================
--- 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 Mon Jun 25 18:41:35 2007
@@ -16,7 +16,7 @@
*/
package org.apache.jetspeed.container.state.impl;
-import org.apache.jetspeed.cache.JetspeedCache;
+import org.apache.jetspeed.cache.JetspeedContentCache;
/**
@@ -27,7 +27,7 @@
*/
public class SessionFullNavigationalState extends SessionNavigationalState
{
- public SessionFullNavigationalState(NavigationalStateCodec codec, JetspeedCache cache)
+ public SessionFullNavigationalState(NavigationalStateCodec codec, JetspeedContentCache cache)
{
super(codec, cache);
}
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=550655&r1=550654&r2=550655
==============================================================================
--- 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 Mon Jun 25 18:41:35 2007
@@ -20,7 +20,7 @@
import javax.servlet.http.HttpSession;
import org.apache.jetspeed.JetspeedActions;
-import org.apache.jetspeed.cache.JetspeedCache;
+import org.apache.jetspeed.cache.JetspeedContentCache;
import org.apache.jetspeed.container.state.NavigationalState;
import org.apache.jetspeed.request.RequestContext;
@@ -32,7 +32,7 @@
*/
public class SessionNavigationalState extends AbstractNavigationalState
{
- public SessionNavigationalState(NavigationalStateCodec codec, JetspeedCache cache)
+ public SessionNavigationalState(NavigationalStateCodec codec, JetspeedContentCache cache)
{
super(codec, cache);
}
Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/BaseDecoration.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/BaseDecoration.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/BaseDecoration.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/BaseDecoration.java Mon Jun 25 18:41:35 2007
@@ -17,6 +17,7 @@
package org.apache.jetspeed.decoration;
import java.io.File;
+import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
@@ -44,17 +45,17 @@
* @see org.apache.jetspeed.decoration.PortletDecoration
*
*/
-public class BaseDecoration implements Decoration
+public class BaseDecoration implements Decoration, Serializable
{
private static final Log log = LogFactory.getLog(BaseDecoration.class);
protected static final String NO_SUCH_RESOURCE = "no_such_resource";
- protected final Properties config;
- private final ResourceValidator validator;
+ protected transient Properties config;
+ private transient ResourceValidator validator;
private final String name;
private final Path basePath;
private final Path baseClientPath;
- private final PathResolverCache cache;
+ private transient PathResolverCache cache;
private final String commonStylesheet;
private final String portalStylesheet;
private final String desktopStylesheet;
@@ -100,6 +101,13 @@
log.info( "BaseDecoration baseClientPath: " + baseClientPath.toString() );
}
+
+ public void init(Properties config, ResourceValidator validator, PathResolverCache cache)
+ {
+ this.config = config;
+ this.validator = validator;
+ this.cache = cache;
+ }
public String getName()
{
@@ -124,9 +132,10 @@
{
Path workingPath = baseClientPath.getChild( path );
- if( cache.getPath( workingPath.toString() ) != null )
+ String hit = cache.getPath( workingPath.toString());
+ if( hit != null )
{
- return cache.getPath( workingPath.toString() );
+ return hit;
}
else
{
Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java Mon Jun 25 18:41:35 2007
@@ -62,9 +62,9 @@
private final ResourceValidator validator;
private final PortletRegistry registry;
-
- private ServletContext servletContext;
+ private ServletContext servletContext;
+
private String defaultDesktopLayoutDecoration = null;
private String defaultDesktopPortletDecoration = null;
@@ -86,9 +86,10 @@
{
this( null, decorationsPath, validator );
}
+
public DecorationFactoryImpl( PortletRegistry registry,
- String decorationsPath,
- ResourceValidator validator )
+ String decorationsPath,
+ ResourceValidator validator )
{
this.registry = registry;
this.decorationsPath = new Path( decorationsPath );
@@ -98,10 +99,15 @@
this.portletDecorationsPathStr = this.portletDecorationsPath.toString();
this.validator = validator;
}
+
+ public ResourceValidator getResourceValidator()
+ {
+ return validator;
+ }
public Theme getTheme( Page page, RequestContext requestContext )
{
- return new PageTheme( page, this, requestContext );
+ return new PageTheme(page, this, requestContext);
}
public Decoration getDecoration( Page page, Fragment fragment, RequestContext requestContext )
@@ -150,7 +156,6 @@
{
Path basePath = getPortletDecorationBasePath( name );
Path baseClientPath = createClientPath( name, (Path)basePath.clone(), requestContext, Fragment.PORTLET );
-
Properties configuration = getConfiguration( name, Fragment.PORTLET );
SessionPathResolverCache sessionPathResolver = new SessionPathResolverCache( requestContext.getRequest().getSession() );
return new PortletDecorationImpl( configuration, validator, basePath, baseClientPath, sessionPathResolver );
@@ -160,7 +165,6 @@
{
Path basePath = getLayoutDecorationBasePath( name );
Path baseClientPath = createClientPath( name, (Path)basePath.clone(), requestContext, Fragment.LAYOUT );
-
Properties configuration = getConfiguration( name, Fragment.LAYOUT );
SessionPathResolverCache sessionPathResolver = new SessionPathResolverCache( requestContext.getRequest().getSession() );
return new LayoutDecorationImpl( configuration, validator, basePath, baseClientPath, sessionPathResolver );
@@ -184,7 +188,7 @@
* @return <code>java.util.Properties</code> representing the configuration
* object.
*/
- protected Properties getConfiguration( String name, String type )
+ public Properties getConfiguration( String name, String type )
{
Properties props = null;
if ( type.equals( Fragment.PORTLET ) )
@@ -327,6 +331,7 @@
{
return createClientPath( name, null, requestContext, decorationType );
}
+
private Path createClientPath( String name, Path basePath, RequestContext requestContext, String decorationType )
{
if ( basePath == null )
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=550655&r1=550654&r2=550655
==============================================================================
--- 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 Mon Jun 25 18:41:35 2007
@@ -21,22 +21,27 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Properties;
import javax.portlet.PortletMode;
import javax.portlet.WindowState;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.JetspeedActions;
import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.cache.JetspeedContentCache;
import org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException;
import org.apache.jetspeed.container.url.PortalURL;
import org.apache.jetspeed.container.window.FailedToRetrievePortletWindow;
import org.apache.jetspeed.container.window.PortletWindowAccessor;
+import org.apache.jetspeed.decoration.caches.SessionPathResolverCache;
import org.apache.jetspeed.om.common.portlet.PortletApplication;
import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
import org.apache.jetspeed.om.page.ContentFragment;
import org.apache.jetspeed.om.page.ContentPage;
import org.apache.jetspeed.om.page.Fragment;
+import org.apache.jetspeed.om.page.Page;
import org.apache.jetspeed.pipeline.PipelineException;
import org.apache.jetspeed.pipeline.valve.AbstractValve;
import org.apache.jetspeed.pipeline.valve.Valve;
@@ -76,38 +81,46 @@
private DecoratorActionsFactory defaultDecoratorActionsFactory;
+ private JetspeedContentCache cache = null;
+
/**
* For security constraint checks
*/
protected SecurityAccessController accessController;
-
+
public DecorationValve(DecorationFactory decorationFactory, PortletWindowAccessor windowAccessor,SecurityAccessController accessController)
+ {
+ this(decorationFactory, windowAccessor, accessController, null);
+ }
+
+ public DecorationValve(DecorationFactory decorationFactory, PortletWindowAccessor windowAccessor,
+ SecurityAccessController accessController, JetspeedContentCache cache)
{
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;
}
-
public void invoke(RequestContext requestContext, ValveContext context) throws PipelineException
{
+ long start = System.currentTimeMillis();
boolean isAjaxRequest = (context == null);
- if (requestContext.getRequest().getParameter("clearThemeCache") != null)
- {
- decorationFactory.clearCache(requestContext);
- }
-
initFragments( requestContext, isAjaxRequest, null );
+ long end = System.currentTimeMillis();
+ // TODO: remove this
+ System.out.println(end - start);
if (!isAjaxRequest)
{
context.invokeNext(requestContext);
}
}
+
public void initFragments( RequestContext requestContext, boolean isAjaxRequest, List fragments )
{
if (isAjaxRequest)
@@ -125,13 +138,51 @@
.getSessionAttribute(PortalReservedParameters.PAGE_THEME_OVERRIDE_ATTRIBUTE);
page.setDefaultDecorator(decoratorName, Fragment.LAYOUT);
}
-
- Theme theme = decorationFactory.getTheme(page, requestContext);
-
- requestContext.setAttribute(PortalReservedParameters.PAGE_THEME_ATTRIBUTE, theme);
-
+
PageActionAccess pageActionAccess = (PageActionAccess)requestContext.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
+ String themeCacheKey = 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 (theme != null)
+ {
+ System.out.println("Reusing Theme " + themeCacheKey);
+ theme.init(page, decorationFactory, requestContext);
+ requestContext.setAttribute(PortalReservedParameters.PAGE_THEME_ATTRIBUTE, theme);
+
+ Page themePage = ((PageTheme) theme).getPage();
+ Fragment themeFragment = themePage.getRootFragment();
+ page.setRootFragment(themeFragment);
+
+ // TODO: IS THIS NECESSARY????
+ 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(),
+ pageActionAccess, isAjaxRequest,
+ ((DecorationFactoryImpl) decorationFactory).getResourceValidator(),
+ sessionPathResolver, (theme.isInvalidated() && !solo));
+
+ if (theme.isInvalidated() && !solo)
+ {
+ System.out.println("*** INVALIDATED: " + themeCacheKey);
+ requestContext.setSessionAttribute(themeCacheKey, theme);
+ theme.setInvalidated(false);
+ }
+ return;
+ }
+ System.out.println("*** new" );
+ theme = decorationFactory.getTheme(page, requestContext);
+ requestContext.setAttribute(PortalReservedParameters.PAGE_THEME_ATTRIBUTE, theme);
if ( fragments == null || fragments.size() == 0 )
{
ContentFragment rootFragment = page.getRootContentFragment();
@@ -146,9 +197,32 @@
initFragment(requestContext, theme, fragment, pageActionAccess, isAjaxRequest);
}
}
+ if (useCache())
+ {
+ if (!isSoloMode(requestContext))
+ {
+ requestContext.setSessionAttribute(themeCacheKey, theme);
+ }
+ }
}
-
+ protected boolean isSoloMode(RequestContext requestContext)
+ {
+ boolean solo = false;
+ PortletWindow window = requestContext.getPortalURL().getNavigationalState().getMaximizedWindow();
+ boolean maximized = (window != null);
+ if (maximized)
+ {
+ solo = JetspeedActions.SOLO_STATE.equals(requestContext.getPortalURL().getNavigationalState().getMappedState(window));
+ }
+ return solo;
+ }
+
+ protected boolean useCache()
+ {
+ return this.cache != null;
+ }
+
public String toString()
{
return "DecorationValve";
@@ -156,6 +230,7 @@
public DecoratorActionsFactory getDecoratorActionsAdapter(Decoration decoration)
{
+ // FIXME: why always get this property
String decoratorActionsAdapterClassName = decoration.getProperty("actions.factory");
if ( decoratorActionsAdapterClassName == null )
{
@@ -445,5 +520,59 @@
return fragmentSupportsActions;
}
-
+ /**
+ * Reintializes all fragments with there decorations and portlet modes
+ * and winodw states after theme is restored from cache.
+ *
+ * @param requestContext RequestContext of the current portal request.
+ * @param theme
+ * @param fragment
+ * @param pageActionAccess
+ * @param isAjaxRequest
+ * @param validator
+ * @param pathResolverCache
+ */
+ protected void initDepthFragmentDecorations(RequestContext requestContext,
+ Theme theme,
+ ContentFragment fragment,
+ PageActionAccess pageActionAccess,
+ boolean isAjaxRequest,
+ ResourceValidator validator,
+ PathResolverCache pathResolverCache,
+ boolean reloadActionList)
+ {
+ final List contentFragments = fragment.getContentFragments();
+
+ if(contentFragments != null && contentFragments.size() > 0)
+ {
+ Iterator itr = contentFragments.iterator();
+ while(itr.hasNext())
+ {
+ ContentFragment aFragment = (ContentFragment) itr.next();
+ initDepthFragmentDecorations(requestContext, theme, aFragment,
+ pageActionAccess, isAjaxRequest,
+ validator, pathResolverCache, reloadActionList);
+ }
+ }
+
+ try
+ {
+ // PageTheme::getDecoration retrieves cached decoration only.
+ Decoration decoration = theme.getDecoration(fragment);
+ // re-init to set transient memebers.
+ Properties config = ((DecorationFactoryImpl) decorationFactory).getConfiguration(decoration.getName(), fragment.getType());
+ ((BaseDecoration) decoration).init(config, validator, pathResolverCache);
+ // fragment is newly created on every request, so reset decoration for fragment.
+ fragment.setDecoration(decoration);
+
+ if (reloadActionList)
+ {
+ initActionsForFragment(requestContext, fragment, pageActionAccess, decoration, isAjaxRequest);
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn("Unable to initalize actions for fragment "+fragment.getId(), e);
+ }
+ }
}
Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/PageTheme.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/PageTheme.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/PageTheme.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/PageTheme.java Mon Jun 25 18:41:35 2007
@@ -16,16 +16,18 @@
*/
package org.apache.jetspeed.decoration;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
-import java.util.ArrayList;
import java.util.Map;
import java.util.Set;
-import java.util.Collection;
-import java.util.Collections;
+import org.apache.jetspeed.om.page.ContentPage;
import org.apache.jetspeed.om.page.Fragment;
import org.apache.jetspeed.om.page.Page;
import org.apache.jetspeed.request.RequestContext;
@@ -37,16 +39,17 @@
*
* @see org.apache.jetspeed.decoration.Theme
*/
-public class PageTheme implements Theme
+public class PageTheme implements Theme, Serializable
{
- private final Page page;
- private final DecorationFactory decorationFactory;
- private final RequestContext requestContext;
+ private transient Page page;
+ private transient DecorationFactory decorationFactory;
+ private transient RequestContext requestContext;
private final Set styleSheets;
private final LayoutDecoration layoutDecoration;
private final Map fragmentDecorations;
private final Collection portletDecorationNames;
-
+ private boolean invalidated = false;
+
public PageTheme(Page page, DecorationFactory decorationFactory, RequestContext requestContext)
{
this.page = page;
@@ -150,4 +153,30 @@
return layoutDecoration;
}
+ public void init(Page page, DecorationFactory decoration, RequestContext context)
+ {
+ this.page = page;
+ this.decorationFactory = decoration;
+ this.requestContext = context;
+ }
+
+ public Page getPage()
+ {
+ return page;
+ }
+
+ public ContentPage getContentPage()
+ {
+ return (ContentPage)page;
+ }
+
+ public boolean isInvalidated()
+ {
+ return this.invalidated;
+ }
+
+ public void setInvalidated(boolean flag)
+ {
+ this.invalidated = flag;
+ }
}
Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java Mon Jun 25 18:41:35 2007
@@ -29,7 +29,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.jetspeed.PortalReservedParameters;
import org.apache.jetspeed.cache.ContentCacheKey;
-import org.apache.jetspeed.cache.JetspeedCache;
+import org.apache.jetspeed.cache.JetspeedContentCache;
import org.apache.jetspeed.container.window.PortletWindowAccessor;
import org.apache.jetspeed.exception.JetspeedException;
import org.apache.jetspeed.om.common.portlet.MutablePortletEntity;
@@ -70,16 +70,16 @@
private PortletContainer container;
private PortletWindowAccessor windowAccessor;
private boolean patchResponseCommitted = false;
- private JetspeedCache portletContentCache;
+ private JetspeedContentCache portletContentCache;
- public ActionValveImpl(PortletContainer container, PortletWindowAccessor windowAccessor, JetspeedCache portletContentCache)
+ public ActionValveImpl(PortletContainer container, PortletWindowAccessor windowAccessor, JetspeedContentCache portletContentCache)
{
this.container = container;
this.windowAccessor = windowAccessor;
this.portletContentCache = portletContentCache;
}
- public ActionValveImpl(PortletContainer container, PortletWindowAccessor windowAccessor, JetspeedCache portletContentCache, boolean patchResponseCommitted)
+ public ActionValveImpl(PortletContainer container, PortletWindowAccessor windowAccessor, JetspeedContentCache portletContentCache, boolean patchResponseCommitted)
{
this.container = container;
this.windowAccessor = windowAccessor;
@@ -262,6 +262,7 @@
if (portletContentCache.isKeyInCache(cacheKey))
{
portletContentCache.remove(cacheKey);
+ portletContentCache.invalidate(context);
}
}
@@ -271,6 +272,7 @@
if (portletContentCache.isKeyInCache(cacheKey))
{
portletContentCache.remove(cacheKey);
+ portletContentCache.invalidate(context);
}
}
Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java Mon Jun 25 18:41:35 2007
@@ -424,7 +424,7 @@
// validate cached configuration and return VelocityEngine if cached
long now = System.currentTimeMillis();
- if ((config != null) && (now <= (config.lastValidated + cacheValidationInterval)))
+ if ((config != null) && ((cacheValidationInterval == -1) || (now <= (config.lastValidated + cacheValidationInterval))))
{
if (config.macros != null)
{
@@ -452,7 +452,7 @@
}
}
}
-
+
// load and/or verify decorator macros configuration
TemplateDescriptor macrosDescriptor = null;
Modified: portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/container/state/TestNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/container/state/TestNavigationalState.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/container/state/TestNavigationalState.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/test/org/apache/jetspeed/container/state/TestNavigationalState.java Mon Jun 25 18:41:35 2007
@@ -28,7 +28,7 @@
import junit.framework.TestSuite;
import org.apache.jetspeed.PortalContext;
-import org.apache.jetspeed.cache.JetspeedCache;
+import org.apache.jetspeed.cache.JetspeedContentCache;
import org.apache.jetspeed.container.state.impl.NavigationalStateCodec;
import org.apache.jetspeed.container.state.impl.PathNavigationalState;
import org.apache.jetspeed.container.state.impl.SessionFullNavigationalState;
@@ -74,7 +74,7 @@
private Engine engine;
private NavigationalStateCodec codec;
private PortalContext portalContext;
- private JetspeedCache cache;
+ private JetspeedContentCache cache;
/**
* Defines the testcase name for JUnit.
@@ -126,7 +126,7 @@
codec = (NavigationalStateCodec) engine.getComponentManager().getComponent("NavigationalStateCodec");
portalContext = (PortalContext) engine.getComponentManager().getComponent("PortalContext");
- cache = (JetspeedCache) engine.getComponentManager().getComponent("portletContentCache");
+ cache = (JetspeedContentCache) engine.getComponentManager().getComponent("portletContentCache");
}
public static Test suite()
Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/PortalReservedParameters.java Mon Jun 25 18:41:35 2007
@@ -60,6 +60,12 @@
public static final String PORTLET_DEFINITION_ATTRIBUTE = "org.apache.jetspeed.portlet.definition";
public static final String PORTLET_WINDOW_ATTRIBUTE = "org.apache.jetspeed.portlet.window";
public static final String PAGE_THEME_ATTRIBUTE = "org.apache.jetspeed.theme";
+ public static final String PAGE_LAYOUT_VIEW = "org.apache.jetspeed.layout.view";
+ public static final String PAGE_LAYOUT_MAX = "org.apache.jetspeed.layout.max";
+ public static final String PAGE_LAYOUT_HELP = "org.apache.jetspeed.layout.help";
+ public static final String PAGE_LAYOUT_EDIT = "org.apache.jetspeed.layout.edit";
+ public static final String PAGE_LAYOUT_SOLO = "org.apache.jetspeed.layout.solo";
+
/**
* Setting this as a session attribute will override all themes declared in
* psml. Sample values are "Simple", "tigris", "jetspeed"
Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedContentCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedContentCache.java?view=auto&rev=550655
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedContentCache.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedContentCache.java Mon Jun 25 18:41:35 2007
@@ -0,0 +1,47 @@
+/*
+ * 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 org.apache.jetspeed.request.RequestContext;
+
+/**
+ * <p>
+ * Provides interface to Jetspeed for cache related activities
+ * Abstraction around actual cache implementation
+ * </p>
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public interface JetspeedContentCache extends JetspeedCache
+{
+ /**
+ * Creates a session key used to store associated information in the session.
+ *
+ * @param context
+ * @return
+ */
+ String createSessionKey(RequestContext context);
+
+ /**
+ * remove from the cache and invalidate any associated caches or session attributes
+ *
+ * @param context
+ * @param key
+ */
+ void invalidate(RequestContext context);
+}
\ No newline at end of file
Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Theme.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Theme.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Theme.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/decoration/Theme.java Mon Jun 25 18:41:35 2007
@@ -20,6 +20,8 @@
import java.util.Set;
import org.apache.jetspeed.om.page.Fragment;
+import org.apache.jetspeed.om.page.Page;
+import org.apache.jetspeed.request.RequestContext;
/**
* Theme provides a simple aggregation of all of the decorations
@@ -68,4 +70,15 @@
* decoration.
*/
LayoutDecoration getPageLayoutDecoration();
+
+ /**
+ * Initialize a page theme
+ *
+ * @param context
+ */
+ void init(Page page, DecorationFactory decoration, RequestContext context);
+
+ boolean isInvalidated();
+
+ void setInvalidated(boolean flag);
}
Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/ContentPage.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/ContentPage.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/ContentPage.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/om/page/ContentPage.java Mon Jun 25 18:41:35 2007
@@ -44,7 +44,7 @@
*/
ContentFragment getRootContentFragment();
-
+ void setRootContentFragment(ContentFragment frag);
/**
* Returns a ContentFragment that wraps the actual
Modified: portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java (original)
+++ portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java Mon Jun 25 18:41:35 2007
@@ -135,38 +135,38 @@
response.setContentType("text/html");
JetspeedPowerTool jpt = getJetspeedPowerTool(request);
- PortletPreferences prefs = request.getPreferences();
String absHelpPage = "";
// request.setAttribute(PortalReservedParameters.PAGE_ATTRIBUTE, getPage(request));
// request.setAttribute("fragment", getFragment(request, false));
- if (prefs != null)
+ try
{
-
- try
+ String helpPage = (String)request.getPortletSession().getAttribute(PortalReservedParameters.PAGE_LAYOUT_HELP);
+ if (helpPage == null)
{
- String helpPage = prefs.getValue(PARAM_HELP_PAGE, null);
+ PortletPreferences prefs = request.getPreferences();
+ helpPage = prefs.getValue(PARAM_HELP_PAGE, null);
if (helpPage == null)
{
helpPage = this.getInitParameter(PARAM_HELP_PAGE);
if (helpPage == null)
helpPage = "columns";
}
-
-
- //Mohan: closed task
- Configuration props = getConfiguration(request, helpPage);
- String ext = (String) props.getString(TEMPLATE_EXTENSION_KEY);
- absHelpPage = jpt.getTemplate(helpPage + "/" + JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE + "-help" + ext,
- JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE).getAppRelativePath();
- log.debug("Path to help page for LayoutPortlet " + absHelpPage);
- request.setAttribute(PARAM_VIEW_PAGE, absHelpPage);
- }
- catch (TemplateLocatorException e)
- {
- throw new PortletException("Unable to locate view page " + absHelpPage, e);
+ request.getPortletSession().setAttribute(PortalReservedParameters.PAGE_LAYOUT_HELP, helpPage);
}
+
+ //Mohan: closed task
+ Configuration props = getConfiguration(request, helpPage);
+ String ext = (String) props.getString(TEMPLATE_EXTENSION_KEY);
+ absHelpPage = jpt.getTemplate(helpPage + "/" + JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE + "-help" + ext,
+ JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE).getAppRelativePath();
+ log.debug("Path to help page for LayoutPortlet " + absHelpPage);
+ request.setAttribute(PARAM_VIEW_PAGE, absHelpPage);
+ }
+ catch (TemplateLocatorException e)
+ {
+ throw new PortletException("Unable to locate view page " + absHelpPage, e);
}
super.doView(request, response);
@@ -196,17 +196,17 @@
{
request.setAttribute("layout", getFragment(request, false));
}
-
- PortletPreferences prefs = request.getPreferences();
- if (prefs != null)
+ String viewPage = null;
+ String absViewPage = null;
+ try
{
- String absViewPage = null;
- String viewPage = null;
- try
+ JetspeedPowerTool jpt = getJetspeedPowerTool(request);
+ if (maximized)
{
- JetspeedPowerTool jpt = getJetspeedPowerTool(request);
- if (maximized)
+ viewPage = (String)request.getPortletSession().getAttribute(PortalReservedParameters.PAGE_LAYOUT_MAX);
+ if (viewPage == null)
{
+ PortletPreferences prefs = request.getPreferences();
viewPage = prefs.getValue(PARAM_MAX_PAGE, null);
if (viewPage == null)
{
@@ -214,9 +214,15 @@
if (viewPage == null)
viewPage = "maximized";
}
+ request.getPortletSession().setAttribute(PortalReservedParameters.PAGE_LAYOUT_MAX, viewPage);
}
- else if (solo)
+ }
+ else if (solo)
+ {
+ viewPage = (String)request.getPortletSession().getAttribute(PortalReservedParameters.PAGE_LAYOUT_SOLO);
+ if (viewPage == null)
{
+ PortletPreferences prefs = request.getPreferences();
viewPage = prefs.getValue(PARAM_SOLO_PAGE, null);
if (viewPage == null)
{
@@ -226,9 +232,15 @@
viewPage = "solo";
}
}
+ request.getPortletSession().setAttribute(PortalReservedParameters.PAGE_LAYOUT_SOLO, viewPage);
}
- else
+ }
+ else
+ {
+ viewPage = (String)request.getPortletSession().getAttribute(PortalReservedParameters.PAGE_LAYOUT_VIEW);
+ if (viewPage == null)
{
+ PortletPreferences prefs = request.getPreferences();
viewPage = prefs.getValue(PARAM_VIEW_PAGE, null);
if (viewPage == null)
{
@@ -236,24 +248,24 @@
if (viewPage == null)
viewPage = "columns";
}
+ request.getPortletSession().setAttribute(PortalReservedParameters.PAGE_LAYOUT_VIEW, viewPage);
}
-
- //Mohan: closed task
- Configuration props = getConfiguration(request, viewPage);
- String ext = (String) props.getString(TEMPLATE_EXTENSION_KEY);
-
-
- absViewPage = jpt.getTemplate(viewPage + "/" + JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE + ext,
- JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE).getAppRelativePath();
- log.debug("Path to view page for LayoutPortlet " + absViewPage);
- request.setAttribute(PARAM_VIEW_PAGE, absViewPage);
- }
- catch (TemplateLocatorException e)
- {
- throw new PortletException("Unable to locate view page " + absViewPage, e);
}
+
+ //Mohan: closed task
+ Configuration props = getConfiguration(request, viewPage);
+ String ext = (String) props.getString(TEMPLATE_EXTENSION_KEY);
+
+
+ absViewPage = jpt.getTemplate(viewPage + "/" + JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE + ext,
+ JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE).getAppRelativePath();
+ log.debug("Path to view page for LayoutPortlet " + absViewPage);
+ request.setAttribute(PARAM_VIEW_PAGE, absViewPage);
+ }
+ catch (TemplateLocatorException e)
+ {
+ throw new PortletException("Unable to locate view page " + absViewPage, e);
}
-
super.doView(request, response);
request.removeAttribute(PortalReservedParameters.PAGE_ATTRIBUTE);
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=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/pipelines.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/pipelines.xml Mon Jun 25 18:41:35 2007
@@ -250,15 +250,18 @@
<bean id="DecorationValve"
class="org.apache.jetspeed.decoration.DecorationValve"
init-method="initialize">
- <constructor-arg>
+ <constructor-arg index='0'>
<ref bean="DecorationFactory" />
</constructor-arg>
- <constructor-arg>
+ <constructor-arg index='1'>
<ref bean="PortletWindowAccessor" />
</constructor-arg>
- <constructor-arg>
+ <constructor-arg index='2'>
<ref bean="org.apache.jetspeed.security.SecurityAccessController" />
</constructor-arg>
+ <constructor-arg index='3'>
+ <ref bean="portletContentCache"/>
+ </constructor-arg>
</bean>
<bean id="loginViewValve"
Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/web.xml?view=diff&rev=550655&r1=550654&r2=550655
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/web.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/web.xml Mon Jun 25 18:41:35 2007
@@ -110,7 +110,7 @@
</init-param>
<init-param>
<param-name>org.apache.jetspeed.cache.validation.interval</param-name>
- <param-value>10000</param-value>
+ <param-value>-1</param-value>
</init-param>
<load-on-startup>10</load-on-startup>
</servlet>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org