Content Studio Web Content Management System
SystemObject
ContentStudio.SiteCodeBase
ContentStudio.Site.ActiveScriptingActiveScriptingBase
ContentStudio.Site.ActiveScriptingDocumentBase
ContentStudio.Site.ActiveScripting.DocumentListChildren
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
Top
Top
Top
Top
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.
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.
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.
[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
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
The ListChildren type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ListChildren |
Constructs a new instance of the ListChildren class that
writes to the default response stream
| |
ListChildren(Stream) |
Constructs a new instance of the ListChildren class that
writes to the supplied stream
|
Properties
Name | Description | |||
---|---|---|---|---|
BackwardsComponentCompatibilityMode |
Sets or gets a value that indicates whether the code runs in backwards
compatibility component mode. The default value is false.
(Inherited from ActiveScriptingBase.) | |||
BorderWidth |
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.
| |||
CellClass |
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.
| |||
CellPadding |
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.
| |||
CellSpacing |
Sets or gets a value that indicates the cellspacing attribute that regulates the space between each generated table cell. Default value is zero.
| |||
ComponentName | Gets the name of the component (Overrides ActiveScriptingBaseComponentName.) | |||
Conformance |
Gets a value which specifies which type of code a component can generate.
(Overrides ActiveScriptingBaseConformance.) | |||
CS_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.) | |||
DateFormattingString |
Sets or gets a value that indicates a date format string to use when rendering a column in the DateTime format (ie. Publishdate).
| |||
ElementType |
Gets a value which specifies the type of outer element the component generates.
(Overrides ActiveScriptingBaseElementType.) | |||
Encoding |
Sets or gets the encoding the component uses. The default encoding is
the UTF8 encoding without byte order mark.
(Inherited from ActiveScriptingBase.) | |||
GenerateColumnHeader |
Sets or gets a value that indicates whether a column headings should be generated.
| |||
IndentChar |
Sets or gets the character that will be used as indent char when rendering the html code.
| |||
IndentSize |
Get the number of indents to use with each indented level.
| |||
Orientation |
Sets or gets a value that indicates the orientation of the generated table
| |||
Page |
A reference to the current context page.
This will initialize in the constructor of this class.
(Inherited from CodeBase.) | |||
ParentDocumentID |
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.
| |||
PresentationTemplateID |
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.
| |||
PreviewDate |
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.
| |||
RunningUserControl |
Gets the current running user control.
(Inherited from CodeBase.) | |||
SortOrder |
Sets or gets a value that indicates the sort order of the generated table
| |||
TableCaption |
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.
| |||
TableClass |
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.
| |||
TableSummary |
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.
| |||
TableWidth |
Sets or gets a value that indicates the width of the generated table.
| |||
Target |
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.
| |||
Wrap |
Sets or gets a value that indicates whether the text in cells should automatically wrap as needed.
|
Methods
Name | Description | |
---|---|---|
BuildHTMLComponentException |
Returns an component exception in HTML format.
(Inherited from ActiveScriptingBase.) | |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GenerateLinkTargetAttribute |
Returns the attribute string to be written to the link.
(Inherited from ActiveScriptingBase.) | |
GetColumnDefinition |
Returns the column definition for a specific position
| |
GetColumnHeaderText |
Returns the title of a specific column header
| |
GetCorrectField |
Extracts the correct value from a passed in EPT field name and a static field value.
(Inherited from ActiveScriptingBase.) | |
GetDataRow |
Gets a new DataRow object with data.
| |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
Invoke |
Invokes the component and writes its content into the specified stream
| |
MemberwiseClone | (Inherited from Object.) | |
ReadFromApplicationCache |
Returns data that is read from the application cache.
(Inherited from ActiveScriptingBase.) | |
RenderCell(TextWriter, String) |
Render a table cell element (<td>).
| |
RenderCell(TextWriter, String, ListChildrenDataRow, Boolean) |
Render a table cell element (<td>).
| |
RenderHeader |
Renders the table header.
| |
RenderLink |
Renders a link element (<a>) based on the properties of the class and the data passed in.
| |
RenderRowEnd |
Renders the table row end element (</tr>)
| |
RenderRowStart |
Renders the table row start element (<tr>)
| |
RenderTableAsColumnStyle |
Renders the table, oriented using columns.
| |
RenderTableAsRowStyle |
Renders the table, oriented using rows.
| |
RenderTableEnd |
Writes the closing tbody and table elements to the supplied writer.
| |
RenderTableStart |
Writes the table start element with its attributes including the caption element and a tbody to the supplied writer.
| |
SetApplicationCache |
Stores a string in the application cache.
(Inherited from ActiveScriptingBase.) | |
SetColumnDefinition(Int32, ListChildrenColumnDefinition) |
Sets a column definition at a specific column position.
| |
SetColumnDefinition(Int32, String) |
Sets a column definition at a specific column position.
| |
SetColumnHeaderText |
Sets the value of one of the column headers.
| |
SyncronizeMLC |
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.) | |
ToString | (Inherited from Object.) | |
WriteAttribute(TextWriter, String, String) |
Writes an attribute string to the supplied stream, unless Value is
an empty string or null (Inherited from ActiveScriptingBase.) | |
WriteAttribute(TextWriter, String, String, Boolean) |
Writes an attribute string to the supplied stream.
(Inherited from ActiveScriptingBase.) |
Fields
Name | Description | |
---|---|---|
MAX_COLUMNS |
Defines the maximum number of colums that can be rendered by the ListChildren component.
|
Remarks
Examples
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))); } }
<div>
<% =ListMyChildren(25749) %>
</div>
See Also