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
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
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
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
Properties
Applications
This collection contains all open applications within the session.
public Collection<BudaApplication> Applications { get; }
Property Value
Connected
This property indicates if the user is successfully logged on.
public bool Connected { get; }
Property Value
ContextContainer
Returns the ContextContainer for this session. Used internally in Polar Studio.
public ContextContainer ContextContainer { get; }
Property Value
CookiesEnabled
This property is set to True when cookies are received from the browser.
public bool CookiesEnabled { get; set; }
Property Value
DataExchangeRunning
This property is set to True during the import of a DataExchange.
public bool DataExchangeRunning { get; }
Property Value
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
DateFormatString
Returns the date format as a formatting string.
public string DateFormatString { get; }
Property Value
DateSeparator
This property gets/sets the separator character for dates. Use one of: 0:/, 1:-, 2:.
public DateSeparator DateSeparator { get; set; }
Property Value
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
DecimalCharacterString
This method returns the decimal character as string
public string DecimalCharacterString { get; }
Property Value
Engine
Returns a reference to the engine containing the session.
public BudaEngine Engine { get; }
Property Value
GUID
Returns a GUID for this session.
public string GUID { get; }
Property Value
IsWebInterfaceSession
This property is set to True if this session is tied to a WebSession.
public bool IsWebInterfaceSession { get; }
Property Value
LanguageID
This property gets/sets the language for the session.
public int LanguageID { get; set; }
Property Value
LocalTime
Returns the current local time in the timezone of this session.
public DateTime LocalTime { get; }
Property Value
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
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
OneTimePasswordValidationRequired
Returns True if validation using a one time password is required.
public bool OneTimePasswordValidationRequired { get; }
Property Value
OneTimePassword_ValidationSuccessful
This boolean indicates the one time password validation was successful.
public bool OneTimePassword_ValidationSuccessful { get; }
Property Value
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
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
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
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
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
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
ThousandsCharacterString
This method returns the thousands character as string
public string ThousandsCharacterString { get; }
Property Value
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
TimeFormatString
Returns the time format as a formatting string.
public string TimeFormatString { get; }
Property Value
User
Returns the User as is logged on to this session.
public BudaUser User { get; }
Property Value
Variables
The Variables can be used to store custom information in the session
public Dictionary Variables { get; }
Property Value
WebSession
Returns the reference to the web-session if applicable.
public Session WebSession { get; }
Property Value
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
stringThe global or system message to retrieve.
pContext
objectThe context to use for scripts. If this parameter is not specified, no scripts will be executed.
pDefaultValue
stringThe value to return if the message was not found. Only applicable if one specific message is being retrieved, like '^MyMessage'
Returns
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
boolA 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
intThe total hits performed by the browser during the session.
pTotalTicks
longThe total ticks (in milli seconds) that were used for this user.
pSessionDuration
DateTimeThe total duration for the session.
pAverageConcurrentUsers
doubleA 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
stringThe User ID (like the email address) for the user.
pPassword
stringThe password supplied by the user.
pResponse
stringA response to a token. Leave empty.
pLanguageID
intThe LanguageID preferred for this user.
pRemoteIPaddress
stringThe remote IP address formatted as string.
pBrowserIdentification
stringThe browser identification string as was supplied by the browser.
pWebSession
SessionThe web-session for this user.
pAutomaticLogon
boolPass 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
stringThe 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
stringThe message to send to the user.
pMessageIsHtmlFormatted
boolA 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
stringAn optional caption for the caption of the popup dialog
pIconURL
stringThe URL to use for the icon that is shown in the popup.
pOnOkScript
stringThe 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
stringThe 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
stringThe caption of the OK button if it should be differen than OK. Specify as '---' (3x minus) to completely hide the OK button.
pCancelButtonCaption
stringThe caption of the Cancel button if it should be differen than Cancel.
pStyle
stringA css-class that is applied to the elements in the Popup and that can be used to style popups using your custom CSS.
pReverseButtons
objectA boolean parameter to indicate that the OK and Cancel buttons must trade places (thus Cancel / OK)
pOnCloseScript
stringThe 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
ContextThe 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
stringpActionParameter
stringpErrorMessage
stringpResponseObject
Dictionary