Class BPserver
- Namespace
- PolarStudio
- Assembly
- PolarStudio.dll
This class is the Server that creates all web applications. Only one server object is running on a server for all users (for one project). The Server is responsible for the presentation layer and uses the data layer as is provided by the BudaEngine.
public class BPserver : PolarWeakEventListener
- Inheritance
-
BPserver
- Implements
- Inherited Members
- Extension Methods
Fields
BrowserCaching_NoStore
This property configures the HTTP headers that are applied for HTTP responses that are to expire immediately. A 'Cache-control: no-store' header can be added, but this behaviour may break the support of the navigate back in the browser.
public bool BrowserCaching_NoStore
Field Value
CookiesBasedSessionManagementOnly
This property set/get the behaviour of allowing sessions for browsers that do not support first party cookies. It is possible to allow session management using a session ID in the URL only, but it is strongly advised to set this property to True. Is set based on a setting in the project.
public bool CookiesBasedSessionManagementOnly
Field Value
ProtectSessionHijacking
This property gets/set the property that configures the protection agains hijacking sessions. ProtectSessionHijacking means that the IP address of a session is stored. When a request comes in for a session from another IP address, this is then treated as a 'hijack' and a new session will be created. If you are in an environment where IP addresses of clients change often, you can choose to disable this feature.
public bool ProtectSessionHijacking
Field Value
ProtectSessionHijacking_UrlBasedSessionIDs
This property is like the property 'ProtectSessionHijacking' but specific for sessions that do not use Cookies but only session IDs in URL's.
public bool ProtectSessionHijacking_UrlBasedSessionIDs
Field Value
Properties
BudaEngine
Returns the reference to the BudaEngine that is tied to the BPserver object.
public BudaEngine BudaEngine { get; }
Property Value
ConcurrentUsers
This method returns the actual number of concurrent connected users
public int ConcurrentUsers { get; }
Property Value
Configuration
The Configuration is set when the server object is constructed. It contains all parameters needed to run the project, like the location of the webroot, the connection to the project database (.bppx) and so on.
public AppConfiguration Configuration { get; }
Property Value
Engine
Returns the reference to the BudaEngine that is tied to the BPserver object.
public BudaEngine Engine { get; }
Property Value
ErrorHistory
This method returns a list of the last 25 unhandled errors that happend in Polar Studio.
public Collection<LoggedError> ErrorHistory { get; }
Property Value
GetContext
This method returns the script context for this Server.
public Context GetContext { get; }
Property Value
HostName
This method returns the HostName as provided by IIS. Is only applicable if the IIS application names.
public string HostName { get; }
Property Value
InitDateTime
This method returns the UTC date/time the server was started.
public DateTime InitDateTime { get; }
Property Value
KeepAliveTimerMinutes
This property gets/sets the KeepAliveTimer in minutes. The KeepAliveTimer is uses to let the browsers send a signal every x minutes. If this signal is not received anymore (and also a grace time has expired) then this browser is expected to be closed. This is used to enable long live-time settings for sessions (for example allow sessions to be 'asleep' for 120 minutes) but free resources as soon as the user closes the browser or shuts down the computer.
public int KeepAliveTimerMinutes { get; }
Property Value
LogHttpRequestCount
Set this property to a value to start logging x number of raw HTTP requests. Implement a global script LogHttpRequest(pContext, pWebRequest) to process the requests. The context for this script can be the BPserver (if no session) or the session. For normal calls, the Context.WebSession.Request object is available. In other cases, this object may be Nothing.
public int LogHttpRequestCount { get; set; }
Property Value
PhysicalPath
This method returns the physical path of the webroot of Polar Studio
public string PhysicalPath { get; }
Property Value
PolarServerApplication
Returns the PolarServerApplication wich is the HTTP-server application that contains this project. Used internally within Polar Studio.
public PolarServerApplication PolarServerApplication { get; }
Property Value
RequiredMainJSscriptVersion
This method returns the version of Main.JS that is required at minimum.
public string RequiredMainJSscriptVersion { get; }
Property Value
ServerSupportsCompression
This method returns True if the server does support data compression.
public bool ServerSupportsCompression { get; }
Property Value
Sessions
This method returns all Sessions in the engine, both connected and unconnected.
public Collection<Session> Sessions { get; }
Property Value
TimerIntervalSeconds
This Timer is a script (Server_OnTimer) that can be fired every x seconds. Set this value to 0 to stop the timer. This script can be used to run some background tasks. If the application (project) is not loaded this timer will not run. You can for example set this property in the WebSession_OnInitialize event.
public int TimerIntervalSeconds { get; set; }
Property Value
TotalBytes
This method returns to total number of bytes the server has sent out (before compression).
public long TotalBytes { get; }
Property Value
TotalBytesCompressed
This method returns to total number of bytes the server has sent out (after compression).
public long TotalBytesCompressed { get; }
Property Value
TotalErrors
This method returns to total number of unhandled errors that occurred. This does not apply to script-errors.
public int TotalErrors { get; }
Property Value
TotalFailedLogins
This method returns to total number of failed logins.
public int TotalFailedLogins { get; }
Property Value
TotalHits
This method returns the total number of hits the server has processed.
public long TotalHits { get; }
Property Value
TotalLogins
This method returns to total number of successful logins.
public int TotalLogins { get; }
Property Value
TotalTicks
This method returns the total number of ticks (milli seconds) the server has been busy processing requests.
public long TotalTicks { get; }
Property Value
VirtualDirectory
This method returns the virtual directory in IIS
public string VirtualDirectory { get; }
Property Value
Methods
ActiveUsers()
This methor returns a collection of all active (connected) users (Sessions) in this project.
public Collection<string> ActiveUsers()
Returns
CreateBodyTag(string, string, string, bool, Session, string)
This helper method creates the body tag for a custom HTML page. It is mainly used internally.
public string CreateBodyTag(string pPageType, string pPageDesignSettingsName, string pTitle, bool pAddOnKeyDownEvent, Session pSession, string pScrollPosIDcode = "")
Parameters
pPageType
stringThe type of page. Use 'ContentWindow', 'PopupWindow' or 'PopupHelp'
pPageDesignSettingsName
stringNot used anymore
pTitle
stringThe title of the page.
pAddOnKeyDownEvent
boolA boolean to indicate if a OnKeyDown event must be added to the body tag.
pSession
SessionThe WebSession the tag is created for
pScrollPosIDcode
stringA unique ID for the page can be used for keeping the ScrollPositions.
Returns
- string
A HTML string containing the <head> and <body> tags.
GetFileIcon(string)
This method returns the name of the file-icon (image) for a given file-extension. This way you can for example show an icon for a blob field.
public string GetFileIcon(string pFileExtension)
Parameters
pFileExtension
stringThe file extension.
Returns
- string
an image path like: 'FileIcons/pdf.png'
GetPolarServerIniString(string, string)
This function returns an item from the Windows\PolarServer.ini -file for the given Section / Key. Is superceeded by using the Engine.Configuration that allows setting custom properties.
public string GetPolarServerIniString(string pSection, string pKey)
Parameters
Returns
- string
The value of the key in the given section.
GetReportEngine(BudaApplication)
This method returns a report engine for the given application. For each ApplicationPID, one report engine is kept.
public ReportEngine GetReportEngine(BudaApplication pApplication)
Parameters
pApplication
BudaApplicationThe application to get the report engine for
Returns
- ReportEngine
A report engine.
GetStatsManager(string)
This method returns a StatsManager (an object to keep track of statistics).
public StatsManager GetStatsManager(string pName)
Parameters
pName
stringUse 'HiRes' for the 1 minute interval stats manager and 'LoRes' for the 5 minutes interval stats manager.
Returns
GlobalStatistics(clsBPwebRequest)
This method returns a text-formatted string containing the server stats.
public string GlobalStatistics(clsBPwebRequest pRequest = null)
Parameters
pRequest
clsBPwebRequestA clsBPwebRequest can be passed to determine the server IP.
Returns
- string
A text formatted string.
SessionByGUID(string)
This method returns the session for the given guid or Nothing if not found.
public Session SessionByGUID(string pGuid)
Parameters
pGuid
stringThe GUID to search for.
Returns
- Session
The found session or Nothing.
Version()
This method returns the version of the executable of Polar Studio, like 1.2.3
public string Version()
Returns
- string
A string with the current version of the executable.