<commit_before>/**
 * $Id$
 *
 * Todo:
 *   - provide filters in some way?  Instead of just getting some bit of data
 *     also provide a way to feed that data through some other object that
 *     will reformat it in some way (like converting dates to another format)
 *   - update documentation, HTML column attributes are not set.
 *   - specify groupings.
 *   - error checking, value or property must be set.
 *
 */

package org.apache.taglibs.display;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.tagext.TagSupport;

/**
 * This tag works hand in hand with the SmartListTag to display a list of
 * objects.  This describes a column of data in the SmartListTag.  There can
 * be any (reasonable) number of columns that make up the list.
 *
 * <p>This tag does no work itself, it is simply a container of information.  The
 * TableTag does all the work based on the information provided in the
 * attributes of this tag.
 * <p>
 * Usage:</p><p>
 *   &lt;display:column property="title"
 *	 	           title="College Title" width="33%"
 *               href="/osiris/pubs/college/edit.page"
 *		           paramId="OID"
 *               paramProperty="OID" /&gt;
 * </p><p>
 * Attributes:<pre>
 *
 *   property       - the property method that is called to retrieve the
 *                    information to be displayed in this column.  This method
 *                    is called on the current object in the iteration for
 *                    the given row.  The property format is in typical struts
 *                    format for properties (required)
 *
 *   title          - the title displayed for this column.  if this is omitted
 *                    then the property name is used for the title of the column
 *                    (optional)
 *
 *   nulls          - by default, null values don't appear in the list, by
 *                    setting viewNulls to 'true', then null values will
 *                    appear as "null" in the list (mostly useful for debugging)
 *                    (optional)
 *
 *   width          - the width of the column (gets passed along to the html
 *                    td tag). (optional)
 *
 *   group          - the grouping level (starting at 1 and incrementing) of
 *                    this column (indicates if successive contain the same
 *                    values, then they should not be displayed).  The level
 *                    indicates that if a lower level no longer matches, then
 *                    the matching for this higher level should start over as
 *                    well. If this attribute is not included, then no grouping
 *                    is performed. (optional)
 *
 *   decorator      - a class that should be used to "decorate" the underlying
 *                    object being displayed. If a decorator is specified for
 *                    the entire table, then this decorator will decorate that
 *                    decorator. (optional)
 *
 *   autolink       - if set to true, then any email addresses and URLs found
 *                    in the content of the column are automatically converted
 *                    into a hypertext link.
 *
 *   href           - if this attribute is provided, then the data that is
 *                    shown for this column is wrapped inside a &lt;a href&gt;
 *                    tag with the url provided through this attribute.
 *                    Typically you would use this attribute along with one
 *                    of the struts-like param attributes below to create
 *                    a dynamic link so that each row creates a different
 *                    URL based on the data that is being viewed. (optional)
 *
 *   paramId        - The name of the request parameter that will be dynamically
 *                    added to the generated href URL. The corresponding value
 *                    is defined by the paramProperty and (optional) paramName
 *                    attributes, optionally scoped by the paramScope attribute.
 *                    (optional)
 *
 *   paramName      - The name of a JSP bean that is a String containing the
 *                    value for the request parameter named by paramId (if
 *                    paramProperty is not specified), or a JSP bean whose
 *                    property getter is called to return a String (if
 *                    paramProperty is specified). The JSP bean is constrained
 *                    to the bean scope specified by the paramScope property,
 *                    if it is specified.  If paramName is omitted, then it is
 *                    assumed that the current object being iterated on is the
 *                    target bean. (optional)
 *
 *   paramProperty  - The name of a property of the bean specified by the
 *                    paramName attribute (or the current object being iterated
 *                    on if paramName is not provided), whose return value must
 *                    be a String containing the value of the request parameter
 *                    (named by the paramId attribute) that will be dynamically
 *                    added to this href URL. (optional)
 *
 *   paramScope     - The scope within which to search for the bean specified by
 *                    the paramName attribute. If not specified, all scopes are
 *                    searched.  If paramName is not provided, then the current
 *                    object being iterated on is assumed to be the target bean.
 *                    (optional)
 *
 *
 *   maxLength      - If this attribute is provided, then the column's displayed
 *                    is limited to this number of characters.  An elipse (...)
 *                    is appended to the end if this column is linked, and the
 *                    user can mouseover the elipse to get the full text.
 *                    (optional)
 *
 *   maxWords       - If this attribute is provided, then the column's displayed
 *                    is limited to this number of words.  An elipse (...) is
 *                    appended to the end if this column is linked, and the user
 *                    can mouseover the elipse to get the full text. (optional)
 *
 *   titleColSpan    - the number of columns that the title should span. Default is 1.
 *
 */
public class ColumnTag extends BodyTagSupport implements Cloneable {
    private String property;
    private String title;
    private String nulls;
    private String sort;
    private String autolink;
    private String group; /* If this property is set then the values have to be grouped */

    private String href;
    private String paramId;
    private String paramName;
    private String paramProperty;
    private String paramScope;
    private int maxLength;
    private int maxWords;
    private int titleColSpan = 1;

