https://github.com/simplicitesoftware/module-demo-datalink
https://github.com/simplicitesoftware/module-demo-datalink
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/simplicitesoftware/module-demo-datalink
- Owner: simplicitesoftware
- Created: 2022-09-29T14:03:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-17T07:31:26.000Z (over 3 years ago)
- Last Synced: 2025-06-24T22:41:59.584Z (12 months ago)
- Size: 47.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

* * *
`DemoDataLink` module definition
================================
[](https://sonarcloud.io/dashboard?id=simplicite-modules-DemoProject)
### Introduction
This is an addon to demo **order management** application to explain the **DataLink** behavior:
- Between 2 hosts = 2 instances of the platform
- The instances must have the Demo installed, or at least the 2 object definitions: `DemoSupplier` and `DemoProduct`
- The DetaLink synchronises those objects between a master and a slave host
- Slave is notified on the fly when the master updates those objetcs thru synchronous API calls
- A cron job will make a resync from the last scan/timestamp if the slave is not available
### Import
To import this DataLink demo:
- First install the module `Demo` in 2 isolated instances (V5.3+)
- Create for each a module named `DemoDataLink`
- Set the settings as:
```json
{
"type": "git",
"origin": {
"uri": "https://github.com/simplicitesoftware/module-demo-datalink.git"
}
}
```
- Click on the _Import module_ button
### Configure
Open the DataLink from the menu (operation or settings) to change the Hosts URL/credentials
- Host name:
- same as the `SERVER_URL` or `DIRECT_URL` to be accessed from a public URL by API
- or a logical name forced on startup with `setApplicationName("myAppName")` in the PlatformHooks (needs to restart the server)
```java
public class PlatformHooks extends com.simplicite.util.engine.PlatformHooksInterface {
public String postPlatformInit(Grant sys) {
Globals.setApplicationName("SLAVE_NAME" /* or "MASTER_NAME" */);
return null;
}
}
```
- URL : the public URL to application (ex `https://myapp.domain.com`)
- User/Password:
- API credentials to get a token from slave instance
- The user must have full access to `DemoSupplier` and `DemoProduct` (designer is granted)
Make sure the Crontab contains the `DataLink` job and activate it to desired times.
Make sure `USE_API` services is available.
Clear the platforms caches.
### Test
- Create, update or delete Suppliers/Products on the master with admin profile
- Check on the salve host that updates are applied automatically to local data
- See server logs on both sides to audit issues
### Quality
This module can be analysed by the **SonarQube** analysis tool
using this command:
```bash
mvn verify sonar:sonar
```