Web-Service & CLI for Converting SIF to JSON & Vice Versa
Getting Started
If no go.mod, Run go mod init github.com/nsip/n3-sif2json
If no go.sum, Run go get -u ./...
Create SIF JSON Configure, Server (Web-Service) and Client (CLI) executables.
Run build.sh "sif-spec(txt) path".
e.g. run ./build.sh ./SIFSpec/3.4.6.txt ./SIFSpec/3.4.7.txt to build a web service with SIF 3.4.6 & 3.4.7 AND its CLI Client.
SIF Config is under ./2JSON/SpecCfg/(version)
Server executable is under ./Server/build/your-os/
Client executable is under ./Client/build/your-os/
Run Server (Web-Service) executable.
Goto ./Server/build/your-os/, make sure 'config.toml' is in this directory.
Make sure 'config.toml' has correct settings, especially [Cfg2JSON], [Cfg2SIF] and all [File].
In [Cfg2JSON], make sure [SIFCfgDir4LIST], [SIFCfgDir4NUM], [SIFCfgDir4BOOL] are correct.
In [Cfg2SIF], make sure [SIFSpecDir], [ReplCfgPath] are correct.
Check Client (CLI) executable (optional).
Goto ./Client/build/your-os/, make sure 'config.toml' is in this directory.
Fetch Client executable and its configure from wget when Web-Service is running.
e.g. wget ip:port/client-linux64, wget -O config.toml ip:port/client-config
Client Usage: e.g. for SIF-3.4.6, get JSON from 'Activity.xml' SIF file.
Run ./client SIF2JSON -i=../data/examples/Activity.xml -v=3.4.6
Prerequisites
SIF Specification Description File. Text readable format, and at least contains:
Spec VERSION.
LIST, NUMERIC, BOOLEAN attribute type description.
Element TRAVERSE description.
Deployment
Copy Dockerfile to ../
Run docker build --tag=n3-sif2json .
Others
UnitTest, Set /2JSON/config/config.toml [SIFCfgDir4LIST], [SIFCfgDir4NUM], [SIFCfgDir4BOOL] to ../../../; Set /2SIF/config/config.toml [SIFSpecDir], [ReplCfgPath] to ../../../.
Server, Set /2JSON/config/config.toml [SIFCfgDir4LIST], [SIFCfgDir4NUM], [SIFCfgDir4BOOL] to ../; Set /2SIF/config/config.toml [SIFSpecDir], [ReplCfgPath] to ../.
Using goclient, Make sure its config.toml [Route] is correct.