Table of Contents

Class BudaSession

Namespace
PolarStudio
Assembly
PolarStudio.dll

This class represents a session in the data-layer of a user. This session is used to log on to, to open applications, etc.

public class BudaSession : IDisposable
Inheritance
BudaSession
Implements
Inherited Members
Extension Methods

Fields

OneTimePasswordApplicationName

This property gets/sets the name for the application to show in an authenticator app.

public string OneTimePasswordApplicationName

Field Value

string

OneTimePasswordKeyType

The type of key for the one time password. It is one of: Unset (0), Remote (1), Local (2)

public AuthenticationResult.OneTimePassword_KeyType OneTimePasswordKeyType

Field Value

AuthenticationResult.OneTimePassword_KeyType

OneTimePasswordStatus

This property gets/sets the status of the one time password. It is one of: Disabled (0), Enabled (1), Required (2)

public AuthenticationResult.OneTimePassword_Status OneTimePasswordStatus

Field Value

AuthenticationResult.OneTimePassword_Status

TimeZone

This property gets/sets the TimeZone for this session. It is normally automatically determined when a user logs on (based on the browser).

public PolarTimeZone TimeZone

Field Value

PolarTimeZone

Properties

Applications

This collection contains all open applications within the session.

public Collection<BudaApplication> Applications { get; }

Property Value

Collection<BudaApplication>

Connected

This property indicates if the user is successfully logged on.

public bool Connected { get; }

Property Value

bool

ContextContainer

Returns the ContextContainer for this session. Used internally in Polar Studio.

public ContextContainer ContextContainer { get; }

Property Value

ContextContainer

CookiesEnabled

This property is set to True when cookies are received from the browser.

public bool CookiesEnabled { get; set; }

Property Value

bool

DataExchangeRunning

This property is set to True during the import of a DataExchange.

public bool DataExchangeRunning { get; }

Property Value

bool

DateFormat

This property gets/sets the date format (the order of the elements) as int. Use one of: 0:DD/MM/YYYY, 1:MM/DD/YYYY, 2:YYYY/MM/DD

public DateFormat DateFormat { get; set; }

Property Value

DateFormat

DateFormatString

Returns the date format as a formatting string.

public string DateFormatString { get; }

Property Value

string

DateSeparator

This property gets/sets the separator character for dates. Use one of: 0:/, 1:-, 2:.

public DateSeparator DateSeparator { get; set; }

Property Value

DateSeparator

DecimalCharacter

This property gets/sets the decimal character as an int. Use one of: 0:comma (,), 1:dot (.)

public DecimalCharacter DecimalCharacter { get; set; }

Property Value

DecimalCharacter

DecimalCharacterString

This method returns the decimal character as string

public string DecimalCharacterString { get; }

Property Value

string

Engine

Returns a reference to the engine containing the session.

public BudaEngine Engine { get; }

Property Value

BudaEngine

GUID

Returns a GUID for this session.

public string GUID { get; }

Property Value

string

IsWebInterfaceSession

This property is set to True if this session is tied to a WebSession.

public bool IsWebInterfaceSession { get; }

Property Value

bool

LanguageID

This property gets/sets the language for the session.

public int LanguageID { get; set; }

Property Value

int

LocalTime

Returns the current local time in the timezone of this session.

public DateTime LocalTime { get; }

Property Value

DateTime

MessagesProfile

This property gets/sets the messages profile. A messages profile can be used to create a sub-set of messages. For example for a mobile browser, this profile can be set to 'mobile'. For all messages that are then retrieved, first a version is looked up in which the name ends on '.mobile'. If that message is not found, the name without '.mobile' is used.

public string MessagesProfile { get; set; }

Property Value

string

OneTimePasswordKey

This property gets/sets the key for the one time password. Exceptions will be thrown if a key is set when the type is set to 'Remote', when a key is cleared while it is required or when a key is set while a one time password is disabled.

public string OneTimePasswordKey { get; set; }

Property Value

string

OneTimePasswordValidationRequired

Returns True if validation using a one time password is required.

public bool OneTimePasswordValidationRequired { get; }

Property Value

