C# Class erminas.SmartAPI.CMS.Session

Session, representing a connection to a Open Text WSM Management Server / RedDot CMS server as a specified user. To open a session you need to use the SessionBuilder.
Inheritance: ISession
Exibir arquivo Open project: erminas/smartapi

Private Properties

Property Type Description
CheckAlreadyLoggedIn string
CheckLoginResponse void
ExtractMessagesWithInnerExceptions string
GetDialogLocales List
GetForceLoginXmlNode System.Xml.XmlElement
GetLocales List
GetLoginResponse System.Xml.XmlDocument
GetServerVersion System.Version
GetUserSessionInfoElement System.Xml.XmlElement
InitConnection void
IsProjectUnavailbaleException bool
LoadSelectedProject void
Login void
LoginToServerManager void
Logout void
ParseLoginResponse void
ParseRQLResult System.Xml.XmlDocument
SendEmail void
SendRQLToServer string
Session System
TryGetSessionInfo bool

Public Methods

Method Description
Dispose ( ) : void

Close session on the server and disconnect

ExecuteRQL ( string query ) : XmlDocument
ExecuteRQL ( string query, RQL format ) : XmlDocument
ExecuteRQLInProjectContext ( string query, System.Guid projectGuid ) : XmlDocument
ExecuteRQLInProjectContextAndEmbeddedInProjectElement ( string query, System.Guid projectGuid ) : XmlDocument
ExecuteRQLRaw ( string query, RQL ioDataFormat ) : string
GetTextContent ( System.Guid projectGuid, ILanguageVariant lang, System.Guid elementGuid, string typeString ) : string

Get the text content of a text element. This method exists, because it needs a different RQL element layout than all other queries.

SelectProject ( System.Guid projectGuid ) : void

Select a project. Subsequent queries will be executed in the context of this project.

SelectProject ( IProject project ) : void

Select a project as active project (RQL queries will be evaluated in the context of this project).

SendMailFromCurrentUserAccount ( EMail mail ) : void
SendMailFromSystemAccount ( EMail mail ) : void
Session ( ServerLogin login, Func sessionReplacementSelector ) : System
Session ( ServerLogin login, System.Guid loginGuid, string sessionKey, System.Guid projectGuid ) : System

Create an session object for an already existing session on the server, e.g. when opening a plugin from within a running session.

SetTextContent ( System.Guid projectGuid, ILanguageVariant languageVariant, System.Guid textElementGuid, string typeString, string content ) : System.Guid

Set the text content of a text element. This method exists, because it needs a different RQL element layout than all other queries.

WaitForAsyncProcess ( System.TimeSpan maxWait, Predicate processPredicate ) : void

Waits for an asynchronous process to finish. This is done by waiting for the process to spawn (or have it available on start) and then waiting for the process to disappear from the process list. The async processes get checked every second, for other retry periods, use instead.

WaitForAsyncProcess ( System.TimeSpan maxWait, System.TimeSpan retry, Predicate processPredicate ) : void

Waits for an asynchronous process to finish. This is done by waiting for the process to spawn (or have it available on start) and then waiting for the process to disappear from the process list.

Private Methods

Method Description
CheckAlreadyLoggedIn ( XmlElement xmlElement ) : string
CheckLoginResponse ( XmlDocument xmlDoc, Func sesssionReplacementSelector ) : void
ExtractMessagesWithInnerExceptions ( Exception e ) : string
GetDialogLocales ( ) : List
GetForceLoginXmlNode ( PasswordAuthentication pa, System.Guid oldLoginGuid ) : XmlElement
GetLocales ( ) : List
GetLoginResponse ( ) : XmlDocument
GetServerVersion ( string baseURL ) : System.Version
GetUserSessionInfoElement ( ) : XmlElement
InitConnection ( ) : void
IsProjectUnavailbaleException ( Exception e ) : bool
LoadSelectedProject ( XmlDocument xmlDoc ) : void
Login ( Func sessionReplacementSelector ) : void
LoginToServerManager ( ) : void
Logout ( System.Guid logonGuid ) : void
ParseLoginResponse ( XmlNodeList xmlNodes, PasswordAuthentication authData, XmlDocument xmlDoc, Func sessionReplacementSelector ) : void
ParseRQLResult ( ISession session, string result ) : XmlDocument
SendEmail ( string fromAddress, EMail mail ) : void
SendRQLToServer ( string rqlQuery, string debugRQLQuery = null ) : string

Send RQL statement to CMS server and return result.

