org.opencms.jsp
Class CmsJspTagContentInfo

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.opencms.jsp.CmsJspTagContentInfo
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag, I_CmsMacroResolver

public class CmsJspTagContentInfo
extends javax.servlet.jsp.tagext.TagSupport
implements I_CmsMacroResolver

Used to access and display XML content item information from the VFS.

Since:
6.0.0
Version:
$Revision: 1.17 $
Author:
Thomas Weckert
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface org.opencms.util.I_CmsMacroResolver
MACRO_DELIMITER, MACRO_DELIMITER_OLD, MACRO_END, MACRO_END_OLD, MACRO_START, MACRO_START_OLD
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
CmsJspTagContentInfo()
           
 
Method Summary
 int doEndTag()
           
 int doStartTag()
           
 java.lang.String getMacroValue(java.lang.String macro)
          Resolves a single macro to the macro value, returns null if the macro could not be resolved.
 java.lang.String getScope()
          Returns the scope under which the content info is saved in the page context.
protected  int getScopeAsInt(java.lang.String scope)
          Returns the int value of the specified scope string.
 java.lang.String getValue()
          Returns the name of the content info's value that should be printed out.
 java.lang.String getVar()
          Returns the name of the variable under which the content info bean should be saved in the page context.
 boolean isKeepEmptyMacros()
          Returns true if macros that could not be resolved are kept "as is" in the input String, false if they are replaced by an empty String.
 void release()
           
 java.lang.String resolveMacros(java.lang.String input)
          Resolves all macros in the input, replacing them with the macro values.
 void setScope(java.lang.String scope)
          Sets the scope under which the content info is saved in the page context.
 void setValue(java.lang.String value)
          Sets the name of the content info's value that should be printed out.
 void setVar(java.lang.String var)
          Sets the name of the variable under which the content info bean should be saved in the page context.
protected  void storeContentInfoBean(CmsJspTagContentLoad container, java.lang.String variable, int scope)
          Stores the container's content info bean under the specified scope in the page context.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsJspTagContentInfo

public CmsJspTagContentInfo()
Method Detail

doEndTag

public int doEndTag()
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
See Also:
Tag.doEndTag()

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException
See Also:
Tag.doStartTag()

getMacroValue

public java.lang.String getMacroValue(java.lang.String macro)
Description copied from interface: I_CmsMacroResolver
Resolves a single macro to the macro value, returns null if the macro could not be resolved.

Specified by:
getMacroValue in interface I_CmsMacroResolver
Parameters:
macro - the macro to resolve
Returns:
the resolved macro or null if the macro could not be resolved
See Also:
I_CmsMacroResolver.getMacroValue(java.lang.String)

getScope

public java.lang.String getScope()
Returns the scope under which the content info is saved in the page context.

Returns:
the scope under which the content info is saved in the page context

getValue

public java.lang.String getValue()
Returns the name of the content info's value that should be printed out.

Returns:
the name of the content info's value that should be printed out

getVar

public java.lang.String getVar()
Returns the name of the variable under which the content info bean should be saved in the page context.

Returns:
the name of the variable under which the content info bean should be saved in the page context

isKeepEmptyMacros

public boolean isKeepEmptyMacros()
Description copied from interface: I_CmsMacroResolver
Returns true if macros that could not be resolved are kept "as is" in the input String, false if they are replaced by an empty String.

Specified by:
isKeepEmptyMacros in interface I_CmsMacroResolver
Returns:
true if macros that could not be resolved are kept "as is" in the input String, false if they are replaced by an empty String
See Also:
I_CmsMacroResolver.isKeepEmptyMacros()

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport
See Also:
Tag.release()

resolveMacros

public java.lang.String resolveMacros(java.lang.String input)
Description copied from interface: I_CmsMacroResolver
Resolves all macros in the input, replacing them with the macro values.

The flag I_CmsMacroResolver.isKeepEmptyMacros() controls how to deal with macros found in the input that can not be resolved.

Specified by:
resolveMacros in interface I_CmsMacroResolver
Parameters:
input - the input to resolve the macros in
Returns:
the input with all macros resolved
See Also:
I_CmsMacroResolver.resolveMacros(java.lang.String)

setScope

public void setScope(java.lang.String scope)
Sets the scope under which the content info is saved in the page context.

Parameters:
scope - the scope under which the content info is saved in the page context

setValue

public void setValue(java.lang.String value)
Sets the name of the content info's value that should be printed out.

Parameters:
value - the name of the content info's value that should be printed out

setVar

public void setVar(java.lang.String var)
Sets the name of the variable under which the content info bean should be saved in the page context.

Parameters:
var - the name of the variable under which the content info bean should be saved in the page context

getScopeAsInt

protected int getScopeAsInt(java.lang.String scope)
Returns the int value of the specified scope string.

The default value is PageContext.PAGE_SCOPE.

Parameters:
scope - the string name of the desired scope, e.g. "application", "request"
Returns:
the int value of the specified scope string

storeContentInfoBean

protected void storeContentInfoBean(CmsJspTagContentLoad container,
                                    java.lang.String variable,
                                    int scope)
Stores the container's content info bean under the specified scope in the page context.

Parameters:
container - the parent container
variable - the variable under which the content info bean is saved
scope - the scope under which the content info bean is saved