|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object echopoint.layout.AbstractLayoutManager echopoint.layout.JspTemplateLayoutManager
Generates content from a JSP page and adds it into the Echo framework. Echo components can also be added to the JSP. The JSP can be used for HTML templating, as a HTML layout container, or any sort of dynamic content generation.
It is useful for rendering content that has complex layout that is best done in HTML. It is also useful when reusing existing JSP work.
Note this layout manager only allows for JSP fragements. This means the main body is still generated by a top level Echo container.
This layout manager can be used for generating dynamic html content but it can also be used to layout other Echo components within its html/jsp.
Any Echo component added to this layout manager can be referenced and laid out with a JSP tag (the EchoComponentTag) via the a tag as in
<%@ taglib uri="/WEB-INF/echopointtags.tld" prefix="echo" %> <echo:component name="xxx"/>
The JSP page can be fed bean objects that are put into JSP request scope. The bean objects can be static or dynamically generated on every rendering.
One way is to provide a single static bean. With a static bean, one can only send one single bean to the JSP and the bean can only be changed by the component using the setBean method.
Another way is to use to use a Map of bean objects. This allows for more than one static bean to be placed into the JSP request scope. You can also use the addBean(bean,beanName) method to add beans to a default Map.
Finally the JspBeanGenerator interface can be used to create dynamically generated beans values. Dynamically generated beans allow for one or more beans to be passed into the JSP. The implementing JspBeanGenerator can then choose to have there content cached (ie set once) or generated on the fly every time the JSP is rendered.
JspTemplateLayoutManager supports setting properties of the component via a CSS like style setting :
<echo:component name="comp1" style="background : #ff0000; font : verdana,bold,9; foreground : yellow">
This uses the EchoPoint CSS support to each of the component properties via entries in the style attribute. For more information on this see
and @see echopoint.stylesheet.CssStyleSheet.
,
Serialized FormField Summary |
Fields inherited from class echopoint.layout.AbstractLayoutManager |
componentMap, layoutManageableWR |
Constructor Summary | |
JspTemplateLayoutManager(java.lang.String path)
This constuctor will allow for multiple beans to be passed to the JSP using the addJspBeanGenerator methods. |
|
JspTemplateLayoutManager(java.lang.String path,
java.lang.Object bean,
java.lang.String beanName)
This constuctor allows for only one bean to be passed the JSP. |
Method Summary | |
void |
addBean(java.lang.Object bean,
java.lang.String beanName)
Adds a bean to the JSP LayoutManager mapped by beanName. |
void |
addJspBeanGenerator(JspBeanGenerator beanGen,
java.lang.String beanName)
Add a new JspBeanGenerator that will be passed to the JSP. |
void |
addLayoutComponent(nextapp.echo.Component component,
java.lang.Object constraints)
Add a Component that can be layed out in the JSP page using the EchoComponentTag. |
static void |
addPropertyManager(PropertyManager p)
Adds a PropertyManager to the list of available PropertyManagers. |
java.lang.Object |
getBean()
Get bean being passed to JSP. |
java.lang.Object |
getBean(java.lang.String beanName)
Returns a bean from the internal bean map with the specified bean name. |
java.lang.String |
getBeanName()
Name of bean being passed to JSP. |
java.util.Map |
getBeans()
Returns a Map of bean objects that have been added to the JSP LayoutManager |
CompilationContext |
getCompilationContext()
Returns the CompilationContext in use by this JspTemplateLayoutManager for the current page. |
nextapp.echo.Component |
getComponent(java.lang.String name)
Returns a Component based on the name given. |
java.util.Map |
getJspBeanGenerators()
Returns a Map of all the JspBeanGenerators in the layout manager |
java.lang.String |
getPath()
Location of the JSP file. |
PropertyManager |
getPropertyManager(java.lang.Class clazz)
Called to get a ProperyManagerfor a given clazz of Component |
boolean |
isLoudErrorsUsed()
This returns true if "loud" error messages are to be used during template compilation. |
boolean |
isPropertiesUsed()
Returns true if the Component properties can be set within the JSP echo tag. |
void |
removeAllBeans()
Remove all the Beans from the bean Map. |
void |
removeAllJspBeanGenerator()
Remove all the JspBeanGenerator objects in ths component. |
void |
removeBean(java.lang.String beanName)
Removes a bean from the bean Map via the specified key |
void |
removeJspBeanGenerator(java.lang.String beanName)
Remove the specified the JspBeanGenerator. |
void |
setBean(java.lang.Object bean)
Set/Change the bean that the JSP will be using. |
void |
setBeans(java.util.Map beanMap)
Sets the Map of bean names to bean objects via the specified Map. |
void |
setLoudErrorsUsed(boolean b)
Controls whether loud error messages are to be used during template compilation. |
void |
setPath(java.lang.String path)
Set/Change the location of the JSP file. |
void |
setPropertiesUsed(boolean b)
Controls whether Component properties can be set within the JSP echo tag. |
Methods inherited from class echopoint.layout.AbstractLayoutManager |
getComponent, getComponentMap, getContraints, getLayoutManageable, invalidateLayout, removeLayoutComponent, setLayoutManageable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JspTemplateLayoutManager(java.lang.String path)
path
- Location of the JSP file.public JspTemplateLayoutManager(java.lang.String path, java.lang.Object bean, java.lang.String beanName)
path
- Location of the JSP file.bean
- JavaBean or Array/Collection of JavaBeans to be
used in JSP.beanName
- Name that will be used within the JSP
to read the bean from request scope.Method Detail |
public void addLayoutComponent(nextapp.echo.Component component, java.lang.Object constraints)
This method is not intended to be called by any other than an LayoutManageable during Component add().
addLayoutComponent
in interface LayoutManager
addLayoutComponent
in class AbstractLayoutManager
public java.lang.Object getBean()
public java.lang.String getBeanName()
public java.util.Map getBeans()
public java.lang.Object getBean(java.lang.String beanName)
beanName
- - the key to used to retrive the bean
public java.util.Map getJspBeanGenerators()
public java.lang.String getPath()
public void removeAllJspBeanGenerator()
public void removeJspBeanGenerator(java.lang.String beanName)
public void removeBean(java.lang.String beanName)
beanName
- - the name of the bean to removepublic void removeAllBeans()
public void setBean(java.lang.Object bean)
public void setBeans(java.util.Map beanMap)
beanMap
- - the new Map of bean names to bean objectspublic void addJspBeanGenerator(JspBeanGenerator beanGen, java.lang.String beanName)
beanGen
- JspBeanGenerator to be used in the JSP.beanName
- Name that will be used within the JSP
to read the bean from request scope.public void addBean(java.lang.Object bean, java.lang.String beanName)
beanName
- - the name of the beanbean
- - the bean valuepublic void setPath(java.lang.String path)
public static final void addPropertyManager(PropertyManager p)
public nextapp.echo.Component getComponent(java.lang.String name)
ComponentMapper
getComponent
in interface ComponentMapper
ComponentMapper.getComponent(java.lang.String)
public PropertyManager getPropertyManager(java.lang.Class clazz)
PropertyManagerOwner
getPropertyManager
in interface PropertyManagerOwner
PropertyManagerOwner.getPropertyManager(Class)
public CompilationContext getCompilationContext()
This method is intended for use between the template compiling mechanism and hence is not for general consumption
public boolean isPropertiesUsed()
public void setPropertiesUsed(boolean b)
public boolean isLoudErrorsUsed()
public void setLoudErrorsUsed(boolean b)
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |