3.2.1: 2012-12-13

net.sf.basedb.clients.web.extensions.section
Class IncludeContentSectionFactory

java.lang.Object
  extended by net.sf.basedb.clients.web.extensions.AbstractJspFactory
      extended by net.sf.basedb.clients.web.extensions.AbstractJspActionFactory<SectionAction>
          extended by net.sf.basedb.clients.web.extensions.section.IncludeContentSectionFactory
All Implemented Interfaces:
ActionFactory<SectionAction>

public class IncludeContentSectionFactory
extends AbstractJspActionFactory<SectionAction>

A section action factory implementation that includes another resource as the content of a section. The other resource can be a JSP script, servlet, a static file, or anything else that makes sense.

The current JspContext is stored as a ServletRequest attribute with key JspContext.ATTRIBUTE_KEY. If the included page is a JSP page it can get the JspContext by calling request.getAttribute(JspContext.ATTRIBUTE_KEY).

Use the AbstractJspFactory.setScript(String) and AbstractJspFactory.setStylesheet(String) methods. Each call to these methods will add the argument to a set. Use the AbstractJspFactory.getScripts() and AbstractJspFactory.getStylesheets() methods to gain access to the sets, for example, to remove added items.

Note that this factory will accept and generate content for all nodes (including folder nodes). If only some nodes should be used, the factory should be subclassed and override the AbstractJspActionFactory.prepareContext(InvokationContext) method.

Since:
3.2
Author:
nicklas
Last modified
$Date$

Nested Class Summary
(package private)  class IncludeContentSectionFactory.Section
           
 
Field Summary
private  String contentStyle
           
private  String hideClazz
           
private  String id
           
private  String include
           
private  String showClazz
           
private  String style
           
private  String title
           
 
Constructor Summary
IncludeContentSectionFactory()
          Create a new factory instance.
 
Method Summary
 SectionAction[] getActions(InvokationContext context)
          This method may be called one or several times for each request.
 void setContentStyle(String contentStyle)
           
 void setHideClazz(String hideClazz)
           
 void setId(String id)
           
 void setInclude(String include)
           
 void setShowClazz(String showClazz)
           
 void setStyle(String style)
           
 void setTitle(String title)
           
 
Methods inherited from class net.sf.basedb.clients.web.extensions.AbstractJspActionFactory
prepareContext
 
Methods inherited from class net.sf.basedb.clients.web.extensions.AbstractJspFactory
getScripts, getStylesheets, prepareContext, setScript, setStylesheet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

private String id

showClazz

private String showClazz

hideClazz

private String hideClazz

style

private String style

contentStyle

private String contentStyle

title

private String title

include

private String include
Constructor Detail

IncludeContentSectionFactory

public IncludeContentSectionFactory()
Create a new factory instance.

Method Detail

getActions

public SectionAction[] getActions(InvokationContext context)
Description copied from interface: ActionFactory
This method may be called one or several times for each request. This is decided by the extension point. If, for example, the extension point is a pure single-item extension point then this method is probably only called once. If the extension point is a per-item extension point in a list context, then this method may be called once for every item in the list. The context parameter contains all information about the context of the extension point, including the current item, if any.

Parameters:
context - The current invokation context
Returns:
An array of actions that should be added to the extension point. Returns null or an empty array if there are no actions in the current context.

setId

public void setId(String id)

setShowClazz

public void setShowClazz(String showClazz)

setHideClazz

public void setHideClazz(String hideClazz)

setStyle

public void setStyle(String style)

setContentStyle

public void setContentStyle(String contentStyle)

setTitle

public void setTitle(String title)

setInclude

@PathSetter(pathType=CONTEXT_RELATIVE)
public void setInclude(String include)

3.2.1: 2012-12-13