Class BudaApplication
- Namespace
- PolarStudio
- Assembly
- PolarStudio.dll
An instanced application opened for a specific user. Use pContext.Session.OpenApplication() to create a new BudaApplication.
public class BudaApplication : IDisposable, PolarWeakEventListener
- Inheritance
-
BudaApplication
- Implements
- Inherited Members
- Extension Methods
Fields
ReportEngineAdminGroupPIDs
In ReportEngineAdminGroupPIDs a semi-colon separated list of GroupPID's can be specified for the groups that are allowed to edit the reports, for example: pContext.Application.ReportEngineAdminGroupPIDs = "Admins;PowerUsers"
public string ReportEngineAdminGroupPIDs
Field Value
ReportEngineStorageQuery
In ReportEngineStorageQuery, an Updatable Query-text can be set that is used to retrieve the definition for the reports, as in: SELECT Value FROM Settings WHERE Name = 'ReportsDefinitionXML' Make sure this Property is set before the user opens the Reports, for example in the OnOpenApplication-event. If this property is empty, a file in the file-system will be used. Instead of a Query-text, also a FileName in the file-system can be specified. Make sure the given file name ends on '.xml'
public string ReportEngineStorageQuery
Field Value
Properties
ApplicationAccessGUID
A GUID used to pinpoint this ApplicationAccess. Used for getting/setting user-settings.
public string ApplicationAccessGUID { get; set; }
Property Value
ApplicationID
The ApplicationID used internally in the repository
public int ApplicationID { get; }
Property Value
ApplicationPID
The internally used PID. This is a string-like GUID or identifier.
public string ApplicationPID { get; }
Property Value
DataConnector
The DataConnector is the connection used for this application to communicate with the attached database.
public DataConnector DataConnector { get; }
Property Value
Engine
The Engine that holds this BudaApplication
public BudaEngine Engine { get; }
Property Value
GUID
A GUID for the current Application-instance. Is used internally for for example the Locking table.
public string GUID { get; }
Property Value
Group
The Group (user-group) the current user is part of. A user is always part of exactly one Group.
public BudaGroup Group { get; }
Property Value
MessagesProfile
Returns the messages profile for the current session
public string MessagesProfile { get; set; }
Property Value
Name
The Name of this application (SystemName) as defined in the repository
public string Name { get; }
Property Value
PrivateRecordID
To get/set the PrivateRecordID for the user. Must be a Int/Long or Null
public object PrivateRecordID { get; set; }
Property Value
Session
The Session for the current logged on user.
public BudaSession Session { get; }
Property Value
Settings
The Settings property gives access to the repository-object representing the current application.
public repApplication Settings { get; }
Property Value
SettingsForGroup
The SettingsForGroup property gives access to the repository-object representing the group-specific setting for the current application for the current user.
public repApplicationSettings SettingsForGroup { get; }
Property Value
ShowDeletedRecords
When SoftDeletes are used in the application (where deletions do not actually delete the record from the database but only flag the record as Deleted), these deleted records can be made visible by setting this property to True.
public bool ShowDeletedRecords { get; set; }
Property Value
SupportRecordLocking
A boolean to get/set the feature of RecordLocking for the current application-instance.
public bool SupportRecordLocking { get; set; }
Property Value
Tag
The Tag is available for scripted use and can be filled with any text.
public string Tag { get; set; }
Property Value
UserSettings
The UserSettings object provides a standardized way to get/set settings for this application for the current user. Settings are Name/Value pairs of String/String.
public UserSettings UserSettings { get; }
Property Value
Variables
The Variables can be used to store custom information in the BudaApplication
public Dictionary Variables { get; }
Property Value
Methods
Destruct()
To free resources, the Destruct must be called whenever the DataSet is not used anymore. In Polar Studio it is advised to use a Using-block with the OpenDataset to ensure destruction.
public void Destruct()
Dispose()
Used to dispose the Application. Is equal to Destruct.
public void Dispose()
~BudaApplication()
protected ~BudaApplication()
GetMessage(string, object, string)
To get a message from this BudaApplication
public string GetMessage(string pMessage, object pContext = null, string pDefaultValue = null)
Parameters
pMessage
stringThe message to parse, like: ^MyMessageName This is <^MyMessageName> <%Now%>
pContext
objectThe Context to use for included script-expressions. If no pContext is given, script-expressions will not be parsed.
pDefaultValue
stringIf requesting a single message (like ^MyMessage) and this message is not found, by default an error-message is returned like '***Message not found'. With specifying pDefaultValue, this error will be replaced by the given default.
Returns
HasLock(BudaDataSet, long?)
Returns a boolean indicating the specified RecordID in the given pDataSet has a lock
public bool HasLock(BudaDataSet pDataSet, long? pRecordID = null)
Parameters
pDataSet
BudaDataSetThe DataSet to search for
pRecordID
long?The RecordID. If not specified, the current RecordID will be chekced.
Returns
LockRecord(BudaDataSet, long?)
When using RecordLocking, LockRecord and UnlockRecord can be used to specifically Lock and Unlock a record. Is normally called internally.
public string LockRecord(BudaDataSet pDataSet, long? pRecordID = null)
Parameters
pDataSet
BudaDataSetThe DataSet for which to lock the record
pRecordID
long?The optional RecordID to lock if it is not the current record that has to be locked.
Returns
OpenDataSet(object, BudaDataSet, string, bool, object, string, string, string, bool, string, object, string, bool, Form)
To open a dataset use this OpenDataSet method.
public BudaDataSet OpenDataSet(object pTableID, BudaDataSet pParentDataSet = null, string pFollowedRelationship = "", bool pGotoRelatedTable = false, object pActivateRecordID = null, string pGroupIdentifier = "", string pPreGroupingOrder = "", string pBaseFilter = "", bool pSuppressDefaultFilter = false, string pTableOrder = "", object pRequireFilter = null, string pDefaultPredefinedFilter = "", bool pSuppressViewConditions = false, Form pForm = null)
Parameters
pTableID
objectThe TableID (Int, as stored in the reporitory or a String representing the unique name)
pParentDataSet
BudaDataSetWhen this dataset is opened from another dataset, for example to get the child-records or to get the dataset for a foreign key, the pParentDataSet can be specified. Polar Studio will automatically set the Where Clause for the opened DataSet and when Inserting in a set of child-records, the foreign key to this dataset is automatically set. If pParentDataSet is given, then also parameters pFollowedRelationship and pGotoRelatedTable must be specified.
pFollowedRelationship
stringIf a relationship is 'followed', as going to child-records or going to a foreign key, then the name of the followed relationship MUST be specified. This name is the name as set in Polar Studio.
pGotoRelatedTable
boolA boolean indicating to go to a set of child-records (true) or to go to the foreign key (false). Is used in combination with pParentDataSet and pFollowedRelationship
pActivateRecordID
objectThe ID of the record to initially activate. Use Int or Null/Empty. Polar Studio will try to activate this specific record, but no error is raised if it does not succeed.
pGroupIdentifier
stringThe GroupIdentifier is a SQL expression that returns a string to identify a group of records. Is used withing PolarStudio internally.
pPreGroupingOrder
stringWhen Grouping is used (pGroupIdentifier is specified), the SQL Group-By clause in pPreGroupingOrder can be used to ensure a specific Order. Is used withing PolarStudio internally.
pBaseFilter
stringThe base-filter for this dataset. Cannot be 'removed' by user-actions. A SQL Expression, like: Customer.CountryID IN (SELECT Country.CountryID FROM Country WHERE Country.Region = 3)
pSuppressDefaultFilter
boolIn Polar Studio, a default filter can be specified for a table. When opening a dataset, this filter is always applied by default. To suppress this default filter, set pSuppressDefaultFilter to True
pTableOrder
stringA SQL Order-By expression to set a specific order of the returned records.
pRequireFilter
objectUsed for the user-interface, to suppress showing forms without any filtering. In an application where millions of customers are in the database, it is useless to open the customers-form without searching first.
pDefaultPredefinedFilter
stringIn Polar Studio, predefined filters can be created. If wanted, then name one of these filters can be specified to be applied.
pSuppressViewConditions
boolWhen opening a dataset, all view conditions for the current user are applied. Sometimes when opening a dataset in script, it is needed to go beyond these restrictions. To do so, the pSuppressViewConditions can be set to True.
pForm
FormThe form that contains this dataset. Is used withing PolarStudio internally.
Returns
- BudaDataSet
BudaDataSet
Exceptions
- PolarException
When the dataset cannot be opened, for example because of a database error or when the user has no access to this table (and pSuppressViewConditions is not set to True), an exception is raised.
OpenDynamicRecordSet(string)
To open a Dynamic Recordset on the database connection for this application.
public Recordset OpenDynamicRecordSet(string pSQLstring)
Parameters
pSQLstring
stringThe full query
Returns
OpenStaticRecordSet(string)
To open a Static Recordset on the database connection for this application.
public Recordset OpenStaticRecordSet(string pSQLstring)
Parameters
pSQLstring
stringThe full query
Returns
ReNewLocks()
To ReNew the locks for the current application-instance. Locks have a limited lifetime. If not renewed in time, they will expire (after 5 minutes). The ReNewLocks is called with each user request and in the KeepAlive processing.
public void ReNewLocks()
UnlockRecord(string, long?)
To release a lock in the RecordLocking table.
public void UnlockRecord(string pDataSetGUID = "", long? pRecordID = null)