ListChildren Class Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Writes a TABLE containing list of direct child documents of a document to the supplied stream or the default response stream. The List Children class acts as the underlying engine for the List Children AS component.
Inheritance Hierarchy

SystemObject
  ContentStudio.SiteCodeBase
    ContentStudio.Site.ActiveScriptingActiveScriptingBase
      ContentStudio.Site.ActiveScriptingDocumentBase
        ContentStudio.Site.ActiveScripting.DocumentListChildren

Namespace: ContentStudio.Site.ActiveScripting.Document
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public class ListChildren : DocumentBase

The ListChildren type exposes the following members.

Constructors

  NameDescription
Public methodListChildren
Constructs a new instance of the ListChildren class that writes to the default response stream
Public methodListChildren(Stream)
Constructs a new instance of the ListChildren class that writes to the supplied stream
Top
Properties

  NameDescription
Public propertyBackwardsComponentCompatibilityMode
Sets or gets a value that indicates whether the code runs in backwards compatibility component mode. The default value is false.
(Inherited from ActiveScriptingBase.)
Public propertyBorderWidth
Sets or gets a value of the border attribute of the table. This regulates the width of the borders around the table and its cells. Specify zero to omit borders.
Public propertyCellClass
Sets or gets a value that indicates the class attribute of each generate table cell. This parameter should be Empty or null (Nothing in Visual Basic) if no CSS class is specified.
Public propertyCellPadding
Sets or gets a value that indicates the cellpadding attribute of the generated table. This attribute regulates space between the edge and the text within each cell in the table.
Public propertyCellSpacing
Sets or gets a value that indicates the cellspacing attribute that regulates the space between each generated table cell. Default value is zero.
Public propertyComponentName
Gets the name of the component
(Overrides ActiveScriptingBaseComponentName.)
Public propertyConformance
Gets a value which specifies which type of code a component can generate.
(Overrides ActiveScriptingBaseConformance.)
Protected propertyCode exampleCS_DataFields
Gets a EPTXmlParser that contains a collection of EPT field definitions and values. This property is the replacement for the obsolete EPT_GetFieldName(String) and EPT_GetFieldValue(String) methods.
(Inherited from CodeBase.)
Public propertyDateFormattingString
Sets or gets a value that indicates a date format string to use when rendering a column in the DateTime format (ie. Publishdate).
Public propertyElementType
Gets a value which specifies the type of outer element the component generates.
(Overrides ActiveScriptingBaseElementType.)
Public propertyEncoding
Sets or gets the encoding the component uses. The default encoding is the UTF8 encoding without byte order mark.
(Inherited from ActiveScriptingBase.)
Public propertyGenerateColumnHeader
Sets or gets a value that indicates whether a column headings should be generated.
Note Note
This property is ignored with the Orientation set to Row.
Public propertyIndentChar
Sets or gets the character that will be used as indent char when rendering the html code.
Public propertyIndentSize
Get the number of indents to use with each indented level.
Public propertyOrientation
Sets or gets a value that indicates the orientation of the generated table
Protected propertyPage
A reference to the current context page. This will initialize in the constructor of this class.
(Inherited from CodeBase.)
Public propertyParentDocumentID
Sets or gets the document whose child documents should be listed. This property can be null (Nothing in Visual Basic) or zero to list the children of the current document.
Public propertyPresentationTemplateID
Sets or gets a value a value that indicates the ID of the presentation template document to use in each document link generated. This property can be null (Nothing in Visual Basic) or zero if no presentation template should be used.
Public propertyPreviewDate
Sets or gets a value that specifies a point in time to filter. With this value it is possible to take the publish date functionality into concideration.
Protected propertyRunningUserControl
Gets the current running user control.
(Inherited from CodeBase.)
Public propertySortOrder
Sets or gets a value that indicates the sort order of the generated table
Public propertyTableCaption
Sets or gets a value of the caption element in the generated table. This parameter should be Empty or null (Nothing in Visual Basic) if no caption is specified.
Public propertyTableClass
Sets or gets a value that indicates the class attribute of the generate table. This parameter should be Empty or null (Nothing in Visual Basic) if no CSS class is specified.
Public propertyTableSummary
Sets or gets a value of the summary attribute of the generate table. This parameter should be Empty or null (Nothing in Visual Basic) if no summary is specified.
Note Note
Omitting this attribute causes XHTML 1.0 strict or higher validators to generate warnings.
Public propertyTableWidth
Sets or gets a value that indicates the width of the generated table.
Public propertyTarget
Sets or gets a value that indicates the target of the link formed with each document. This parameter should be Empty or null (Nothing in Visual Basic) if no target is specified.
Public propertyWrap
Sets or gets a value that indicates whether the text in cells should automatically wrap as needed.
Top
Methods

  NameDescription