    private String width;
    private String align;
    private String background;
    private String bgcolor;
    private String height;
    private String nowrap;
    private String valign;
    private String clazz;<commit_msg>Javadoc woops.<commit_after>/**
 * $Id$
 *
 * Todo:
 *   - provide filters in some way?  Instead of just getting some bit of data
 *     also provide a way to feed that data through some other object that
 *     will reformat it in some way (like converting dates to another format)
 *   - update documentation, HTML column attributes are not set.
 *   - specify groupings.
 *   - error checking, value or property must be set.
 *
 */

package org.apache.taglibs.display;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.tagext.TagSupport;

/**
 * This tag works hand in hand with the SmartListTag to display a list of
 * objects.  This describes a column of data in the SmartListTag.  There can
 * be any (reasonable) number of columns that make up the list.
 *
 * <p>This tag does no work itself, it is simply a container of information.  The
 * TableTag does all the work based on the information provided in the
 * attributes of this tag.
 * <p>
 * Usage:</p><p>
 *   &lt;display:column property="title"
 *	 	           title="College Title" width="33%"
 *               href="/osiris/pubs/college/edit.page"
 *		           paramId="OID"
 *               paramProperty="OID" /&gt;
 * </p><p>
 * Attributes:<pre>
 *
 *   property       - the property method that is called to retrieve the
 *                    information to be displayed in this column.  This method
 *                    is called on the current object in the iteration for
 *                    the given row.  The property format is in typical struts
 *                    format for properties (required)
 *
 *   title          - the title displayed for this column.  if this is omitted
 *                    then the property name is used for the title of the column
 *                    (optional)
 *
 *   nulls          - by default, null values don't appear in the list, by
 *                    setting viewNulls to 'true', then null values will
 *                    appear as "null" in the list (mostly useful for debugging)
 *                    (optional)
 *
 *   width          - the width of the column (gets passed along to the html
 *                    td tag). (optional)
 *
 *   group          - the grouping level (starting at 1 and incrementing) of
 *                    this column (indicates if successive contain the same
 *                    values, then they should not be displayed).  The level
 *                    indicates that if a lower level no longer matches, then
 *                    the matching for this higher level should start over as
 *                    well. If this attribute is not included, then no grouping
 *                    is performed. (optional)
 *
 *   decorator      - a class that should be used to "decorate" the underlying
 *                    object being displayed. If a decorator is specified for
 *                    the entire table, then this decorator will decorate that
 *                    decorator. (optional)
 *
 *   autolink       - if set to true, then any email addresses and URLs found
 *                    in the content of the column are automatically converted
 *                    into a hypertext link.
 *
 *   href           - if this attribute is provided, then the data that is
 *                    shown for this column is wrapped inside a &lt;a href&gt;
 *                    tag with the url provided through this attribute.
 *                    Typically you would use this attribute along with one
 *                    of the struts-like param attributes below to create
 *                    a dynamic link so that each row creates a different
 *                    URL based on the data that is being viewed. (optional)
 *
 *   paramId        - The name of the request parameter that will be dynamically
 *                    added to the generated href URL. The corresponding value
 *                    is defined by the paramProperty and (optional) paramName
 *                    attributes, optionally scoped by the paramScope attribute.
 *                    (optional)
 *
 *   paramName      - The name of a JSP bean that is a String containing the
 *                    value for the request parameter named by paramId (if
 *                    paramProperty is not specified), or a JSP bean whose
 *                    property getter is called to return a String (if
 *                    paramProperty is specified). The JSP bean is constrained
 *                    to the bean scope specified by the paramScope property,
 *                    if it is specified.  If paramName is omitted, then it is
 *                    assumed that the current object being iterated on is the
 *                    target bean. (optional)
 *
 *   paramProperty  - The name of a property of the bean specified by the
 *                    paramName attribute (or the current object being iterated
 *                    on if paramName is not provided), whose return value must
 *                    be a String containing the value of the request parameter
 *                    (named by the paramId attribute) that will be dynamically
 *                    added to this href URL. (optional)
 *
 *   paramScope     - The scope within which to search for the bean specified by
 *                    the paramName attribute. If not specified, all scopes are
 *                    searched.  If paramName is not provided, then the current
 *                    object being iterated on is assumed to be the target bean.
 *                    (optional)
 *
 *
 *   maxLength      - If this attribute is provided, then the column's displayed
 *                    is limited to this number of characters.  An elipse (...)
 *                    is appended to the end if this column is linked, and the
 *                    user can mouseover the elipse to get the full text.
 *                    (optional)
 *
 *   maxWords       - If this attribute is provided, then the column's displayed
 *                    is limited to this number of words.  An elipse (...) is
 *                    appended to the end if this column is linked, and the user
 *                    can mouseover the elipse to get the full text. (optional)
 *
 *   titleColSpan    - the number of columns that the title should span. Default is 1.
 *</pre></p>
 */
public class ColumnTag extends BodyTagSupport implements Cloneable {
    private String property;
    private String title;
    private String nulls;
    private String sort;
    private String autolink;
    private String group; /* If this property is set then the values have to be grouped */

    private String href;
    private String paramId;
    private String paramName;
    private String paramProperty;
    private String paramScope;
    private int maxLength;
    private int maxWords;
    private int titleColSpan = 1;

    private String width;
    private String align;
    private String background;
    private String bgcolor;
    private String height;
    private String nowrap;
    private String valign;
    private String clazz;
{'fraction_non_alphanumeric': 0.05289778714436249, 'fraction_numerical': 0.0007024938531787847, 'mean_word_length': 1.813994860644396, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7320094', 'n_tokens_mistral': 3389, 'n_tokens_neox': 3210, 'n_words': 1677}