...
The example in OFBiz (in specialpurpose/pos/data/PosSyncSettings.xml) is designed for a 3 levels architecture, where Per Store Servers (PSS) are used between POS terminals and the Master Central Server (MCS).
Here is a short explanation on how it works
This setting is intended to synchronise a main database (on the MCS) with the databases of local stores servers (PSS) each of them being synchronised with their local POS terminals. Each of these OFBiz instances use a database. Store here means a physical store where POS terminals are.
...
- Setup POS terminal with clean checkout from trunk
- In startofbiz.sh/bat set RMIIF to localhost (uncomment the line.)
- Create empty ofbiz database and populate with seed data (ant run-install-seed).
Note that for testing/learning you can load demo data as well.
For a production environment you will need to only load seed, then do all of your organization specific setup such as accounting, facilities, stores, etc. - framework/service/config/serviceengine.xml - enity-sync-rmi set to MCS.
- Start POS instance(s) (the OFBiz instance(s) which runs the POS, aka POS terminal(s)) in standard mode (web interface)
- Load EntitySync record for PULL on MCS instance (the OFBiz instance which runs the MCS)
- Load XML data on POS instance to trigger PULL sync
- Load EntitySync PUSH on POS instance(s).
- When pull is finished, load XML data to trigger PUSH
- Shutdown POS instance(s)
- pos-containers.xml on POS instance(s) - set xui session id = <facilityId-pos terminal number> ex. 10020-1.
- pos-containers.xml on POS instance(s) - set faclility ID = <facilityId) ex. 10020.
- Don't forget to change entityengine.xml on all POS instance(s) to include a prefix for record id's.
Otherwise you will get record id conflicts when instance(s) push records to the MCS.
This is done by adding the "sequenced-id-prefix" attribute to the default delegator. For example:Code Block <delegator name="default" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" distributed-cache-clear-enabled="false" sequenced-id-prefix="10020-1"> <group-map group-name="org.ofbiz" datasource-name="localpostgres" sequenced-id-prefix="10020-1"/> <group-map group-name="org.ofbiz.olap" datasource-name="localpostgres"/> </delegator>
- Add PosTerminal record to MCS database.
You must create a PosTerminal record for each POS instance you need to synchronize with MCS.
Once this record is added you can start your POS instance and attempt a synchronization. - Start your POS instance in rich client mode. (add -pos after ofbiz.jar in startup file.)
...