Protected methodBuildHTMLComponentException
Returns an component exception in HTML format.
(Inherited from ActiveScriptingBase.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Protected methodGenerateLinkTargetAttribute
Returns the attribute string to be written to the link.
(Inherited from ActiveScriptingBase.)
Public methodGetColumnDefinition
Returns the column definition for a specific position
Public methodGetColumnHeaderText
Returns the title of a specific column header
Protected methodGetCorrectField
Extracts the correct value from a passed in EPT field name and a static field value.
(Inherited from ActiveScriptingBase.)
Protected methodStatic memberGetDataRow
Gets a new DataRow object with data.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodInvoke
Invokes the component and writes its content into the specified stream
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodReadFromApplicationCache
Returns data that is read from the application cache.
(Inherited from ActiveScriptingBase.)
Protected methodRenderCell(TextWriter, String)
Render a table cell element (<td>).
Protected methodRenderCell(TextWriter, String, ListChildrenDataRow, Boolean)
Render a table cell element (<td>).
Protected methodRenderHeader
Renders the table header.
Protected methodRenderLink
Renders a link element (<a>) based on the properties of the class and the data passed in.
Protected methodRenderRowEnd
Renders the table row end element (</tr>)
Protected methodRenderRowStart
Renders the table row start element (<tr>)
Protected methodRenderTableAsColumnStyle
Renders the table, oriented using columns.
Protected methodRenderTableAsRowStyle
Renders the table, oriented using rows.
Protected methodRenderTableEnd
Writes the closing tbody and table elements to the supplied writer.
Protected methodRenderTableStart
Writes the table start element with its attributes including the caption element and a tbody to the supplied writer.
Protected methodSetApplicationCache
Stores a string in the application cache.
(Inherited from ActiveScriptingBase.)
Public methodSetColumnDefinition(Int32, ListChildrenColumnDefinition)
Sets a column definition at a specific column position.
Public methodSetColumnDefinition(Int32, String)
Sets a column definition at a specific column position.
Public methodSetColumnHeaderText
Sets the value of one of the column headers.
Protected methodSyncronizeMLC
Provides support for components that needs to be MLC aware, by localizing the supplied category or presentation template from the current document, or the preferred language of the visitor.
(Inherited from ActiveScriptingBase.)
Public methodToString (Inherited from Object.)
Protected methodWriteAttribute(TextWriter, String, String)
Writes an attribute string to the supplied stream, unless Value is an empty string or null
(Inherited from ActiveScriptingBase.)
Protected methodWriteAttribute(TextWriter, String, String, Boolean)
Writes an attribute string to the supplied stream.
(Inherited from ActiveScriptingBase.)
Top
Fields

  NameDescription
Public fieldStatic memberMAX_COLUMNS
Defines the maximum number of colums that can be rendered by the ListChildren component.
Top
Remarks

To use this class, create an instance of this object, set up the properties and call the Invoke method with an appropriate set of parameters. This class can throw exceptions, thus your code should be wrapped within try/catch statements in order to avoid the entire page to crash. This class generates inline code, thus you must wrap it into a block element to make the page validate according to the HTML/XHTML regulations. The generated code is fully HTML/XHTML strict compatible.
Examples

The following example writes a table to Response stream with all direct child documents of a certain document. The example works only within Content Studio.
Note Note
The sample sets a lot of properties but keep in mind that all properties have default values and if these is good for you, there is no use changing them in code.

protected void ListMyChildren(int documentID)
{
  try
  {
    ListChildren li = new ListChildren();
    li.ParentDocumentID = documentID;
    li.SetColumnDefinition(0, "ID");
    li.SetColumnDefinition(1, "Title");
    li.SetColumnDefinition(2, "Date");
    li.SetColumnDefinition(3, "None");
    li.SetColumnHeaderText(0, "Document id");
    li.SetColumnHeaderText(1, "Document name");
    li.SetColumnHeaderText(2, "Publish date");
    li.TableCaption = "A list with child documents";
    li.TableSummary = li.TableCaption;
    li.CellPadding = 4;
    li.CellSpacing = 3;
    li.IndentChar = '\t';
    li.IndentSize = 1;
    li.TableClass = "DataList";
    li.CellClass = "DataCell";
    li.TableWidth = 400;
    li.BorderWidth = 1;
    li.DateFormattingString = "D";
    li.Orientation = ListChildren.ListOrientation.Column;
    li.GenerateColumnHeader = true;
    li.Wrap = false;
    li.Invoke();
  }
  catch(Exception ex)
  {
     Response.Write(String.Format("<b>{0}</b>", Server.HtmlEncode(ex.Message)));
  }    
}
Paste the code sample into the code behind view in the webitor as a new member of the class. From the Html code you now can write the following code to call ListMyChildren with a certain document identifier.
<div>
<% =ListMyChildren(25749) %>
</div>
See Also

Reference