portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r640286 - in /portals/jetspeed-2/portal/trunk: applications/jetspeed/src/main/webapp/decorations/portlet/tigris/images/desktop/ components/jetspeed-header-resource/src/main/java/org/apache/jetspeed/headerresource/impl/ components/jetspeed-p...
Date Mon, 24 Mar 2008 02:20:17 GMT
Author: ate
Date: Sun Mar 23 19:20:15 2008
New Revision: 640286

URL: http://svn.apache.org/viewvc?rev=640286&view=rev
Log:
Some additional 2.1.3 synchronizations Steve seems to have missed

Added:
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/tigris/images/desktop/about.gif
  (with props)
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/tigris/images/desktop/config.gif
  (with props)
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/tigris/images/desktop/edit_defaults.gif
  (with props)
Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-header-resource/src/main/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/theme-engine.xml

Added: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/tigris/images/desktop/about.gif
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/tigris/images/desktop/about.gif?rev=640286&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/tigris/images/desktop/about.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/tigris/images/desktop/config.gif
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/tigris/images/desktop/config.gif?rev=640286&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/tigris/images/desktop/config.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/tigris/images/desktop/edit_defaults.gif
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/tigris/images/desktop/edit_defaults.gif?rev=640286&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/tigris/images/desktop/edit_defaults.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-header-resource/src/main/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-header-resource/src/main/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java?rev=640286&r1=640285&r2=640286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-header-resource/src/main/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-header-resource/src/main/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java
Sun Mar 23 19:20:15 2008
@@ -995,6 +995,10 @@
         //preinitOut.append( "    " ).append( "function de_jsessionid_url(url){var tEnds
= url.indexOf(';jsessionid=');if (tEnds > 0) url = url.substring(0, tEnds);return url;}"
).append( EOL );
         // presence of ;jsessionid in dojo baseScriptUri is bad news
         preinitOut.append( "    " ).append( "djConfig.baseScriptUri = \"" ).append( getPortalResourceUrl(
dojoGetPath(), false ) ).append( "\";" ).append( EOL );
+        if (this.requestContext.getRequest().getContextPath().length()==0)
+        {
+            preinitOut.append( "    " ).append( "djConfig.jetspeed.rootContext = \"true\";"
).append( EOL );
+        }
         preinitOut.append( "    " ).append( "djConfig.jetspeed.servletPath = \"" ).append(
this.requestContext.getRequest().getServletPath() ).append( "\";" );
         return preinitOut.toString();
     }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java?rev=640286&r1=640285&r2=640286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
Sun Mar 23 19:20:15 2008
@@ -33,6 +33,8 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.cache.CacheElement;
+import org.apache.jetspeed.cache.JetspeedCache;
 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
 import org.apache.jetspeed.decoration.caches.SessionPathResolverCache;
 import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
@@ -63,6 +65,9 @@
     private final ResourceValidator validator;
     private final PortletRegistry registry;
     
+    /** cache to hold decoration Properties objects **/
+    private JetspeedCache decorationConfigurationCache;
+    
     private ServletContext servletContext;
 
     private String defaultDesktopLayoutDecoration = null;
@@ -84,12 +89,20 @@
     public DecorationFactoryImpl( String decorationsPath, 
                                   ResourceValidator validator )
     {
-        this( null, decorationsPath, validator );
+        this( null, decorationsPath, validator, null );
+    }
+    
+    public DecorationFactoryImpl( String decorationsPath, 
+                                  ResourceValidator validator,
+                                  JetspeedCache decorationConfigurationCache )
+    {
+        this( null, decorationsPath, validator, decorationConfigurationCache );
     }
 
     public DecorationFactoryImpl( PortletRegistry registry,
-            String decorationsPath, 
-            ResourceValidator validator )
+                                  String decorationsPath, 
+                                  ResourceValidator validator,
+                                  JetspeedCache decorationConfigurationCache )
     {
         this.registry =  registry;
         this.decorationsPath = new Path( decorationsPath );
@@ -98,12 +111,18 @@
         this.portletDecorationsPath = getBasePath( Fragment.PORTLET );
         this.portletDecorationsPathStr = this.portletDecorationsPath.toString();
         this.validator = validator;
+        this.decorationConfigurationCache = decorationConfigurationCache;
     }
         
     public ResourceValidator getResourceValidator()
     {
         return validator;
-    }    
+    }
+    
+    protected JetspeedCache getDecorationConfigurationCache()
+    {
+    	return decorationConfigurationCache;
+    }
 
     public Theme getTheme( Page page, RequestContext requestContext )
     {
@@ -117,7 +136,8 @@
 
         // use layout decoration for top level layout root fragments
         //    and use portlet decoration for all other fragments
-        if ( fragment.getType().equals( Fragment.LAYOUT ) )
+        boolean isLayout = fragment.getType().equals( Fragment.LAYOUT );
+        if ( isLayout )
         {
             decoration = getLayoutDecoration( decorationName, requestContext );
         }
@@ -132,10 +152,13 @@
             if ( decoration == null || ! decoration.supportsDesktop() )
             {
                 String defaultDecoration = null;
-                if (fragment.getType().equals( Fragment.LAYOUT ) )
+                if ( isLayout )
                 {
-                    defaultDecoration = getDefaultDesktopLayoutDecoration();
-                    decoration = getLayoutDecoration( defaultDecoration, requestContext );
+                	if ( decoration == null || fragment.equals( page.getRootFragment() ) )
+                	{
+                		defaultDecoration = getDefaultDesktopLayoutDecoration();
+                		decoration = getLayoutDecoration( defaultDecoration, requestContext );
+                	}
                 }
                 else
                 {
@@ -145,7 +168,7 @@
                 if ( decoration == null )
                 {
                     String errMsg = "Cannot locate default desktop " + fragment.getType()
+ " decoration " + ( defaultDecoration == null ? "null" : ("\"" + defaultDecoration + "\"")
) + " (decoration " + ( defaultDecoration == null ? "null" : ("\"" + decorationName + "\"")
) + " specified for page could either not be located or does not support desktop). No desktop
compatible " + fragment.getType() + " decoration is available.";
-                    log.warn( errMsg );
+                    log.error( errMsg );
                 }
             }
         }
@@ -182,6 +205,50 @@
 
     }
 