bool

OneTimePassword_ValidationSuccessful

This boolean indicates the one time password validation was successful.

public bool OneTimePassword_ValidationSuccessful { get; }

Property Value

bool

PasswordComplexityCharCountAlpha

With this property, the default minimum alpha character count can be overruled for this specific session. See also BudaEngine.PasswordComplexityCharCountAlpha

public object PasswordComplexityCharCountAlpha { get; set; }

Property Value

object

PasswordComplexityCharCountAlphaUpper

With this property, the default minimum upper case alpha character count can be overruled for this specific session. See also BudaEngine.PasswordComplexityCharCountAlphaUpper

public object PasswordComplexityCharCountAlphaUpper { get; set; }

Property Value

object

PasswordComplexityCharCountNumeric

With this property, the default minimum numeric character count can be overruled for this specific session. See also BudaEngine.PasswordComplexityCharCountNumeric

public object PasswordComplexityCharCountNumeric { get; set; }

Property Value

object

PasswordComplexityCharCountSpecial

With this property, the default minimum special character count can be overruled for this specific session. See also BudaEngine.PasswordComplexityCharCountSpecial

public object PasswordComplexityCharCountSpecial { get; set; }

Property Value

object

PasswordComplexityMinPasswordLength

With this property, the default minimum password length can be overruled for this specific session. See also BudaEngine.PasswordComplexityMinPasswordLength

public object PasswordComplexityMinPasswordLength { get; set; }

Property Value

object

ThousandsCharacter

