GetPropertyTag Class

com.bea.content.manager.servlets.jsp.taglib
GetPropertyTag Class

public class GetPropertyTag

    extends BaseTag

Tag to retrieve or print a property of a Node.

The Node must be set as an attribute of the page context with the id specified in this tag.

If the property is of type Property.BINARY and is a text document (eg. .txt, .html) then the document will be printed. If the BINARY property is not a document (eg. .gif, .pdf) then ShowBinaryServlet should be used.

If the property name is not specified the primary property will be used, if defined.

If a resultId is defined then it will be set with the value(s) of the Property. If there are multiple values then it will be set as a Collection. If the resultId is not set then the value(s) will be printed

If the following standard properties are used as the property name then the corresponding value from the Node will be returned.

  • cm_nodeName
  • cm_path
  • cm_createdBy
  • cm_modifiedBy
  • cm_createdDate
  • cm_modifiedDate


    Hierarchy
    Object
      TagSupport
        BaseTag
          GetPropertyTag
    All Implemented Interfaces

    IterationTag, Serializable, Tag

    Field Summary

    protected String
    baseHref
    The BASE HREF to use.
    protected int
    blockSize
    The block size to read the data in.
    protected String
    conversionType
    The conversion type.
    protected String
    dateFormat
    The date format to use.
    protected String
    defValue
    The default value to print if the property is not found, or if the property does not contain a value.
    protected int
    endIndex
    The index at which we should stop reading.
    protected boolean
    isMultiple
    If this is true then a Collection will be returned as the resultId, if false then an Object will be returned that may be cast to the appropriate Property type.
    protected String
    name
    The name of the property to print.
    protected Node
    node
    The Node to use.
    protected String
    numFormat
    The number format to use.
    protected Property
    property
    The Property to use.
    protected String
    resultId
    The id of the script variable to put the result into.
    protected String
    resultType
    The Type of the result.
    protected int
    startIndex
    The index at which we should start reading.
    protected int
    transactionTimeout
    The streaming of the data directly to the jsp page is wrapped in a transaction to cover the situation where the back-end system is transactional (like a database) and the InputStream retrieved is tied to that transactional resource (like a BlobInputStream).
       
    Fields from  com.bea.content.manager.servlets.jsp.taglib.BaseTag
    cacheId, cacheScope, cacheTimeout, failOnError, useCache
     
    Fields from  javax.servlet.jsp.tagext.TagSupport
    id, pageContext
     
    Fields from interface javax.servlet.jsp.tagext.IterationTag
    EVAL_BODY_AGAIN
     
    Fields from interface javax.servlet.jsp.tagext.Tag
    EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
     

    Constructor Summary

    GetPropertyTag()

     

    Method Summary

    public String
    convert(String in)
    Convert a string with the current convertType.
    public static String
    convert(String conversionType, String in)
    Convert a string according to the specified convertType.
    protected int
    doBinary(BinaryValue binaryValue)
    protected int
    doNonBinary(Collection values)
    public int
    doStartTag()
    Start the tag.
    public String
    getBaseHref()
    Get the value of GetPropertyTag.baseHref.
    public String
    getBlockSize()
    Get the value of GetPropertyTag.blockSize as a String.
    public String
    getConversionType()
    Get the value of GetPropertyTag.conversionType.
    public String
    getDateFormat()
    Get the date format to use.
    public String
    getDefault()
    Get the default value.
    public String
    getEndIndex()
    Get the value of GetPropertyTag.endIndex as a String.
    public String
    getIsMultiple()
    Get the value of GetPropertyTag.isMultiple.
    public String
    getName()
    Get the value of GetPropertyTag.name.
    public Node
    getNode()
    Get the Node to use.
    public String
    getNumFormat()
    Get the number format to use.
    public Collection
    getPropertyValues()
    public URL
    getRequestBaseHref(HttpServletRequest request)
    Gets the request base href.
    public String
    getResultId()
    Get the GetPropertyTag.resultId.
    public String
    getResultType()
    Get the GetPropertyTag.resultId.
    public URL
    getServerBaseHref(HttpServletRequest request)
    Gets the servers BaseHref.
    public String
    getStartIndex()
    Get the value of GetPropertyTag.startIndex as a String.
    public String
    getTransactionTimeout()
    Get the value of GetPropertyTag.transactionTimeout
    public void
    print(String s)
    Print the String to the JspWriter.
    public void
    println(String s)
    Println the String to the JspWriter.
    public void
    release()
    Release the tag.
    public void
    setAttribute(Collection values)
    Sets the given values on the pageContext.
    public void
    setBaseHref(String v)
    Set the value of GetPropertyTag.baseHref.
    public void
    setBlockSize(String v)
    Set the value of GetPropertyTag.blockSize.
    public void
    setConversionType(String conversionType)
    Sets the value of GetPropertyTag.conversionType.
    public void
    setDateFormat(String s)
    Set the date format to use.
    public void
    setDefault(String v)
    Set the default value.
    public void
    setEndIndex(String v)
    Set the value of GetPropertyTag.endIndex.
    public void
    setEndIndex(int endIndex)
    Set the value of GetPropertyTag.endIndex.
    public void
    setIsMultiple(String s)
    Set the value of GetPropertyTag.isMultiple.
    public void
    setIsMultiple(boolean b)
    Set the value of GetPropertyTag.isMultiple.
    public void
    setName(String v)
    Set the value of GetPropertyTag.name.
    public void
    setNode(Node node)
    Set the node to use.
    public void
    setNumFormat(String s)
    Set the number format to use.
    public void
    setResultId(String resultId)
    Set the GetPropertyTag.resultId.
    public void
    setResultType(String resultType)
    Set the GetPropertyTag.resultType.
    public void
    setStartIndex(String v)
    Set the value of GetPropertyTag.startIndex.
    public void
    setStartIndex(int startIndex)
    Set the value of GetPropertyTag.startIndex.
    public void
    setTransactionTimeout(String timeout)
    Set the value of GetPropertyTag.transactionTimeout
    public String
    toString(Object obj)
    Convert an Object to a string with our current formatting.
    public String
    toString(Calendar cal)
    Convert a Calendar to our date format.
    public String
    toString(Number n)
    Convert a number to our date format.
     
    Methods from  com.bea.content.manager.servlets.jsp.taglib.BaseTag
    getCacheId, getCacheScope, getCacheTimeout, getFailOnError, getHttpSession, getUseCache, getUserId, setCacheId, setCacheScope, setCacheTimeout, setCacheTimeout, setFailOnError, setFailOnError, setUseCache, setUseCache, toDictionary
     
    Methods from  javax.servlet.jsp.tagext.TagSupport
    doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
     
    Methods from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
       
    Methods from interface javax.servlet.jsp.tagext.IterationTag
    doAfterBody
     
    Methods from interface javax.servlet.jsp.tagext.Tag
    doEndTag, doStartTag, getParent, release, setPageContext, setParent
     

    Field Detail

    baseHref

    protected String baseHref
    
    The BASE HREF to use.

    The content's identifier will be appended automatically to this.


    blockSize

    protected int blockSize
    
    The block size to read the data in. Defaults to 2048.


    conversionType

    protected String conversionType
    
    The conversion type. Can be either "html", "url", or anything else for no conversion. See ContentHelper.toHtml() for an explanation of how html will be converted. See ContentHelper.pathInfoEncode() for an explanation of how a conversion type of "url" for a "cm_path" property is converted. For a conversion type of "url" that isn't for the "cm_path" property, the url will be encoded in "UTF-8" if supported. If it isn't supported then the default encoding will be used.


    dateFormat

    protected String dateFormat
    
    The date format to use.


    defValue

    protected String defValue
    
    The default value to print if the property is not found, or if the property does not contain a value.


    endIndex

    protected int endIndex
    
    The index at which we should stop reading.


    isMultiple

    protected boolean isMultiple
    
    If this is true then a Collection will be returned as the resultId, if false then an Object will be returned that may be cast to the appropriate Property type. The default is False.


    name

    protected String name
    
    The name of the property to print.


    node

    protected Node node
    
    The Node to use.


    numFormat

    protected String numFormat
    
    The number format to use.


    property

    protected Property property
    
    The Property to use.


    resultId

    protected String resultId
    
    The id of the script variable to put the result into. If the resultId isn't set then the property will be written to the PageContext.


    resultType

    protected String resultType
    
    The Type of the result. May only be set when isMultiple = False.


    startIndex

    protected int startIndex
    
    The index at which we should start reading. Defaults to 0.


    transactionTimeout

    protected int transactionTimeout
    
    The streaming of the data directly to the jsp page is wrapped in a transaction to cover the situation where the back-end system is transactional (like a database) and the InputStream retrieved is tied to that transactional resource (like a BlobInputStream). If this attribute is set (not -1) then the timeout on the transaction is set to this value (in sec).

     

    Constructor Detail

    GetPropertyTag

    public GetPropertyTag()
    
     

    Method Detail

    convert(String) Method

    public String convert(String in)
    
    Convert a string with the current convertType.


    convert(String, String) Method

    public static String convert(String conversionType, 
                                 String in)
    
    Convert a string according to the specified convertType.

    Parameters

    conversionType
    "html", "url", or anything else for no encoding.
    in
    the string

    Returns

    the converted string.

    doBinary(BinaryValue) Method

    protected int doBinary(BinaryValue binaryValue)
    throws JspTagException

    Exceptions

    JspTagException

    doNonBinary(Collection) Method

    protected int doNonBinary(Collection values)
    throws JspTagException

    Exceptions

    JspTagException

    doStartTag() Method

    public int doStartTag()
    throws JspException
    Start the tag.

    Overrides
    TagSupport.doStartTag()

    Exceptions

    JspException

    getBaseHref() Method

    public String getBaseHref()
    
    Get the value of GetPropertyTag.baseHref.


    getBlockSize() Method

    public String getBlockSize()
    
    Get the value of GetPropertyTag.blockSize as a String.


    getConversionType() Method

    public String getConversionType()
    
    Get the value of GetPropertyTag.conversionType.


    getDateFormat() Method

    public String getDateFormat()
    
    Get the date format to use.


    getDefault() Method

    public String getDefault()
    
    Get the default value.


    getEndIndex() Method

    public String getEndIndex()
    
    Get the value of GetPropertyTag.endIndex as a String.


    getIsMultiple() Method

    public String getIsMultiple()
    
    Get the value of GetPropertyTag.isMultiple.


    getName() Method

    public String getName()
    
    Get the value of GetPropertyTag.name.


    getNode() Method

    public Node getNode()
    
    Get the Node to use.


    getNumFormat() Method

    public String getNumFormat()
    
    Get the number format to use.


    getPropertyValues() Method

    public Collection getPropertyValues()
    throws JspTagException

    Exceptions

    JspTagException

    getRequestBaseHref(HttpServletRequest) Method

    public URL getRequestBaseHref(HttpServletRequest request)
    throws MalformedURLException
    Gets the request base href.

    Exceptions

    MalformedURLException

    getResultId() Method

    public String getResultId()
    
    Get the GetPropertyTag.resultId.


    getResultType() Method

    public String getResultType()
    
    Get the GetPropertyTag.resultId.


    getServerBaseHref(HttpServletRequest) Method

    public URL getServerBaseHref(HttpServletRequest request)
    throws MalformedURLException
    Gets the servers BaseHref. If it is a regular http request (http, https, ftp) against the standard ports then just return it.

    Exceptions

    MalformedURLException

    getStartIndex() Method

    public String getStartIndex()
    
    Get the value of GetPropertyTag.startIndex as a String.


    getTransactionTimeout() Method

    public String getTransactionTimeout()
    
    Get the value of GetPropertyTag.transactionTimeout


    print(String) Method

    public void print(String s)
    
    Print the String to the JspWriter.


    println(String) Method

    public void println(String s)
    
    Println the String to the JspWriter.


    release() Method

    public void release()
    
    Release the tag.

    Overrides
    BaseTag.release()

    setAttribute(Collection) Method

    public void setAttribute(Collection values)
    
    Sets the given values on the pageContext.


    setBaseHref(String) Method

    public void setBaseHref(String v)
    
    Set the value of GetPropertyTag.baseHref.


    setBlockSize(String) Method

    public void setBlockSize(String v)
    
    Set the value of GetPropertyTag.blockSize.


    setConversionType(String) Method

    public void setConversionType(String conversionType)
    
    Sets the value of GetPropertyTag.conversionType.


    setDateFormat(String) Method

    public void setDateFormat(String s)
    
    Set the date format to use.


    setDefault(String) Method

    public void setDefault(String v)
    
    Set the default value.


    setEndIndex(String) Method

    public void setEndIndex(String v)
    
    Set the value of GetPropertyTag.endIndex.


    setEndIndex(int) Method

    public void setEndIndex(int endIndex)
    
    Set the value of GetPropertyTag.endIndex.


    setIsMultiple(String) Method

    public void setIsMultiple(String s)
    
    Set the value of GetPropertyTag.isMultiple.


    setIsMultiple(boolean) Method

    public void setIsMultiple(boolean b)
    
    Set the value of GetPropertyTag.isMultiple.


    setName(String) Method

    public void setName(String v)
    
    Set the value of GetPropertyTag.name.


    setNode(Node) Method

    public void setNode(Node node)
    
    Set the node to use.


    setNumFormat(String) Method

    public void setNumFormat(String s)
    
    Set the number format to use.


    setResultId(String) Method

    public void setResultId(String resultId)
    
    Set the GetPropertyTag.resultId.


    setResultType(String) Method

    public void setResultType(String resultType)
    
    Set the GetPropertyTag.resultType.


    setStartIndex(String) Method

    public void setStartIndex(String v)
    
    Set the value of GetPropertyTag.startIndex.


    setStartIndex(int) Method

    public void setStartIndex(int startIndex)
    
    Set the value of GetPropertyTag.startIndex.


    setTransactionTimeout(String) Method

    public void setTransactionTimeout(String timeout)
    
    Set the value of GetPropertyTag.transactionTimeout


    toString(Object) Method

    public String toString(Object obj)
    throws JspTagException
    Convert an Object to a string with our current formatting.

    Exceptions

    JspTagException
    thrown on conversion failure when failOnError is true.

    Related Topics

    GetPropertyTag.getDefault()
    GetPropertyTag.toString(Calendar)
    GetPropertyTag.toString(Number)


    toString(Calendar) Method

    public String toString(Calendar cal)
    throws JspTagException
    Convert a Calendar to our date format.

    Exceptions

    JspTagException
    thrown on conversion failure when failOnError is true.

    toString(Number) Method

    public String toString(Number n)
    throws JspTagException
    Convert a number to our date format.

    Exceptions

    JspTagException
    thrown on conversion failure when failOnError is true.