mx.server
The mendix.sys.Server
subsystem provides an API to handle server communication.
Properties
-
Methods
startup(callback)
This method is called to startup the subsystem.
Parameters
Name | Type | Description |
---|---|---|
callback | Function | The function to be called when startup is finished. |
Returns
-
shutdown()
This method is called to shutdown the subsystem.
Parameters
-
Returns
-
isLoaded()
This method is called to check whether the subsystem has been started.
Parameters
-
Returns
Type | Description |
---|---|
Boolean | true if the subsystem has been started. |
request(args)
This method is called to fire a request to the server. To fetch objects or invoke microflows, mx.processor should be used instead.
Parameters
Name | Type | Description |
---|---|---|
args.request.action | String | The action to trigger on the server. |
args.options.unique | Boolean | Whether this request may be merged with an already sent request with the exact same parameters. |
args.options.preventCache | Boolean | Prevent that the response comes from the browser cache. |
args.options.caller | Object | The caller instance, on which server instructions can be executed. |
args.options.handle | Function | Function to handle the result. |
args.options.error | Function | Function to handle errors. |
args.options.callback | Function | Function to handle the result when successfull. |
args.options.sync | Boolean | Whether the request should be synchronous or asynchronous. |
args.options.asyncid | String | Id for this request to ping the server. |
args.options.onValidation | Function | Function to handle validation feedback. |
args.options.standalone | Boolean | If changes may be sent to the server before executing this action. |
Returns
-
getResource(args)
This method is called to fetch a resource from the server. To get a form, mx.config.getForm should be used instead.
Parameters
Name | Type | Description |
---|---|---|
args.url | String | The url from which to fetch the resource. |
args.callback | Function | Function to handle the result. |
args.error | Function | Function to handle errors. |
args.handleAs | String | How to handle the result (text/json/xml). |
Returns
-
getCacheBust()
This method is called to get the cache bust, used to refetch assets after a redeployment.
Parameters
-
Returns
Type | Description |
---|---|
String | The cache bust to append to an url. |