Creates an instance of BaseService.
service class name
service arguments
Reference to the core API namespace
Reference to the core GUI namespace
Each model has its own local announcement system to handle all local events inside that model.
This observable object is propagate to all the UI elements (AFXTag) inside the model
The argument of the model
Placeholder for the process creation timestamp
Reference to the model's dialog
Reference to the menu entry DOM element attached to the service
Reference to the system tray menu
The HTML element ID of the virtual desktop
The service icon shown in the system tray
CSS class of the service icon shown in the system tray
The class name
Placeholder for service select callback
The process number of the current model. For sub-window this number is the number of the parent window
Reference the DOM element of the UI scheme belong to this model
Reference to the system setting
Text of the service shown in the system tray
Reference to the timer that periodically executes the callback defined in watch.
The javascript or css files that the model depends on. All dependencies will be loaded before the model is rendered
Place holder for model meta-data
Allow singleton on this model
Reference to the CSS Element of the model
Different model type
Getter: get the local announcer object
Open a YesNoDialog to confirm a task
YesNoDialog input data
Attach the service to a menu element such as the system tray menu
Awake the service, this function is usually called when the system tray menu entry attached to the service is selected.
This function should be implemented by all subclasses
Execute a server side script and get back the result
execution indication, should be:
{
path?: string, // VFS path to the server side script
code: string, // or server side code to be executed
parameters: any // the parameters of the server side execution
}
Do nothing
Report a global error
error message
Report a global fail event
fail message
Find a HTMLElement in the UI of the model
using the data-id
attribute of the element
Do nothing
Init the service before attaching it to the system tray: event subscribe, scheme loading.
Should be implemented by all subclasses
Do nothing
Get the service meta-data
Publish a global notification
notification string
Unsubscribe an event
event name or *
(all events)
Subscribe to a local event
event name
event callback
subscribe once to a local event
name of the event
event callback
This function is called when the service is exited
exit event
Open a dialog
a dialog object or a dialog class name
A promise on the callback data of the dialog, refer to each dialog definition for the format of the callback data
VFS path to the model asset
Trigger a global event
event name
event message
Exit the model
set this value to true
will bypass the prevented exit event by user
Render the model's UI
VFS path to the UI scheme definition
Select all DOM Element inside the UI of the model using JQuery selector
Do nothing
Connect to the server side api using a websocket connection
Server side script can be execute inside the stream by writing data in JSON format with the following interface
{
path?: string, // VFS path to the server side script
code: string, // or server side code to be executed
parameters: any // the parameters of the server side execution
}
subscribe to an event on the global announcement system
event name
event callback
Throw an error inside the model
trigger a local event
event name
Refresh the service menu entry in the system tray
Update the model locale
Publish a global warning
warning string
Set the callback that will be called periodically after a period of time.
Each service should only have at most one watcher
period time in seconds
callback function
Services are processes that run in the background and are waken up in certain circumstances such as by global events or user interactions.
Each service takes an entry in the system tray menu located on the system panel. This menu entry is used to access to service visual contents such as: options, task performing based on user interaction, etc.
Services are singleton processes, there is only one process of a service at a time