Client Configuration¶
For run BasisCore Commands as client side, some configuration must be set.
This configuration present as a host
JSON <Java Script Notation Object> object that implement IHostSetting
interface.
Structure of IHostSetting
object present in bellow:
1 2 3 4 | interface IHostSetting {
Logging: boolean;
Settings: IDictionary<string>;
}
|
Properties¶
- Logging
boolean
optional
Determine that Logging happen in debug window or not. Default value is
false
.- Settings
IDictionary
optional
Collection of key/value pairs that key is unique string. Use this collection to add setting or default value that some command needed for her process. Form example if document contain a dbsource command , connection setting of command must be set in
settings
. Default value isnull
.
Note
For see list of builtin commands that support run at client, see Built-in Commands
Tip
Client side part of BasisCore parsing and rendering engine implement with TypeScript
.
For more information about typescript visit TypeScript WebSite.
Remarks¶
The host
object can present as inline json object in document like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<script>
var host = {
Logging: false,
Settings: {
'basiscore': 'http://185.44.36.122:8080',
'default.dbsource.verb': 'post',
'default.dmnid': '4312'
}
}
</script>
</body>
</html>
|
Or save in separate js
file like this:
1 2 3 4 5 6 7 8 | var host = {
Logging: false,
Settings: {
'basiscore': 'http://185.44.36.122:8080',
'default.dbsource.verb': 'post',
'default.dmnid': '4312'
}
}
|
And add to bottom of main document with script
tag:
1 2 3 4 5 6 7 8 9 10 11 12 | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<script src="host.js"></script>
</body>
</html>
|
Well-known Settings¶
Client side rendering process of BasisCore use some setting usual. This setting has default value that use if not reconfigure by user. In below, review some of them:
- default.dbsource.verb
string
optional
Determine http web request verb that used in fetch data from URI. Default value is
post
.- default.dmnid
string
optional
Determine id of site domain that used in some communicate with server. this id maybe present as encrypted value for some security reason. For example some command like dbsource, send domain to data provider for security checking. Default value is
null
.
Important
For present default value in Settings
dictionary, add default.
as prefix to key of value.
For example default value for dmnid
add with default.dmnid
key.