Table of Contents

Class AppConfiguration

Namespace
PolarStudio
Assembly
PolarStudio.dll

The AppConfiguration contains the whole configuration of this server-application.

public class AppConfiguration
Inheritance
AppConfiguration
Inherited Members
Extension Methods

Constructors

AppConfiguration()

The initializer, required to work with JSON deserializer. Also used to create a new AppConfiguration to run a child-application in a project.

public AppConfiguration()

Fields

CallBackObject

Is used by Polar Studio to pass a Call Back object to the new initialized BudaEngine.

[JsonIgnore]
public object CallBackObject

Field Value

object

Properties

AllowedTimerProcessCount

Sets the allowed number of Timers for this project. Can be set only once.

public int AllowedTimerProcessCount { get; set; }

Property Value

int

ApplicationSettings

A list of ApplicationSetting for each application in the project.

public List<AppConfiguration_ApplicationSettings> ApplicationSettings { get; set; }

Property Value

List<AppConfiguration_ApplicationSettings>

BlobPathSecured

public string BlobPathSecured { get; set; }

Property Value

string

BlobPathSecured_Backup

A secundary location to store a backup for secured Blobs

public string BlobPathSecured_Backup { get; set; }

Property Value

string

BlobPathStorageLocation

The blob-path that is actually part of the webroot, used to store unsecured blobs

public string BlobPathStorageLocation { get; set; }

Property Value

string

BlobPathStorageLocation_Backup

A secundary location to store a backup for unsecured Blobs

public string BlobPathStorageLocation_Backup { get; set; }

Property Value

string

CertificatePath

The full path and filename to the certificate to use for this application. If left empty, a default certificate will be searched for

public string CertificatePath { get; set; }

Property Value

string

ConfigurationFilePath

If the AppConfiguration is read from a JSON file, this property contains the path to this file in the file system.

[JsonIgnore]
public string ConfigurationFilePath { get; }

Property Value

string

CustomProperties

A list of custom properties that can be used to configure a specific project. The custom properties are name/value pairs of string/string.

public List<AppConfiguration_CustomProperty> CustomProperties { get; set; }

Property Value

List<AppConfiguration_CustomProperty>

DefaultWebService

The Default WebService to use for either the LoggingWebService or the UserValidationWebService if these are not specified.

public AppConfiguration_WebService DefaultWebService { get; set; }

Property Value

AppConfiguration_WebService

EnableDevelopmentModeForDirectStartedProject

When a project is started without a call-back object, it is likely NOT to allow DevelopmentMode. This setting can still allow development mode in that situation (when also configured in the project)

public bool EnableDevelopmentModeForDirectStartedProject { get; set; }

Property Value

bool

HostNameAndVirtualDirectory

The known HostName and the Virtual Directory, separated by a semicolon

public string HostNameAndVirtualDirectory { get; set; }

Property Value

string

LoggingWebService

The WebService to use for Logging errors and log-ins. If not specified, the DefaultWebService is used.

public AppConfiguration_WebService LoggingWebService { get; set; }

Property Value

AppConfiguration_WebService

MaxConcurrentUsers

This property sets/gets the limit for the concurrent users. If set to 0 (default) it is unlimited and therefor limited by the Certificate. Can be set to a specific value to overrule (limit) the number of allowed concurrent users.

public int MaxConcurrentUsers { get; set; }

Property Value

int

Name

The name to identify the current configuration

public string Name { get; set; }

Property Value

string

ProjectConnection

Returns the connection to the database used to store the repository of the project for this application.

public AppConfiguration_Connection ProjectConnection { get; set; }

Property Value

AppConfiguration_Connection

ProjectFolder

The folder in the file system used to store project-specific data or temporary files.

public string ProjectFolder { get; set; }

Property Value

string

ProjectName

A project name, to show in the caption-bar of PolarStudio, so the developer knows which project he/she is editing

public string ProjectName { get; set; }

Property Value

string

RemoteManagementKey

A Key to use for remote management. This is used by Polar Studio internally

public string RemoteManagementKey { get; set; }

Property Value

string

SmartHost

The SmartHost used to send out SMTP email messages.

public string SmartHost { get; set; }

Property Value

string

UserValidationWebService

The WebService to use for Blue-Polar based user validation. If not specified, the DefaultWebService is used.

public AppConfiguration_WebService UserValidationWebService { get; set; }

Property Value

AppConfiguration_WebService

WebRoot

The path in the file system where the WebRoot is located.

public string WebRoot { get; set; }

Property Value

string

WindowsPassword

The password to use for the user specified in WindowsUserName.

public string WindowsPassword { get; set; }

Property Value

string

WindowsUserName

A UserName specified in the Windows operating to use for this application.

public string WindowsUserName { get; set; }

Property Value

string

Methods

GetAppConfiguration(string)

To get an AppConfiguration form a JSON file on in the file system.