+    protected Properties getCachedConfiguration( String name, String type )
+    {
+    	if ( decorationConfigurationCache == null )
+    	{
+    		if ( type.equals( Fragment.PORTLET ) )
+    		{
+    			return (Properties)this.portletDecoratorProperties.get( name );
+    		}
+    		else
+    		{
+    			return (Properties)this.layoutDecoratorProperties.get( name );
+    		}
+    	}
+    	CacheElement cachedElement = decorationConfigurationCache.get( getCachedConfigurationKey(
type, name ) );
+        if (cachedElement != null)
+        	return (Properties)cachedElement.getContent();  
+        return null;
+    }
+    protected void setCachedConfiguration( String name, String type, Properties props )
+    {
+    	if ( decorationConfigurationCache == null )
+    	{
+    		if ( type.equals( Fragment.PORTLET ) )
+    		{
+    			this.portletDecoratorProperties.put( name, props );
+    		}
+    		else
+    		{
+    			this.layoutDecoratorProperties.put( name, props );
+    		}
+    	}
+    	else
+    	{
+    		CacheElement cachedElement = decorationConfigurationCache.createElement( getCachedConfigurationKey(
type, name ), props );
+    		cachedElement.setTimeToIdleSeconds(decorationConfigurationCache.getTimeToIdleSeconds());
+    		cachedElement.setTimeToLiveSeconds(decorationConfigurationCache.getTimeToLiveSeconds());
+    		decorationConfigurationCache.put( cachedElement );
+    	}
+    }
+    protected String getCachedConfigurationKey( String type, String name )
+    {
+    	return type + "."  + name;
+    }
+    
     /**
      * Gets the configuration (decorator.properties) object for the decoration.
      * @param name Name of the Decoration.
@@ -190,16 +257,7 @@
      */
     public Properties getConfiguration( String name, String type )
     {
-        Properties props = null;
-        if ( type.equals( Fragment.PORTLET ) )
-        {
-            props = (Properties)this.portletDecoratorProperties.get( name );
-            
-        }
-        else
-        {
-            props = (Properties)this.layoutDecoratorProperties.get( name );
-        }        
+        Properties props = getCachedConfiguration( name, type );
         if ( props != null )
         {
             return props;
@@ -302,15 +360,9 @@
                 props.setProperty( Decoration.DESKTOP_SUPPORTED_PROPERTY, "false" );
             }
         }
-
-        if ( type.equals( Fragment.PORTLET ) )
-        {
-            this.portletDecoratorProperties.put( name, props );
-        }
-        else
-        {
-            this.layoutDecoratorProperties.put( name, props );
-        }
+        
+        setCachedConfiguration( name, type, props );
+        
         return props;
     }
     

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/theme-engine.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/theme-engine.xml?rev=640286&r1=640285&r2=640286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/theme-engine.xml
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/theme-engine.xml
Sun Mar 23 19:20:15 2008
@@ -1,36 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
-<!--
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<!--
 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.
--->
-
-<beans>
-  <bean id="ResourceValidator" class="org.apache.jetspeed.decoration.validators.WebApplicationResourceValidator"/>
-  
-  <bean id="DecorationFactory"
-      class="org.apache.jetspeed.decoration.DecorationFactoryImpl">
-    <constructor-arg index="0">    
- 	 	<ref bean="org.apache.jetspeed.components.portletregistry.PortletRegistry" />
-	</constructor-arg>	  	  
-    <constructor-arg index="1">
-      <value>/decorations</value>
-    </constructor-arg>
-	<constructor-arg index="2">
-		<ref bean="ResourceValidator" />
-	</constructor-arg>
-  </bean>  
-
-</beans>
+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.
+-->
+
+<beans>
+  <bean id="ResourceValidator" class="org.apache.jetspeed.decoration.validators.WebApplicationResourceValidator"/>
+  
+  <bean id="DecorationFactory"
+      class="org.apache.jetspeed.decoration.DecorationFactoryImpl">
+    <constructor-arg index="0">    
+ 	 	<ref bean="org.apache.jetspeed.components.portletregistry.PortletRegistry" />
+	</constructor-arg>	  	  
+    <constructor-arg index="1">
+      <value>/decorations</value>
+    </constructor-arg>
+	<constructor-arg index="2">
+		<ref bean="ResourceValidator" />
+	</constructor-arg>
+    <constructor-arg index="3">
+        <ref bean="decorationConfigurationCache" />
+    </constructor-arg>
+  </bean>  
+	
+</beans>



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