org.apache.jetspeed.decoration
Class DecorationValve

java.lang.Object
  extended by org.apache.jetspeed.pipeline.valve.AbstractValve
      extended by org.apache.jetspeed.decoration.DecorationValve
All Implemented Interfaces:
org.apache.jetspeed.pipeline.valve.Valve

public class DecorationValve
extends AbstractValve
implements org.apache.jetspeed.pipeline.valve.Valve

Assigns decorations and page actions to all of the portlet Fragments within the current request.

Author:
Scott T. Weaver, Vivek Kumar
See Also:
Fragment, Page, Decoration, LayoutDecoration, PortletDecoration, Theme

Field Summary
protected  org.apache.jetspeed.security.SecurityAccessController accessController
          For security constraint checks
static String ACTION_IMAGE_EXTENSION_ATTR
           
private  boolean autoSwitchingForConfigMode
          When edit_defaults mode is not supported by a portlet, support the mode automatically.
private  boolean autoSwitchingToEditDefaultsModes
          When edit_defaults mode is not supported by a portlet, support the mode automatically.
private  org.apache.jetspeed.cache.JetspeedContentCache cache
           
private  org.apache.jetspeed.decoration.DecorationFactory decorationFactory
           
private  HashMap decoratorActionsAdapterCache
           
private  DecoratorActionsFactory defaultDecoratorActionsFactory
           
static String IS_AJAX_DECORATION_REQUEST
           
protected static org.apache.commons.logging.Log log
           
private  boolean maxOnConfig
           
private  boolean maxOnEdit
           
private  boolean maxOnEditDefaults
           
private  boolean useSessionForThemeCaching
           
private  org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor
           
 
Constructor Summary
DecorationValve(org.apache.jetspeed.decoration.DecorationFactory decorationFactory, org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor, org.apache.jetspeed.security.SecurityAccessController accessController)
           
DecorationValve(org.apache.jetspeed.decoration.DecorationFactory decorationFactory, org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor, org.apache.jetspeed.security.SecurityAccessController accessController, org.apache.jetspeed.cache.JetspeedContentCache cache)
           
DecorationValve(org.apache.jetspeed.decoration.DecorationFactory decorationFactory, org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor, org.apache.jetspeed.security.SecurityAccessController accessController, org.apache.jetspeed.cache.JetspeedContentCache cache, boolean useSessionForThemeCaching)
           
 
Method Summary
 boolean getAutoSwitchingForConfigMode()
           
 boolean getAutoSwitchingToEditDefaultsModes()
           
 DecoratorActionsFactory getDecoratorActionsAdapter(org.apache.jetspeed.decoration.Decoration decoration)
           
 boolean getMaximizeOnConfig()
           
 boolean getMaximizeOnEdit()
           
 boolean getMaximizeOnEditDefaults()
           
protected  List getPageModes(org.apache.jetspeed.request.RequestContext requestContext, org.apache.pluto.om.window.PortletWindow window, org.apache.pluto.om.portlet.ContentTypeSet content, javax.portlet.PortletMode mode, javax.portlet.WindowState state, PageActionAccess pageActionAccess, org.apache.jetspeed.decoration.Decoration decoration, boolean isAjaxRequest)
          Builds a list of portlet modes that can be executed on the current fragment excluding the portlet's current mode.
protected  boolean initActionsForFragment(org.apache.jetspeed.request.RequestContext requestContext, org.apache.jetspeed.om.page.ContentFragment fragment, PageActionAccess pageActionAccess, org.apache.jetspeed.decoration.Decoration decoration, boolean isAjaxRequest)
          Builds and assigns a list of available portlet modes and window states for the target Fragment.
protected  void initDepthFragmentDecorations(org.apache.jetspeed.request.RequestContext requestContext, org.apache.jetspeed.decoration.Theme theme, org.apache.jetspeed.om.page.ContentFragment fragment, PageActionAccess pageActionAccess, boolean isAjaxRequest, org.apache.jetspeed.decoration.ResourceValidator validator, org.apache.jetspeed.decoration.PathResolverCache pathResolverCache, boolean reloadActionList)
          Reintializes all fragments with there decorations and portlet modes and winodw states after theme is restored from cache.
protected  void initDepthFragments(org.apache.jetspeed.request.RequestContext requestContext, org.apache.jetspeed.decoration.Theme theme, org.apache.jetspeed.om.page.ContentFragment fragment, PageActionAccess pageActionAccess, boolean isAjaxRequest, List collectFragments)
          Intializes all fragments with there decorations and portlet modes and winodw states.