This property gets/sets the thousands character as an int. Use one of: 0:comma (,), 1:dot (.), 2:apostrophe ('), 3:space. Please note that the thousands character cannot be equal to the decimal character. In that case it will be automatically set to the 'opposite' of the decimal character.

public ThousandsCharacter ThousandsCharacter { get; set; }

Property Value

ThousandsCharacter

ThousandsCharacterString

This method returns the thousands character as string

public string ThousandsCharacterString { get; }

Property Value

string

TimeFormat

This property gets/sets the time format (the order of the elements) as int. Use one of: 0 (24-hours notation, seconds), 1 (24-hours notation, no seconds), 2 (AM/PM notation, seconds), 3 (AM/PM notation, no seconds)

public TimeFormat TimeFormat { get; set; }

Property Value

TimeFormat

TimeFormatString

Returns the time format as a formatting string.

public string TimeFormatString { get; }

Property Value

string

User

Returns the User as is logged on to this session.

public BudaUser User { get; }

Property Value

BudaUser

Variables

The Variables can be used to store custom information in the session

public Dictionary Variables { get; }

Property Value

Dictionary

WebSession

Returns the reference to the web-session if applicable.

public Session WebSession { get; }

Property Value

Session

Methods

Destruct()

This method is to be used to destruct the session and to free resources.

public void Destruct()

Dispose()

The destructor

public void Dispose()

~BudaSession()

Destructor.

protected ~BudaSession()

GetMessage(string, object, string)

This method returns a global or system message from the repository for this session.

public string GetMessage(string pMessage, object pContext = null, string pDefaultValue = null)

Parameters

pMessage string

The global or system message to retrieve.

pContext object

The context to use for scripts. If this parameter is not specified, no scripts will be executed.

pDefaultValue string

The value to return if the message was not found. Only applicable if one specific message is being retrieved, like '^MyMessage'

Returns

string

LogOff(bool, int, long, DateTime, double)

This method is to formally log off a user. It is for example called when a users presses the log off button in the browser.

public void LogOff(bool pUserDidActiveLogOff = false, int pTotalHits = 0, long pTotalTicks = 0, DateTime pSessionDuration = default, double pAverageConcurrentUsers = 0)

Parameters

pUserDidActiveLogOff bool

A boolean indicating the user did actively log off (by pressing the log off button) or implictly (for a browser was closed or session did expire).

pTotalHits int

The total hits performed by the browser during the session.

pTotalTicks long

The total ticks (in milli seconds) that were used for this user.

pSessionDuration DateTime

The total duration for the session.

pAverageConcurrentUsers double

A number indicating the average number of concurrent users during the hits for the session.

LogOn(string, string, string, int, string, string, Session, bool)

This method is used to log on a user with a given userID and password.

public bool LogOn(string pUserID, string pPassword, string pResponse = "", int pLanguageID = -1, string pRemoteIPaddress = "", string pBrowserIdentification = "", Session pWebSession = null, bool pAutomaticLogon = false)

Parameters

pUserID string

The User ID (like the email address) for the user.

pPassword string

The password supplied by the user.

pResponse string

A response to a token. Leave empty.

pLanguageID int

The LanguageID preferred for this user.

pRemoteIPaddress string

The remote IP address formatted as string.

pBrowserIdentification string

The browser identification string as was supplied by the browser.

pWebSession Session

The web-session for this user.

pAutomaticLogon bool

Pass as True to allow automatic log on. In that case, the pUserID and pPassword are ignored.

Returns

bool

A boolean indicating logging on was successful.

Exceptions

PolarException

An error may be raised, for example when the current session is already logged on. In case of a failed log in (for example due to a wrong password), no error will be raised.

OpenApplication(string)

This method opens an application for the user for the given application PID. If the application was already open, that previously opened application is returned.

public BudaApplication OpenApplication(string pApplicationPID)

Parameters

pApplicationPID string

The PID for the application to open for this user.

Returns

BudaApplication

A BudaApplication

Exceptions

PolarException

When the session is not connected or an invalid PID is given, an exception is thrown.

SendMessage(string, bool, string, string, string, string, string, string, string, object, string, Context)

This method sends a message to a user that is shown in a popup in the browser.

public void SendMessage(string pMessage, bool pMessageIsHtmlFormatted = false, string pCaption = "", string pIconURL = "", string pOnOkScript = "", string pOnCancelScript = "", string pOkButtonCaption = "", string pCancelButtonCaption = "", string pStyle = "", object pReverseButtons = null, string pOnCloseScript = "", Context pContext = null)

Parameters

pMessage string

The message to send to the user.

pMessageIsHtmlFormatted bool

A boolean parameter indicating the passed message contains HTML. Only pass as true if your own code makes sure al variable data is converted to HTML.

pCaption string

An optional caption for the caption of the popup dialog

pIconURL string

The URL to use for the icon that is shown in the popup.

pOnOkScript string

The script-expression to execute server side when the users clicks the OK button. The expression can be preceeded by an exclamation-mark to run the given script-expression 'interactively'. When an expression is given that starts with a @, this expression is fired as javascript in the browser.

pOnCancelScript string

The Cancel button will be hidden if this parameter is empty. Use only a minus character to show the cancel button but to take no action. Else, this paramater contains the script-expression to execute server side when the users clicks the OK button. The expression can be preceeded by an exclamation-mark to run the given script-expression 'interactively'. When an expression is given that starts with a @, this expression is fired as javascript in the browser.

pOkButtonCaption string

The caption of the OK button if it should be differen than OK. Specify as '---' (3x minus) to completely hide the OK button.

pCancelButtonCaption string

The caption of the Cancel button if it should be differen than Cancel.

pStyle string

A css-class that is applied to the elements in the Popup and that can be used to style popups using your custom CSS.

pReverseButtons object

A boolean parameter to indicate that the OK and Cancel buttons must trade places (thus Cancel / OK)

pOnCloseScript string

The Close-cross button in the top-right corner of the dialog will be hidden if this parameter is empty. Use only a minus character to show the close button but to take no action. Else, this paramater contains the script-expression to execute server side when the users clicks the OK button. The expression can be preceeded by an exclamation-mark to run the given script-expression 'interactively'. When an expression is given that starts with a @, this expression is fired as javascript in the browser.

pContext Context

The context to use for the action-scripts. In particular in a multiple document environment this can be important.

WebServiceResponseReceived(string, string, string, Dictionary)

This method is used internally in Polar Studio.

public void WebServiceResponseReceived(string pAction, string pActionParameter, string pErrorMessage, Dictionary pResponseObject)

Parameters

pAction string
pActionParameter string
pErrorMessage string
pResponseObject Dictionary