public static AppConfiguration GetAppConfiguration(string pConfigurationFilePath = "")

Parameters

pConfigurationFilePath string

The full path to the configuration file.

Returns

AppConfiguration

The initialized AppConfiguration.

GetApplicationSettings(string, bool)

To get the AppConfiguration_ApplicationSettings object for the given PID. May also return the default settings (PID=="*") if no settings were found for the given PID.

public AppConfiguration_ApplicationSettings GetApplicationSettings(string PID, bool pIngoreDefaultApplicationSettings = false)

Parameters

PID string

The PID to search for

pIngoreDefaultApplicationSettings bool

A boolean to prevent returning the default settings if no specific settings are found.

Returns

AppConfiguration_ApplicationSettings

The settings for the application

GetConfiguration()

The full JSON for this AppConfiguration

public string GetConfiguration()

Returns

string

A string representing the full JSON for this AppConfiguration.

GetCustomProperty(string, string)

To get the value of a specific custom property.

public string GetCustomProperty(string pName, string pDefaultValue = "")

Parameters

pName string

The name of the custom property

pDefaultValue string

The value to return if the custom property was not found.

Returns

string

The value of the custom property or - if the custom property was not found - the value specified in parameter pDefaultValue

GetLoggingWebService()

Returns either the LoggingWebService or - if that was not specified - the DefaultWebService

public AppConfiguration_WebService GetLoggingWebService()

Returns

AppConfiguration_WebService

GetUserValidationWebService()

Returns either the UserValidationWebService or - if that was not specified - the DefaultWebService

public AppConfiguration_WebService GetUserValidationWebService()

Returns

AppConfiguration_WebService

HasWriteAccess()

Returns a boolean value indicating that the current process is allowed to save changes to the current configuration in the file system.

public bool HasWriteAccess()

Returns

bool

NewApplicationSettings(string)

A helper to create a new AppConfiguration_ApplicationSettings object for the given PID

public AppConfiguration_ApplicationSettings NewApplicationSettings(string PID)

Parameters

PID string

The PID for the application this AppConfiguration_ApplicationSettings object is create for

Returns

AppConfiguration_ApplicationSettings

The new AppConfiguration_ApplicationSettings object

NewConnection()

To create a new Connection

public AppConfiguration_Connection NewConnection()

Returns

AppConfiguration_Connection

A new AppConfiguration_Connection object

NewConnection(AppConfiguration_Connection)

To create a new connection based on a given connection

public AppConfiguration_Connection NewConnection(AppConfiguration_Connection pSourceConnection)

Parameters

pSourceConnection AppConfiguration_Connection

The connection to use as definition.

Returns

AppConfiguration_Connection

NewConnection(string)

To create a new Connection for a full ConnectionString

public AppConfiguration_Connection NewConnection(string pCustomConnectionString)

Parameters

pCustomConnectionString string

The full connectionstring

Returns

AppConfiguration_Connection

A new connection

NewConnection(string, string, string, string)

To create a new Connection for the given server/database/username/password

public AppConfiguration_Connection NewConnection(string pServer, string pDatabase, string pUserName = "", string pPassword = "")

Parameters

pServer string

The server to connect to

pDatabase string

The database to connect to

pUserName string

The username to use. Leave empty for integrated authentication.

pPassword string

The password to use. Leave empty for integrated authentication.

Returns

AppConfiguration_Connection

NewWebService(AppConfiguration_WebService)

To create a WebService definition as a copy of a given WebService

public AppConfiguration_WebService NewWebService(AppConfiguration_WebService pSourceWebService)

Parameters

pSourceWebService AppConfiguration_WebService

The WebService to base the new webservice on

Returns

AppConfiguration_WebService

NewWebService(string, string, string, string)

To create a WebService definition for the given Address, CustomerCodeName, ApplicationCodeName and EncryptionKey

public AppConfiguration_WebService NewWebService(string pAddress = "", string pCustomerCodeName = "", string pApplicationCodeName = "", string pEncryptionKey = "")

Parameters

pAddress string

The HTTP address to connect to

pCustomerCodeName string

The CustomerCodeName to pass

pApplicationCodeName string

The ApplicationCodeName to pass

pEncryptionKey string

The symatric key that is used to encrypt data

Returns

AppConfiguration_WebService

A new WebService

SetApplicationSettings(AppConfiguration_ApplicationSettings)

To update or add specific application settings.

public void SetApplicationSettings(AppConfiguration_ApplicationSettings pApplicationSettings)

Parameters

pApplicationSettings AppConfiguration_ApplicationSettings

The new or updated application settings

Write()

To write changes in the current configuration to the file system.

public void Write()

Write(ref string)

To write changes in the current configuration to the file system.

public void Write(ref string pErrorMessage)

Parameters

pErrorMessage string

A by-ref parameter that will be filled with an error message is applicable.