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

public class DecorationValve
extends AbstractValve
implements 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  SecurityAccessController accessController
          For security constraint checks
static java.lang.String ACTION_IMAGE_EXTENSION_ATTR
           
static java.lang.String IS_AJAX_DECORATION_REQUEST
           
protected static org.apache.commons.logging.Log log
           
 
Constructor Summary
DecorationValve(DecorationFactory decorationFactory, PortletWindowAccessor windowAccessor, SecurityAccessController accessController)
           
DecorationValve(DecorationFactory decorationFactory, PortletWindowAccessor windowAccessor, SecurityAccessController accessController, JetspeedContentCache cache)
           
DecorationValve(DecorationFactory decorationFactory, PortletWindowAccessor windowAccessor, SecurityAccessController accessController, JetspeedContentCache cache, boolean useSessionForThemeCaching)
           
 
Method Summary
 boolean getAutoSwitchingForConfigMode()
           
 boolean getAutoSwitchingToEditDefaultsModes()
           
 DecoratorActionsFactory getDecoratorActionsAdapter(Decoration decoration)
           
 boolean getMaximizeOnConfig()
           
 boolean getMaximizeOnEdit()
           
 boolean getMaximizeOnEditDefaults()
           
protected  java.util.List getPageModes(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, 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(RequestContext requestContext, ContentFragment fragment, PageActionAccess pageActionAccess, Decoration decoration, boolean isAjaxRequest)
          Builds and assigns a list of available portlet modes and window states for the target Fragment.
protected  void initDepthFragmentDecorations(RequestContext requestContext, Theme theme, ContentFragment fragment, PageActionAccess pageActionAccess, boolean isAjaxRequest, ResourceValidator validator, 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(RequestContext requestContext, Theme theme, ContentFragment fragment, PageActionAccess pageActionAccess, boolean isAjaxRequest, java.util.List collectFragments)
          Intializes all fragments with there decorations and portlet modes and winodw states.
protected  boolean initFragment(RequestContext requestContext, Theme theme, ContentFragment fragment, PageActionAccess pageActionAccess, boolean isAjaxRequest)
           
 void initFragments(RequestContext requestContext, boolean isAjaxRequest, java.util.List fragments)
           
 void invoke(RequestContext requestContext, ValveContext context)
           
protected  boolean isSoloMode(RequestContext requestContext)
           
 void setAutoSwitchingForConfigMode(boolean autoSwitchingForConfigMode)
           
 void setAutoSwitchingToEditDefaultsModes(boolean autoSwitchingToEditDefaultsModes)
           
 void setMaximizeOnConfig(boolean maxOnConfig)
           
 void setMaximizeOnEdit(boolean maxOnEdit)
           
 void setMaximizeOnEditDefaults(boolean maxOnEditDefaults)
           
 java.lang.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 java.lang.String ACTION_IMAGE_EXTENSION_ATTR
See Also:
Constant Field Values

IS_AJAX_DECORATION_REQUEST

public static final java.lang.String IS_AJAX_DECORATION_REQUEST
See Also:
Constant Field Values

log

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

accessController

protected SecurityAccessController accessController
For security constraint checks

Constructor Detail

DecorationValve

public DecorationValve(DecorationFactory decorationFactory,
                       PortletWindowAccessor windowAccessor,
                       SecurityAccessController accessController)

DecorationValve

public DecorationValve(DecorationFactory decorationFactory,
                       PortletWindowAccessor windowAccessor,
                       SecurityAccessController accessController,
                       JetspeedContentCache cache)

DecorationValve

public DecorationValve(DecorationFactory decorationFactory,
                       PortletWindowAccessor windowAccessor,
                       SecurityAccessController accessController,
                       JetspeedContentCache cache,
                       boolean useSessionForThemeCaching)
Method Detail

invoke

public void invoke(RequestContext requestContext,
                   ValveContext context)
            throws PipelineException
Specified by:
invoke in interface Valve
Specified by:
invoke in class AbstractValve
Throws:
PipelineException

initFragments

public void initFragments(RequestContext requestContext,
                          boolean isAjaxRequest,
                          java.util.List fragments)

isSoloMode

protected boolean isSoloMode(RequestContext requestContext)

useCache

protected boolean useCache()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDecoratorActionsAdapter

public DecoratorActionsFactory getDecoratorActionsAdapter(Decoration decoration)

initActionsForFragment

protected boolean initActionsForFragment(RequestContext requestContext,
                                         ContentFragment fragment,
                                         PageActionAccess pageActionAccess,
                                         Decoration decoration,
                                         boolean isAjaxRequest)
                                  throws FailedToRetrievePortletWindow,
                                         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:
PortletEntityNotStoredException
FailedToRetrievePortletWindow

getPageModes

protected java.util.List getPageModes(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,
                                      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:
PortletEntityNotStoredException

initDepthFragments

protected void initDepthFragments(RequestContext requestContext,
                                  Theme theme,
                                  ContentFragment fragment,
                                  PageActionAccess pageActionAccess,
                                  boolean isAjaxRequest,
                                  java.util.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(RequestContext requestContext,
                               Theme theme,
                               ContentFragment fragment,
                               PageActionAccess pageActionAccess,
                               boolean isAjaxRequest)

initDepthFragmentDecorations

protected void initDepthFragmentDecorations(RequestContext requestContext,
                                            Theme theme,
                                            ContentFragment fragment,
                                            PageActionAccess pageActionAccess,
                                            boolean isAjaxRequest,
                                            ResourceValidator validator,
                                            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()


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