Content Studio Web Content Management System
SystemObject
ContentStudio.DocumentCSApprovedDocumentInformation
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Top
Top
Top
When building web sites, sometimes it can be necessary to obtain meta data information about a document such as its name, content type and file extension.
In addition to this some content type such as Introduction might be useful. This data is easy to obtain using the CSDocumentInformation object but most of
the more powerful objects and calls are designed with the possibility to edit the document in mind thus requiring READ permission for the caller.
CSApprovedDocumentInformation is designed to be able to return as much information as possible for a document without revealing any sensitive information to the public Internet
and has been optimized for being fast and resource effective.
All of the properties are loaded using one database call for the data and one additional call when determining the document type.
When using this class you can choose between loading and not loading content related data. For performance reasons you should not request the content related data unless you really need those properties.
The following properties are content related.
Why can't I read the actual content of the document?
The approved content, is stored in a binary blob field the database and cannot be used directly. In addition to this field, the source code of the document is stored as well, but that field is not very useful either and might contain sensitive information. The only exception is EPT-documents whose content contains the Xml in its native format. For that reason the only content that can be read with CSApprovedDocumentInformation is the content of EPT documents. In order to get the content of a regular Html document you can get it directly from the file system.
Security warning!
It is up to you as a programmer to wisely judge what information is acceptable to display on a public web page. For example: An EPT document might contain fields with classified data that are filtered out by using carefully crafted presentation templates. But, with CSApprovedDocumentInformation, you can easily bypass any business rules specified in presentation templates thus causing unwanted information leaks.
The sample shows how to load the current document and write out some of its properties. The code will only work within Content Studio.
[This is preliminary documentation and is subject to change.]
CSApprovedDocumentInformation is used when there is a need for an object oriented way of reading document information
available to a caller that only has BROWSE permission on the document.
Inheritance Hierarchy
ContentStudio.DocumentCSApprovedDocumentInformation
Namespace: ContentStudio.Document
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax
The CSApprovedDocumentInformation type exposes the following members.
Constructors
Name | Description | |
---|---|---|
CSApprovedDocumentInformation(ConnectionId, SessionId, DocumentId) |
Creates a new instance of the CSApprovedDocumentInformation class using a specific connectionId, sessionId and documentId | |
CSApprovedDocumentInformation(ConnectionId, SessionId, DocumentId, Boolean) |
Creates a new instance of the CSApprovedDocumentInformation class and loads document information using a specific connectionId, sessionId and documentId
with the possibility to specify whether or not to load content data.
|
Properties
Name | Description | |
---|---|---|
ArchiveDate |
Gets a value that indicates if and when the document will be archived.
| |
CategoryId |
Gets a value that specifies the identifier of the category of the loaded document.
| |
ConnectionID |
Gets the unique identifier of the current site.
| |
ContentType |
Gets the content type (Mime type) of a document.
| |
CreatedDate |
Gets a value that specifies when the loaded document was created.
| |
DocumentID |
Gets an identifier of the loaded document.
| |
DocumentName |
Gets the name of the loaded document.
| |
DocumentType |
Gets a value that indicates the type of document loaded
| |
EPTData |
Gets the content of an EPT document as an EPTXmlTextParser.
| |
FileExtension |
Gets the file extension of the file representation of the loaded document.
| |
FileName |
Gets the complete file name of the underlying file representation of the loaded document.
| |
ImageAvailability |
Gets a value that indicates what types of image processed image versions of the document that is available.
| |
Introduction |
Gets a value that contains the introduction of the loaded document's content data.
| |
MenuData |
Gets a value that specifies a user defined data for menu items. Only applicable if the document acts as a menu node.
| |
MenuTarget |
Gets a value that specifies the user defined target for menu items. Only applicable if the document acts as a menu node.
| |
MenuUrl |
Gets a value that specifies a user defined url data for menu items. Only applicable if the document acts as a menu node.
| |
ModifiedDate |
Gets a value that indicates when the document was modified.
| |
ParentDocumentId |
Gets a value that indicates the document that acts as the parent document of the loaded document.
| |
PublishDate |
Gets a value that specifies when the document was, or will be, published.
| |
PublishStatus |
Gets a value that indicates the current publish status of the loaded document.
| |
Revision |
Gets a value that indicates the revision number of the currently approved version of the document.
| |
RevisionDate |
Gets a value that specifies the date when the currently approved version of the document was approved.
| |
SessionID |
Gets the Session identifier of the calling user.
| |
VirtualPath |
Gets a value that specifies the virtual path of the loaded document.
|
Methods
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
MemberwiseClone | (Inherited from Object.) | |
OpenDocument |
Loads the document data into this instance
| |
ToString | (Inherited from Object.) |
Remarks
When using this class you can choose between loading and not loading content related data. For performance reasons you should not request the content related data unless you really need those properties.
The following properties are content related.
Property | Value when not initialized |
---|---|
Introduction | null (Nothing in Visual Basic) |
MenuUrl | null (Nothing in Visual Basic) |
MenuData | null (Nothing in Visual Basic) |
MenuTarget | null (Nothing in Visual Basic) |
RevisionDate | null (Nothing in Visual Basic) |
Revision | zero |
Why can't I read the actual content of the document?
The approved content, is stored in a binary blob field the database and cannot be used directly. In addition to this field, the source code of the document is stored as well, but that field is not very useful either and might contain sensitive information. The only exception is EPT-documents whose content contains the Xml in its native format. For that reason the only content that can be read with CSApprovedDocumentInformation is the content of EPT documents. In order to get the content of a regular Html document you can get it directly from the file system.
Security warning!
It is up to you as a programmer to wisely judge what information is acceptable to display on a public web page. For example: An EPT document might contain fields with classified data that are filtered out by using carefully crafted presentation templates. But, with CSApprovedDocumentInformation, you can easily bypass any business rules specified in presentation templates thus causing unwanted information leaks.
Examples
Response.Write("<h4>A number of properties of this document</h4><br />\r\n"); try { CSApprovedDocumentInformation adi = new CSApprovedDocumentInformation(CS_ConnectionId, CS_UserSessionId, CS_InsertedDocumentId, false); Response.Write("<table>\r\n"); Response.Write(" <tr>\r\n"); Response.Write(" <td>Document name</td>\r\n"); Response.Write(" <td>" + Server.HtmlEncode(adi.DocumentName) + "</td>\r\n"); Response.Write(" </tr>\r\n"); Response.Write(" <tr>\r\n"); Response.Write(" <td>File extension</td>\r\n"); Response.Write(" <td>" + adi.FileExtension + "</td>\r\n"); Response.Write(" </tr>\r\n"); Response.Write("</table>\r\n"); } catch(CSPermissionDeniedException) { Response.Write("<b>Sorry no permission to read!</b><br />\r\n"); } catch (Exception ex) { Response.Write("<b>Error: </b>" + ex.GetType().ToString() + "<br />" + ex.Message + "<br />\r\n"); }
See Also