[This is preliminary documentation and is subject to change.]
Namespace: ContentStudio.Document
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
public string GetProperties( ConnectionId connectionId, SessionId sessionId, DocumentId documentId, 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). - documentId
- Type: ContentStudio.DocumentDocumentId
The document to read properties for - properties
- Type: SystemString
An array of names of the properties to be read.
Starting with Content Studio 5.2 these names are no longer case-sensitive.
Return Value
Type: StringXML with the returned properties as attributes.
<root> <status>0</status> <statustext>Success</statustext> <document 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.
Exception | Condition |
---|---|
CSException | A business rule was violated in the underlying Content Studio database |
CSPermissionDeniedException | The caller has no permission to perform the requested action |
CSInvalidSessionException | The session is invalid |
CSInvalidParameterException | A parameter has an invalid value |
CSDocumentNotFoundException | The document could not be found |
SqlException | An error occurred when executing the command against the Content Studio database |
ArgumentNullException | properties parameter is null - or - one of the property names is null |
ArgumentOutOfRangeException | The properties parameter is an empty array |
Starting with Content Studio 5.2 you can get the value of any columns in the [dbo].[tbl_elements] table in a Content Studio database.
Note |
---|
Internally, the properties are fetched by the use of a dynamically, paramentarized 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 may 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 CSDocumentInformation class instead which provides an object oriented way of reading document properties. However, for a very limited number of properties this method can be very efficient. |
Caution | ||||||||
---|---|---|---|---|---|---|---|---|
A few columns in the [dbo].[tbl_elements] table have property names that differ
from the underlying column names.
|
Property name | Meaning | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DocumentID | The identifier of the document | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ParentDocumentID | The identifier of the document that acts as the parent document. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
UserID | Identifies the id of the user that created the document. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CategoryID | Identifies the category of the document | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FileName | The full pathname of the document | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DocumentName | The document's name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CreatedDate | The document's creation date | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PublishDate | The document's publish date | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ArchiveDate | The document's archive date | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Marking | A short list of words that can be used to classify the document | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Revision | The version number of the approved version of the document. Zero indicates that the document has never been approved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ContentType | The content type string. e.g. 'text/html' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ModuleName |
This property is retrieved from the document's category
and determines (together with the StatusInt property the type of document.
The following module names are available:
Use GetDocumentType method to determine the type of document. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
StatusInt / InheritedStatusInt | The InheritedStatusInt virtual property is new in CS 5.4 A bitmasked value that indicates the status of the document. When requesting the property InheritedStatusInt, these flags are combination of values from the document, its category and the category module. These flags can be combination of the following hexadecimal values and meaning:
Note When requesting the property StatusInt and in Content Studio version earlier than 5.3 only the status directly applied to the document is returned. These status values are:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Filesize | The size of the document on disk. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BodyProperties | A string containing attibute data that appears in the BODY section of the document | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DeletedByID | The id of the user that threw the document in the recycling bin. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SentForApprovalByID | The id of the user that has sent the document for versioning | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ModifiedDate | The document's last modified date | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RejectedByID | The id of the user that rejected the document. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RejectedDate | Indicates when the document was rejected | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DeletedDate | Indicates when the document was thrown into the recycling bin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SentForApprovalDate | Indicates when the document was sent for approval | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ChkOutByID | The id of the user that currently has the document checked out | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AppCID | A GUID that identifies the currently approved content of the document. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ETForPTID | If the document is a presentation template, this property is the identifier of the edit template in use | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Encoding | The endoding of the document | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WFStatusText | The workflow status text | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ImagesAvailable | For image files only. This boolean parameter indicates if adjusted images has been created | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TreeID | Indicates the top root document in a document hierarchy. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ElementLevel | Indicates the order of the document within a document hierarchy. This value can be zero to let Content Studio decide the order. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
UsePublishDate | (0 or 1) Indicates whether this document uses the publish date functionality. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PublishStatus | An integer value that specifies the publish status value for this document.
This property is new in CS 5.1 Possible values and meaning:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
LastPublishState |
Gets a value that indicates the calculated publish status of a document.
This property can have one of the following values:
This property was introduced in Content Studio version 5.2. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
VirtualPath |
A site-unique path to the document. e.g. the document http://www.company.com/default.aspx?id=12345
could be identified as http://www.company.com/news. In this example the VirtualPath
will be news.
This property was introduced in Content Studio version 5.2. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SubStat |
A document's subscription status. Can be one of the following values and meaning
This property was introduced in Content Studio version 5.2. |
int DocumentID = 4500; DocumentReader DocReader = new DocumentReader(); string xml = DocReader.GetProperties(CS_ConnectionId, CS_UserSessionId, DocumentID, new string[3] {"DocumentName", "ParentDocumentID", "CreatedDate" }); //The following Xml is returned //<root> // <status>0</status> // <statustext>Success</statustext> // <document DocumentName="Content Studio AS Xml Converter" // ParentDocumentID="3644" // CreatedDate="2007-01-08T15:59:39.070" /> //</root> int ParentID = 0; string Name = ""; DateTime Created = DateTime.MinValue; //use an XmlReader to the the individual properties returned using (StringReader sr = new StringReader(xml)) { XmlReader XReader = XmlReader.Create(sr); if (XReader.ReadToFollowing("document")) { ParentID = Int32.Parse(XReader.GetAttribute("ParentDocumentID")); Name = XReader.GetAttribute("DocumentName"); Created = DateTime.Parse(XReader.GetAttribute("CreatedDate")); } } //Write out the data to the web page Response.Write(String.Format("The document {0} has a parent with id {1} and was created {2}", Name, ParentID, Created));