[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 GetDirective( ConnectionId connectionId, SessionId sessionId, int objectId, CSFileObjectTypes objectType, DirectiveControlDirectiveClass directiveType, int versionNumber, out bool isInherited, out string inheritedFrom, out CSFileObjectTypes foundAtObjectType, out int foundAtObjectId )
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). - objectId
- Type: SystemInt32
The object to get attributes for. - objectType
- Type: ContentStudio.DocumentCSFileObjectTypes
The type of Content Studio object referenced by the ObjectID parameter - directiveType
- Type: ContentStudio.DocumentDirectiveControlDirectiveClass
The type of directive to use e.g. DirectiveClass.Page - versionNumber
- Type: SystemInt32
Indicates the version number of the document. Ignored unless objectType is Document. Use the following values to determine what document version to read directive for:Value Meaning less than -2 Fails with an ArgumentOutOfRangeException. -2 Read the current draft or if not found the current approved version. -1 Read the current draft. 0 Read the approved document. greater than 0 Read the version with this specific version number. - isInherited
- Type: SystemBoolean
When this method returns, this parameter contains a value that specifies whether or not the the definition was inherited from a parent object. - inheritedFrom
- Type: SystemString
When this method returns, this parameter contains the logical pathname of the object from where the definition was inherited; for example, Root/MyUnit/MyCategory/The Document. If the directive was not inherited this parameter will be empty. - foundAtObjectType
- Type: ContentStudio.DocumentCSFileObjectTypes
When this method returns, this parameter contains a value that specifies the type of object from where the definition was inherited. - foundAtObjectId
- Type: SystemInt32
When this method returns, this parameter contains the identifier of an object from where the definition was inherited.
Return Value
Type: StringXml, a simple one tag document with the attributes in use and their values. The content of the xml is dependent on what type of directive to get and what types of directives that does not have default values.
<directives> <Page Language="VB" Strict="true" /> </directives>
<directives> <OutputCache Duration="100" VaryByParam="di" Location="Server" /> </directives>
The element names returned are the directive name and the attributes defines the attributes of the directive. The following directives can be returned.
Directive | Description | Read more |
---|---|---|
Assembly | Links an assembly to the current page or user control declaratively | http://msdn.microsoft.com/en-us/library/d864zc1k.aspx |
Control | Defines control-specific attributes used by the ASP.NET page parser and compiler and can be included only in .ascx files (user controls). | http://msdn.microsoft.com/en-us/library/d19c0t4b.aspx |
Import | Imports a namespace into a page or user control explicitly. | http://msdn.microsoft.com/en-us/library/eb44kack.aspx |
Master | Identifies a page as a master page and defines attributes used by the ASP.NET page parser and compiler and can be included only in .master files | http://msdn.microsoft.com/en-us/library/ms228176.aspx |
OutputCache | Controls the output caching policies of a page or user control declaratively | http://msdn.microsoft.com/en-us/library/hdxfb6cy.aspx |
Page | Defines page-specific attributes used by the ASP.NET page parser and compiler and can be included only in .aspx files | http://msdn.microsoft.com/en-us/library/ydy4x04a.aspx |
Reference | Links a page, user control, or COM control to the current page or user control declaratively | http://msdn.microsoft.com/en-us/library/w70c655a.aspx |
Register | Associates aliases with namespaces and classes, which allow user controls and custom server controls to be rendered when included in a requested page or user control | http://msdn.microsoft.com/en-us/library/c76dd5k1.aspx |
Exception | Condition |
---|---|
CSException | A business rule was violated in the underlying Content Studio database
|
CSInvalidSessionException | The session is invalid (version 5.4 and later) |
CSPermissionDeniedException | Permission denied (version 5.4 and later) |
CSInvalidParameterException | Invalid parameter value (version 5.4 and later) |
CSDocumentNotFoundException | The document is missing (version 5.4 and later) |
ArgumentOutOfRangeException | The versionNumber is invalid |
SqlException | An error occurred when executing the command against the Content Studio database |
This method was added in CS 5.4 to support the extended versioning.
This method will return same result as GetDirective unless the objectType is Document.
If the requested version number cannot be found in the revision store the method will return the draft directives or, when not found, directives for the approved version.