Open file through API server
First you need to run an API server. There is a simple ARES Kudo can connect to different backends developed by the partner. ARES Kudo connects to the backends to access files, user information and supports additional workflows including commenting and markup.
Graebert provides a sample API server that implements all required REST APIs used by editor application ARES Kudo to open and save files. It is located in installation directory besides Kudo folder in API_server.
Before you setup API server, you need to install You can download this package, extract it at API server location of your choice and run it as described below.
View file | ||
---|---|---|
|
Requirement: nodejs (https://nodejs.org/en/download/)
Now you can To run the sample API server:
Open command line and go to /opt/graebert-gmbh/Kudo-Server/API_server
Run “sudo npm install” to install server
Run “node bin/www” to run server
API server now runs on port 3000. See next section how to open a files with editor.
To open a file with editor you have to pass API server and file to editor url.
Required parameters are:
...
Navigate to the sample API server location. Open the
server
subfolderRun “
npm install
” to install serverRun “
npm install -g swagger
” to install swagger tool globallyRun “
swagger project start
” to run server
The sample API server is now accessible and runs on port 3000. The sample API server provides access to local files on the host of the sample API server. To test the server, access the sample files shipped inside the files
subfolder with with server or any other accessible file:
GET http://localhost:3000/api/files/Construction.dwg/info
...
file - path of the drawing file you want to open
...
access - mode you want to open the file in. Accepted values “edit” for editing and “view” for view mode. If not passed, edit mode is used
So url to open a drawing should be like:
Editor:/api/files/Construction.dwg/diffs
To open a file with editor, pass the API server address and file id to editor.
The URLs to open a drawing depend on which port and path you selected during server install:
Editor:
e.g. for port 8081 and deploy path /editor
http://localhost:8081/editor?server=http://localhost:3000&file=/home/andrea/Documents/My%20Drawings/testConstruction.dwg
or for port 80 and deploy path /
http://localhost/?server=http://localhost:3000&file=Construction.dwg
Viewer:
http://localhost:8081/editor?server=http://localhost:3000&file=Construction.dwg&access=view
http:/home/andrea/Documents/My%20Drawings/testlocalhost/?server=http://localhost:3000&file=Construction.dwg&access=view
NOTE: The file identifier does not have to be an actual filename and can be any arbitrary identifier that is passed from editor back to the backend.