protected  boolean initFragment(org.apache.jetspeed.request.RequestContext requestContext, org.apache.jetspeed.decoration.Theme theme, org.apache.jetspeed.om.page.ContentFragment fragment, PageActionAccess pageActionAccess, boolean isAjaxRequest)
           
 void initFragments(org.apache.jetspeed.request.RequestContext requestContext, boolean isAjaxRequest, List fragments)
           
 void invoke(org.apache.jetspeed.request.RequestContext requestContext, org.apache.jetspeed.pipeline.valve.ValveContext context)
           
private  boolean isAutoSwitchableCustomMode(org.apache.pluto.om.portlet.ContentTypeSet content, javax.portlet.PortletMode customMode)
           
protected  boolean isSoloMode(org.apache.jetspeed.request.RequestContext requestContext)
           
 void setAutoSwitchingForConfigMode(boolean autoSwitchingForConfigMode)
           
 void setAutoSwitchingToEditDefaultsModes(boolean autoSwitchingToEditDefaultsModes)
           
 void setMaximizeOnConfig(boolean maxOnConfig)
           
 void setMaximizeOnEdit(boolean maxOnEdit)
           
 void setMaximizeOnEditDefaults(boolean maxOnEditDefaults)
           
 String toString()
           
protected  boolean useCache()
           
 
Methods inherited from class org.apache.jetspeed.pipeline.valve.AbstractValve
initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.pipeline.valve.Valve
initialize
 

Field Detail

ACTION_IMAGE_EXTENSION_ATTR

public static final String ACTION_IMAGE_EXTENSION_ATTR
See Also:
Constant Field Values

IS_AJAX_DECORATION_REQUEST

public static final String IS_AJAX_DECORATION_REQUEST
See Also:
Constant Field Values

log

protected static final org.apache.commons.logging.Log log

decorationFactory

private final org.apache.jetspeed.decoration.DecorationFactory decorationFactory

windowAccessor

private final org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor

decoratorActionsAdapterCache

private HashMap decoratorActionsAdapterCache

defaultDecoratorActionsFactory

private DecoratorActionsFactory defaultDecoratorActionsFactory

cache

private org.apache.jetspeed.cache.JetspeedContentCache cache

useSessionForThemeCaching

private boolean useSessionForThemeCaching

maxOnEdit

private boolean maxOnEdit

maxOnConfig

private boolean maxOnConfig

maxOnEditDefaults

private boolean maxOnEditDefaults

autoSwitchingForConfigMode

private boolean autoSwitchingForConfigMode
When edit_defaults mode is not supported by a portlet, support the mode automatically.


autoSwitchingToEditDefaultsModes

private boolean autoSwitchingToEditDefaultsModes
When edit_defaults mode is not supported by a portlet, support the mode automatically.


accessController

protected org.apache.jetspeed.security.SecurityAccessController accessController
For security constraint checks

Constructor Detail

DecorationValve

public DecorationValve(org.apache.jetspeed.decoration.DecorationFactory decorationFactory,
                       org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor,
                       org.apache.jetspeed.security.SecurityAccessController accessController)

DecorationValve

public DecorationValve(org.apache.jetspeed.decoration.DecorationFactory decorationFactory,
                       org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor,
                       org.apache.jetspeed.security.SecurityAccessController accessController,
                       org.apache.jetspeed.cache.JetspeedContentCache cache)

DecorationValve

public DecorationValve(org.apache.jetspeed.decoration.DecorationFactory decorationFactory,
                       org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor,
                       org.apache.jetspeed.security.SecurityAccessController accessController,
                       org.apache.jetspeed.cache.JetspeedContentCache cache,
                       boolean useSessionForThemeCaching)
Method Detail

invoke

public void invoke(org.apache.jetspeed.request.RequestContext requestContext,
                   org.apache.jetspeed.pipeline.valve.ValveContext context)
            throws org.apache.jetspeed.pipeline.PipelineException
Specified by:
invoke in interface org.apache.jetspeed.pipeline.valve.Valve
Specified by:
invoke in class AbstractValve
Throws:
org.apache.jetspeed.pipeline.PipelineException

initFragments

public void initFragments(org.apache.jetspeed.request.RequestContext requestContext,
                          boolean isAjaxRequest,
                          List fragments)

isSoloMode

protected boolean isSoloMode(org.apache.jetspeed.request.RequestContext requestContext)

useCache

protected boolean useCache()

toString

public String toString()
Overrides:
toString in class Object

getDecoratorActionsAdapter

