CategoryReaderGetCategoryList Method (ConnectionId, SessionId, Int32, FolderBaseCSFileFolderTypes, FolderReaderFolderSortOrder, Int32) Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Returns a list of categories within another container. Subcontainers below the first level are excluded.

Namespace: ContentStudio.Document
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public string GetCategoryList(
	ConnectionId connectionId,
	SessionId sessionId,
	int containerId,
	FolderBaseCSFileFolderTypes containerType,
	FolderReaderFolderSortOrder sortOrder,
	out int recordCount
)

Parameters

connectionId
Type: ContentStudioConnectionId
A value that identifies the web site
sessionId
Type: ContentStudio.SecuritySessionId
A value that identifies the user's session. This value usually originates from a call to OpenSession(ConnectionId).
containerId
Type: SystemInt32
An identifier to a container whose child categories should be listed.
containerType
Type: ContentStudio.DocumentFolderBaseCSFileFolderTypes
The type of container that hosts the members in the list. This value can be either Unit or Category. The root type cannot contain categories and is invalid.
sortOrder
Type: ContentStudio.DocumentFolderReaderFolderSortOrder
One of the FolderReaderFolderSortOrder enumeration values that specifies how the list is sorted.
recordCount
Type: SystemInt32
Returns the number of items found.

Return Value

Type: String
XML containing a list of categories.
<root>
    <status>Integer value</status>
    <statustext>String value</statustext>
    <recordcount>Integer value</recordcount>
    <parentid>Integer value</parentid>
    <module>String value</module>
    <location>String value</location>
    <customviewurl>String value</customviewurl>
    <documenttype>Integer value</documenttype>
    <documentfilenamingconvention>Integer value</documentfilenamingconvention>
    <categories>
        <category>
            <id>Integer value</id>
            <name>String value</name>
            <type>String value</type>
            <module>String value</module>
            <description>String value</description>
            <hasdirectace>Bit value</hasdirectace>
            <documenttype>String value</documenttype>
            <documentfilenamingconvention>Integer value</documentfilenamingconvention>
            <filepath>Integer value</filepath>
        </category> 
        <!-- more category element can follow -->
    </categories>
</root>

The elements have the following meaning

Xml description
ElementDescription
root/statusInteger: Indicates the outcome of the call, always 0 which indicates success
root/statustextString: The textual representation of the status, always OK
root/recordcountInteger: The number of records returned.
root/parentidInteger: The identifier of the parent of the container specified in containerId.
root/moduleString: A value that indicates the type of category. When containerId represents a unit this value is always 'Unit'. This value cannot fully be used to determine the type of a category instead use the GetDocumentType(ConnectionId, SessionId, CategoryId) method or when possible the root/documenttype element value to determine the type of document a category can contain.
root/location The relative path name to the category (or unit) referenced by containerId (e.g. MyUnit/TheCategory).

This relative path is the path in the underlying file system which means that some of the special system folders are different from the path shown in Content Studio.

These are i version 5.1: Special category mappings
IdFolderMaps to
99System/AssembliesBin
98System/App_CodeApp_Code
97System/App_Code/CSCodeApp_Code/CSCode
96System/App_Code/VBCodeApp_Code/VBCode
95System/App_ThemesApp_Themes
94System/App_GlobalResourcesApp_GlobalResources
root/customviewurlString: When containerId represents a category the custom view url for the category passed in; otherwise, Empty
root/documenttype The type of document that the category referenced by containerId can contain. When containerId represents a category the value of this element is the numeric value of a member of the DocumentTypes enumeration; otherwise, Empty
root/documentfilenamingconventionA value that indicates how Content Studio determines the name of documents created in the category referenced by the containerId parameter. When containerId represents a category the value of this element is the numeric value of a member of the FolderBaseDocumentFileNamingConvention enumeration; otherwise, Empty
root/categoriesRoot element for the list of categories
root/categories/categoryRoot element for a single found category. This element occurs once per found category.
root/categories/category/idInteger: The identifier of the category.
root/categories/category/nameString: The name of the category.
root/categories/category/typeThe type of container. This value is always 'C'
root/categories/category/moduleString: A value that indicates the type of category. This value cannot fully be used to determine the type of a category. Use the GetDocumentType(ConnectionId, SessionId, CategoryId) method or the root/categories/documenttype element value to determine the type of document a category can contain.
root/categories/category/descriptionString: A description of the category.
root/categories/category/hasdirectaceBit: A value that indicates whether the category has any direct ACE (Access control entry)
root/categories/documenttype The type of document that the category listed can contain. The value of this element is the numeric value of a member of the DocumentTypes enumeration.
root/categories/documentfilenamingconventionA value that indicates how Content Studio determines the name of documents created in the category listed. The value of this element is the numeric value of a member of the FolderBaseDocumentFileNamingConvention enumeration.
root/categories/category/filepath The relative path name to the category. See the root/location element comment for more information about this value.
Exceptions

ExceptionCondition
CSExceptionA business rule was violated in the underlying Content Studio database
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

READ permission on the category is required. CS 5.6 and later; Anonymous access supported
See Also

Reference