CategoryReaderGetProperties Method Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Returns selected properties of a Content Studio category.

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

public string GetProperties(
	ConnectionId connectionId,
	SessionId sessionId,
	CategoryId categoryId,
	string[] properties
)

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).
categoryId
Type: ContentStudio.DocumentCategoryId
The category to read properties for
properties
Type: SystemString
An array of names of the properties to be read. These names are not case-sensitive.

Return Value

Type: String
XML with the returned properties as attributes.
<root>
  <status>0</status>
  <statustext>Success</statustext>
  <category PROPERTY="VALUE" />
</root>

The PROPERTY is the name of the property to read and the VALUE is the found value. You will find one attribute for each property you requested. The casing of these attribute names are identical to the casing of the passed in names and the attributes will be ordered in the same order as the order in the passed in list.

Exceptions

ExceptionCondition
CSExceptionA business rule was violated in the underlying Content Studio database
CSPermissionDeniedExceptionThe caller has no permission to perform the requested action
CSInvalidSessionExceptionThe session is invalid
CSInvalidParameterExceptionA parameter has an invalid value
CSDocumentNotFoundExceptionThe category could not be found
SqlExceptionAn error occurred when executing the command against the Content Studio database
ArgumentNullExceptionproperties parameter is null - or - one of the property names is null
ArgumentOutOfRangeExceptionThe properties parameter is an empty array
Content Studio permissions

READ permission on the category is required.
Remarks

This method was introduced in Content Studio version 5.2

Note Note
Internally, the properties are fetched by the use of a dynamically, parameterized sql query where all passed in property names are checked individually against the database. For this reason asking for a large number of properties can be time consuming and will result in many small database calls. For this reason you should try to limit the number of properties as much as possible. If you need to read a lot of properties consider using the GetItem(ConnectionId, SessionId, CategoryId) method instead. However, for a very limited number of properties this method can be very efficient.

The following property names are available:

Property names and their values
NameDescription
CategoryIDInteger:
The numeric internal identifier of the category
ModuleNameString:
Indicates the type of document can be stored in the category
For more information about this property, see the ModuleName property.
CategoryNameString:
the name of the category
BodyProperties String:
value that indicates the attribute content of the document's BODY tag.
This value is applied to every document in the category unless there is a definition of BodyProperties for the document itself.
This property is meaningful for categories with meta data only.
StatusIntInteger:
A bit-masked value that indicates the status of the category.
These flags can be a limited combination of the following hexadecimal values and meaning:
ValueDescription
0x00000004Containing documents have revision history
0x00000010Containing documents are Html template type
0x00000040The category and its containing documents are protected by the system
0x00001000Containing documents are plain text documents
0x00002000Containing documents do not have meta data
0x00008000Containing documents are binary, uploaded file
0x00040000Containing documents are edit templates
0x00080000Containing documents are presentation templates
StatusTextString:
The textual representation of the statusInt property.
UnitIDInteger:
The numerical identifier of the unit that stores this category
EditTemplateIDInteger:
An identifier to the documents that acts as EditTemplate of the category. For EPT documents categories only.
StartIDInteger:
Identifies the document that acts as default start document of the category.
OwnerIDInteger:
The identifier of a registered user that created the document.
DefaultCacheDurationInteger:
Not used in Content Studio 5
DefaultFormIDInteger:
A identifier to the document that acts as the template for documents in this category.
ISPresentationTemplateBoolean:
Indicates that the category only can contain presentation templates.
ISEditTemplateBoolean:
Indicates that the category only can contain editing templates.
EncodingString:
The encoding used for documents in this category.
ParentCategoryIDInteger:
An identifier that defines the parent category of this category. For root categories this value points to the category itself.
ImageProcessLevelInteger:
Used internally by the image processing module.
ImageProcessDataString:
Used internally by the image processing module.
LanguageClassInteger:
Indicates that the category's MLC type.
  • 0 - The category is not an MLC member.
  • 1 - The category is an MLC master.
  • 2 - The category is an MLC member.
MLCLanguageIDInteger:
Indicates the MLC language of this category.
MLCLanguageShortName String:
Indicates the MLC language of this category. This value is empty for non MLC members.
MLCLanguageName String:
Indicates short form of the MLC language of this category. This value is empty for non MLC members.
DocumentQuotaInteger:
Defines the maximal number of documents that can be created in the category. The default value is zero (0) which indicates that no limit exists.
Currently (version 5.2), Content Studio API has no write support for this column, however Content Studio honors this property if specified.
DescriptionString:
A brief description of this category.
DocumentCounterInteger:
A value that increments with one for every new document created in the category
UsePublishDateBoolean:
A value that indicates whether to use publish date information when listing documents.
GUOIDString:
An internal global unique object identifier of the category
DocTypeIDInteger:
For internal use only
ServerSideValidationBoolean:
True (1) to use server side validation in EPT. For EPT document categories only.
HiddenBoolean:
Not used
UseMetaSecurityBoolean:
True (1) to indicate that EPT meta data security is enabled for this category
CustomViewURLString:
A URL that defines the source code for a alternate view in the GUI of this category.
AllowedFileTypesString:
A comma-separated list of file extensions that are allowed with this.
MaxContentSizeInteger:
defines the maximum content size of any document in the category. Zero (0) is no limit.
Currently (version 5.2), Content Studio API has no write support for this column, however Content Studio honors this property if specified.
DocumentFileNamingConvention Integer:
A value that defines how Content Studio specifies file names for documents in this category.
For more information on this value see the FolderBaseDocumentFileNamingConvention enumeration.
FilePath String:
The path of this category. The path is relative to the root. e.g. System/AS_Date

Note Note
If you need to determine the type of documents that can be stored in the category you must analyze a combination of both the ModuleName and StatusInt properties. However, you should use the GetDocumentType(ConnectionId, SessionId, CategoryId) method instead which is much easier and safer to use.

Examples

The following code snippet shows how to get some document properties for the category with id=4500

CategoryId catId = 4500;
CategoryReader catReader = new DocumentReader();
string xml = catReader.GetProperties(CS_ConnectionId, 
                                     CS_UserSessionId, 
                                     catId, 
                                     new string[2] {"CategoryName",
                                                    "ParentCategoryID"});
//The following Xml is returned
//<root>
// <status>0</status>
// <statustext>Success</statustext>
// <category CategoryName="The category" 
//           ParentCategoryID="3644" />
//</root>
int ParentID = 0;
string Name = String.Empty;
//use an XmlReader to the the individual properties returned
using (StringReader sr = new StringReader(xml))
{
  XmlReader XReader = XmlReader.Create(sr);
  if (XReader.ReadToFollowing("category"))
  {
     ParentID = Int32.Parse(XReader.GetAttribute("ParentCategoryID"));
     Name = XReader.GetAttribute("CategoryName");
  }
}
//Write out the data to the web page
Response.Write(String.Format("The category {0} has a parent with id {1}.", Name, ParentID));
See Also

Reference