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 sm...@apache.org on 2007/10/26 10:06:56 UTC
svn commit: r588553 -
/portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
Author: smilek
Date: Fri Oct 26 01:06:55 2007
New Revision: 588553
URL: http://svn.apache.org/viewvc?rev=588553&view=rev
Log:
restored the setting of decorator for nested layout fragments
Modified:
portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java?rev=588553&r1=588552&r2=588553&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java (original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java Fri Oct 26 01:06:55 2007
@@ -112,48 +112,46 @@
public Decoration getDecoration( Page page, Fragment fragment, RequestContext requestContext )
{
- Decoration decoration = null;
+ String decorationName = getDefaultDecorationName( fragment, page );
+ Decoration decoration;
// use layout decoration for top level layout root fragments
// and use portlet decoration for all other fragments
- boolean isLayoutFrag = fragment.getType().equals( Fragment.LAYOUT );
- boolean isLayoutRootFrag = ( isLayoutFrag && fragment.equals( page.getRootFragment() ) );
- if ( ! isLayoutFrag || isLayoutRootFrag )
- {
- String decorationName = getDefaultDecorationName( fragment, page );
- if ( isLayoutFrag )
- {
- decoration = getLayoutDecoration( decorationName, requestContext );
- }
- else
- {
- decoration = getPortletDecoration( decorationName, requestContext );
- }
-
- if ( isDesktopEnabled( requestContext ) )
- { // assure that selected decoration supports /desktop
- // otherwise get default desktop decoration for fragment type
- if ( decoration == null || ! decoration.supportsDesktop() )
- {
- String defaultDecoration = null;
- if ( isLayoutFrag )
- {
- defaultDecoration = getDefaultDesktopLayoutDecoration();
- decoration = getLayoutDecoration( defaultDecoration, requestContext );
-
- }
- else
- {
- defaultDecoration = getDefaultDesktopPortletDecoration();
- decoration = getPortletDecoration( defaultDecoration, requestContext );
- }
- 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 );
- }
- }
- }
+ boolean isLayout = fragment.getType().equals( Fragment.LAYOUT );
+ if ( isLayout )
+ {
+ decoration = getLayoutDecoration( decorationName, requestContext );
+ }
+ else
+ {
+ decoration = getPortletDecoration( decorationName, requestContext );
+ }
+
+ if ( isDesktopEnabled( requestContext ) )
+ { // assure that selected decoration supports /desktop
+ // otherwise get default desktop decoration for fragment type
+ if ( decoration == null || ! decoration.supportsDesktop() )
+ {
+ String defaultDecoration = null;
+ if ( isLayout )
+ {
+ if ( decoration == null || fragment.equals( page.getRootFragment() ) )
+ {
+ defaultDecoration = getDefaultDesktopLayoutDecoration();
+ decoration = getLayoutDecoration( defaultDecoration, requestContext );
+ }
+ }
+ else
+ {
+ defaultDecoration = getDefaultDesktopPortletDecoration();
+ decoration = getPortletDecoration( defaultDecoration, requestContext );
+ }
+ 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.error( errMsg );
+ }
+ }
}
return decoration;
}
@@ -200,7 +198,6 @@
if ( type.equals( Fragment.PORTLET ) )
{
props = (Properties)this.portletDecoratorProperties.get( name );
-
}
else
{
@@ -380,8 +377,16 @@
{
if (fragment.getType().equals(Fragment.LAYOUT))
{
- // use page specified layout decorator name
- decoration = page.getEffectiveDefaultDecorator(Fragment.LAYOUT);
+ if (fragment.equals(page.getRootFragment()))
+ {
+ // use page specified layout decorator name
+ decoration = page.getEffectiveDefaultDecorator(Fragment.LAYOUT);
+ }
+ else
+ {
+ // use default nested layout portlet decorator name
+ decoration = DEFAULT_NESTED_LAYOUT_PORTLET_DECORATOR;
+ }
}
else
{
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org