public DecoratorActionsFactory getDecoratorActionsAdapter(org.apache.jetspeed.decoration.Decoration decoration)

initActionsForFragment

protected boolean initActionsForFragment(org.apache.jetspeed.request.RequestContext requestContext,
                                         org.apache.jetspeed.om.page.ContentFragment fragment,
                                         PageActionAccess pageActionAccess,
                                         org.apache.jetspeed.decoration.Decoration decoration,
                                         boolean isAjaxRequest)
                                  throws org.apache.jetspeed.container.window.FailedToRetrievePortletWindow,
                                         org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException
Builds and assigns a list of available portlet modes and window states for the target Fragment.

Parameters:
requestContext - RequestContext of the current portal request.
fragment - Fragment to initialize modes and states for.
Returns:
Throws:
org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException
org.apache.jetspeed.container.window.FailedToRetrievePortletWindow

getPageModes

protected List getPageModes(org.apache.jetspeed.request.RequestContext requestContext,
                            org.apache.pluto.om.window.PortletWindow window,
                            org.apache.pluto.om.portlet.ContentTypeSet content,
                            javax.portlet.PortletMode mode,
                            javax.portlet.WindowState state,
                            PageActionAccess pageActionAccess,
                            org.apache.jetspeed.decoration.Decoration decoration,
                            boolean isAjaxRequest)
Builds a list of portlet modes that can be executed on the current fragment excluding the portlet's current mode.

Parameters:
requestContext - RequestContext of the current portal request.
pageActionAccess -
mode -
content -
portletName -
window -
fragment -
Returns:
java.util.List of modes excluding the current one.
Throws:
org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException

initDepthFragments

protected void initDepthFragments(org.apache.jetspeed.request.RequestContext requestContext,
                                  org.apache.jetspeed.decoration.Theme theme,
                                  org.apache.jetspeed.om.page.ContentFragment fragment,
                                  PageActionAccess pageActionAccess,
                                  boolean isAjaxRequest,
                                  List collectFragments)
Intializes all fragments with there decorations and portlet modes and winodw states.

Parameters:
requestContext - RequestContext of the current portal request.
theme -
fragment -
pageActionAccess -

initFragment

protected boolean initFragment(org.apache.jetspeed.request.RequestContext requestContext,
                               org.apache.jetspeed.decoration.Theme theme,
                               org.apache.jetspeed.om.page.ContentFragment fragment,
                               PageActionAccess pageActionAccess,
                               boolean isAjaxRequest)

initDepthFragmentDecorations

protected void initDepthFragmentDecorations(org.apache.jetspeed.request.RequestContext requestContext,
                                            org.apache.jetspeed.decoration.Theme theme,
                                            org.apache.jetspeed.om.page.ContentFragment fragment,
                                            PageActionAccess pageActionAccess,
                                            boolean isAjaxRequest,
                                            org.apache.jetspeed.decoration.ResourceValidator validator,
                                            org.apache.jetspeed.decoration.PathResolverCache pathResolverCache,
                                            boolean reloadActionList)
Reintializes all fragments with there decorations and portlet modes and winodw states after theme is restored from cache.

Parameters:
requestContext - RequestContext of the current portal request.
theme -
fragment -
pageActionAccess -
isAjaxRequest -
validator -
pathResolverCache -

setMaximizeOnEdit

public void setMaximizeOnEdit(boolean maxOnEdit)

getMaximizeOnEdit

public boolean getMaximizeOnEdit()

setMaximizeOnConfig

public void setMaximizeOnConfig(boolean maxOnConfig)

getMaximizeOnConfig

public boolean getMaximizeOnConfig()

setMaximizeOnEditDefaults

public void setMaximizeOnEditDefaults(boolean maxOnEditDefaults)

getMaximizeOnEditDefaults

public boolean getMaximizeOnEditDefaults()

setAutoSwitchingToEditDefaultsModes

public void setAutoSwitchingToEditDefaultsModes(boolean autoSwitchingToEditDefaultsModes)

getAutoSwitchingToEditDefaultsModes

public boolean getAutoSwitchingToEditDefaultsModes()

setAutoSwitchingForConfigMode

public void setAutoSwitchingForConfigMode(boolean autoSwitchingForConfigMode)

getAutoSwitchingForConfigMode

public boolean getAutoSwitchingForConfigMode()

isAutoSwitchableCustomMode

private boolean isAutoSwitchableCustomMode(org.apache.pluto.om.portlet.ContentTypeSet content,
                                           javax.portlet.PortletMode customMode)


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.