The REST web service generates visual represenations of SWC files
- Install Maven download
- Install Tomcat download
- Install L-Measure download
git clone https://github.com/MPDL/swc-service
- Compile the service: go into
swc-service directory
, runmvn clean install
- Copy
swc.war
in Tomcatwebapp
directory - Create file
swc-service.properties
, add following property in it
screenshot.service.url = base_url_to_screenshot_service/screenshot
lmeasure.bin = path_to_the_lmeasure_binary
and put the file into Tomcat conf
directory
- Start Tomcat
- Service runs under
http://localhost:8080/swc
Following REST commands are implemented:
- Method: POST
- Media type: multipart/form-data
- Input fields:
- field 1:
- name: file1
- type: file
- value: locally selected SWC file
- field 2:
- name: portable
- type: text
- value: true|false(default)
- field 1:
- Response: Delivers HTML view representation of the SWC file.
- Method: POST
- Media type: application/x-www-form-urlencoded
- Input fields:
- field 1:
- name: swc
- type: text/texarea
- value: SWC text
- field 2:
- name: portable
- type: text
- value: true|false(default)
- field 1:
- Response: Delivers HTML view representation of the SWC text.
- Method: GET
- Media type: application/x-www-form-urlencoded
- Input fields:
- field 1:
- name: url
- type: text
- value: link to the SWC URL
- field 2:
- name: portable
- type: text
- value: true|false(default)
- field 1:
- Response: returns HTML view representation of the SWC text referenced by the URL.
Note: Setting of portable="true"
generates html which can be used offline.
- Method: POST
- Media type: multipart/form-data
- Input fields:
- field 1:
- name: file1
- type: file
- value: locally selected SWC file
- field 2:
- name: numberOfBins
- type: number
- value: see L-Measure help
- field 3:
- name: typeOfBins
- type: text
- value: number|width see L-Measure help
- field 3:
- name: query
- type: text
- value: The L-Measure functions (for instance -f0,0,0,10.0 ) see L-Measure help
- field 1:
- Response: Delivers JSON File with the L-Measure result.
- Method: POST
- Media type: application/x-www-form-urlencoded
- Input fields:
- field 1:
- name: swc
- type: text/texarea
- value: SWC text
- field 2:
- name: numberOfBins
- type: number
- value: see L-Measure help
- field 3:
- name: typeOfBins
- type: text
- value: number|width see L-Measure help
- field 3:
- name: query
- type: text
- value: The L-Measure functions (for instance -f0,0,0,10.0 ) see L-Measure help
- field 1:
- Response: Delivers JSON File with the L-Measure result.
- Method: GET
- Media type: application/x-www-form-urlencoded
- Input fields:
- field 1:
- name: url
- type: text
- value: link to the SWC URL
- field 2:
- name: numberOfBins
- type: number
- value: see L-Measure help
- field 3:
- name: typeOfBins
- type: text
- value: number|width see L-Measure help
- field 3:
- name: query
- type: text
- value: The L-Measure functions (for instance -f0,0,0,10.0 ) see L-Measure help
- field 1:
- Response: Delivers JSON File with the L-Measure result.
- Method: POST
- Media type: multipart/form-data
- Input fields:
- field:
- name: file1
- type: file
- value: locally selected SWC file
- field:
- Response: returns PNG screenshot of the rendered SWC file.
- Method: POST
- Media type: application/x-www-form-urlencoded
- Input fields:
- field:
- name: swc
- type: text/texarea
- value: SWC text
- field:
- Response: returns PNG screenshot of the rendered SWC text
- Method: GET
- Media type: application/x-www-form-urlencoded
- Input fields:
- field:
- name: url
- type: text
- value: link to the SWC text
- field:
- Response: returns PNG screenshot of the renederd SWC text referenced by the URL.
You can check http://localhost:8080/swc/api/explain
page for swc-service usage examples.