Session ( ) : System
TryGetSessionInfo ( XmlDocument xmlDoc, Func sessionReplacementSelector, RunningSessionInfo &sessionToReplace ) : bool

Method Details

Dispose() public method

Close session on the server and disconnect
public Dispose ( ) : void
return void

ExecuteRQL() public method

public ExecuteRQL ( string query ) : XmlDocument
query string
return System.Xml.XmlDocument

ExecuteRQL() public method

public ExecuteRQL ( string query, RQL format ) : XmlDocument
query string
format RQL
return System.Xml.XmlDocument

ExecuteRQLInProjectContext() public method

public ExecuteRQLInProjectContext ( string query, System.Guid projectGuid ) : XmlDocument
query string
projectGuid System.Guid
return System.Xml.XmlDocument

ExecuteRQLInProjectContextAndEmbeddedInProjectElement() public method

public ExecuteRQLInProjectContextAndEmbeddedInProjectElement ( string query, System.Guid projectGuid ) : XmlDocument
query string
projectGuid System.Guid
return System.Xml.XmlDocument

ExecuteRQLRaw() public method

public ExecuteRQLRaw ( string query, RQL ioDataFormat ) : string
query string
ioDataFormat RQL
return string

GetTextContent() public method

Get the text content of a text element. This method exists, because it needs a different RQL element layout than all other queries.
public GetTextContent ( System.Guid projectGuid, ILanguageVariant lang, System.Guid elementGuid, string typeString ) : string
projectGuid System.Guid Guid of the project containing the element
lang ILanguageVariant Language variant to get the text from
elementGuid System.Guid Guid of the text element
typeString string texttype value
return string

SelectProject() public method

Select a project. Subsequent queries will be executed in the context of this project.
public SelectProject ( System.Guid projectGuid ) : void
projectGuid System.Guid Guid of the project to select
return void

SelectProject() public method

Select a project as active project (RQL queries will be evaluated in the context of this project).
Thrown, if the project could not get selected.
public SelectProject ( IProject project ) : void
project IProject Project to select
return void

SendMailFromCurrentUserAccount() public method

public SendMailFromCurrentUserAccount ( EMail mail ) : void
mail erminas.SmartAPI.CMS.ServerManagement.EMail
return void

SendMailFromSystemAccount() public method

public SendMailFromSystemAccount ( EMail mail ) : void
mail erminas.SmartAPI.CMS.ServerManagement.EMail
return void

Session() public method

public Session ( ServerLogin login, Func sessionReplacementSelector ) : System
login erminas.SmartAPI.Utils.ServerLogin
sessionReplacementSelector Func
return System

Session() public method

Create an session object for an already existing session on the server, e.g. when opening a plugin from within a running session.
public Session ( ServerLogin login, System.Guid loginGuid, string sessionKey, System.Guid projectGuid ) : System
login erminas.SmartAPI.Utils.ServerLogin
loginGuid System.Guid
sessionKey string
projectGuid System.Guid
return System

SetTextContent() public method

Set the text content of a text element. This method exists, because it needs a different RQL element layout than all other queries.
public SetTextContent ( System.Guid projectGuid, ILanguageVariant languageVariant, System.Guid textElementGuid, string typeString, string content ) : System.Guid
projectGuid System.Guid Guid of the project containing the element
languageVariant ILanguageVariant Language variant for setting the text in
textElementGuid System.Guid Guid of the text element
typeString string texttype value
content string new value
return System.Guid

WaitForAsyncProcess() public method

Waits for an asynchronous process to finish. This is done by waiting for the process to spawn (or have it available on start) and then waiting for the process to disappear from the process list. The async processes get checked every second, for other retry periods, use instead.
public WaitForAsyncProcess ( System.TimeSpan maxWait, Predicate processPredicate ) : void
maxWait System.TimeSpan Maximum time span to wait for the process to complete
processPredicate Predicate Gets checked for every process in the list to determine the process to wait for (must return true for it and only for it)
return void

WaitForAsyncProcess() public method

Waits for an asynchronous process to finish. This is done by waiting for the process to spawn (or have it available on start) and then waiting for the process to disappear from the process list.
public WaitForAsyncProcess ( System.TimeSpan maxWait, System.TimeSpan retry, Predicate processPredicate ) : void
maxWait System.TimeSpan Maximum time span to wait for the process to complete
retry System.TimeSpan Determines how often the async processes should be checked
processPredicate Predicate Gets checked for every process in the list to determine the process to wait for (must return true for it and only for it)
return void