{info} Structure Checker Web Services provide methods for
- structure checking
- structure fixing
This documentation describes installation, administration and usage of Structure Checker Web Services.
Structure Checker Web Services make possible to reach the chemical functionality provided by Chemaxon's product Structure Checker.
Structure Checker Web Services application is available in two modes:
In microservices system mode, the Structure Checker Web Services runs together with the Config, Discovery and Gateway services. These three services are mandatory, and optionally other services can also be part of the system. All configuration must be done in the Config service.
The default configuration applies to the microservices system mode.
The web application runs on host <server-host> and listens on port <gateway-server-port>.
In standalone web application mode, the Structure Checker Web Services runs alone, without the Config, Discovery and Gateway services (however, the installer installs them as well).
The default configuration must be changed according to the standalone web application mode; set
eureka.client.enabled=false
in application.properties file, and
up to version 22.2.0
spring.cloud.config.failFast=false
and spring.cloud.config.enabled=false
in bootstrap.properties file
from version 22.9.0
set spring.cloud.config.enabled=false
and comment out line spring.config.import=
in application.properties file.
All configuration must be done in the Structure Checker module.
The web application runs on host <server-host> and listens on port <server-port>.
See here.
See here
See here.
Module is installed into folder: jws/jws-structurechecker
See here.
See here.
Default configuration:
application.properties | |
---|---|
server.port=8066 | |
logging.file.name=../logs/jws-structurechecker.log | |
spring.config.import=configserver:${CONFIG_SERVER_URI:http\://localhost\:8888}?fail-fast=true&max-attempts=100&max-interval=60000&multiplier=1.2&initial-interval=3000 | Added in version 22.6.0. |
eureka.client.enabled=true | set eureka.client.enabled=false to switch to standalone Structure Checker Web Services application mode |
bootstrap.properties |
---|
spring.cloud.config.failFast=true #Removed in version 22.6.0. spring.cloud.config.uri=${CONFIG_SERVER_URI:http\://localhost\:8888/} #Removed in version 22.6.0. spring.cloud.config.retry.initialInterval=3000 #Removed in version 22.6.0. spring.cloud.config.retry.multiplier=1.2 #Removed in version 22.6.0. #Removed in version 22.6.0. spring.cloud.config.retry.maxInterval=60000 #Removed in version 22.6.0. spring.cloud.config.retry.maxAttempts=100 #Removed in version 22.6.0. |
For more configuration options, see the Spring documentation page.
Prerequisites in case of microservices system mode:
Config service is running
Discovery service is running
Gateway service is running
Run the service in command line in folder jws/jws-structurechecker:
jws-structurechecker-service.exe --install
jws-structurechecker-service.exe --start
(on Windows in administrator's terminal)
jws-structurechecker-service start
(on Linux)
or
run-jws-structurechecker.exe
(on Windows)
run-jws-structurechecker
(on Linux)
Find and try out the API on the Swagger UI.
Mode | URL of Swagger UI | Default URL of Swagger UI |
---|---|---|
microservices system | <serverhost>:<gateway-port>/jws-checker-fixer/API/ | localhost:8080/jws-checker-fixer/API/ |
standalone web application mode | <serverhost>:server-port>/API/ | localhost:8066/API/ |
For detailed description check out the JWS Structure Checker demo site:
https://jchem-microservices.chemaxon.com/jws-checker-fixer/api/index.html
The above example shows how to send custom structurechecker/fixer request when using json format structurechecker/fixer configuration.
Here we document the requirements of sending custom structurechecker/fixer request when using xml format structurechecker/fixer configuration.
Place the custom created jar file in <jws-home>/extra-libs/.
Create externalcheckersfixers.xml and place it in <jws-home>/extra-libs/ or in any other folder but jws-user must have the right to read it. Example externalcheckersfixers.xml when it is also in <jws-home>/extra-libs/:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<checker-list>
<checker class="com.checkers.MyChecker" editor-class="" id="MyChecker" jar="custom-checkers.jar"/>
</checker-list>
<fixer-list>
<fixer class="com.checkers.MyFixer" id="MyFixer" jar="custom-checkers.jar"/>
</fixer-list> </configuration>
If externalcheckersfixers.xml is placed in another folder you have to reference to the jar file as:
...
<checker class="com.checkers.MyChecker" editor-class="" id="MyChecker" jar="file:///home/somebody/custom-checkers.jar"/>
...
<fixer class="com.checkers.MyFixer" id="MyFixer" jar="file:///home/somebody/custom-checkers.jar"/>
...
Add the following line to the .vmoptions file of run-jws-structurechecker and/or jws-structurechecker-service:
-Dchemaxon.structurechecker.factory.ExternalCheckerFixerConfiguration=../extra-libs/externalcheckersfixers.xml
or
-Dchemaxon.structurechecker.factory.ExternalCheckerFixerConfiguration=/<dir>/externalcheckersfixers.xml
where <dir> is the absolute path of the xml file.
Start the service jws-structurechecker
Use the /rest-v1/checker-fixer/xml-based endpoint
The guidelines, examples on the Demo siteor on the Swagger UI API documentation of your installed module display the methods and syntax implemented for reaching the functionalities of Structure Checker product.
Lists the available checkers, fixers, the checkers with their corresponding fixers and the stored checker-fixer configurations.
Provides endpoints for structure checking and fixing together.
Here is an endpoint provided for executing previously stored checker-fixer actions: /rest-v1/checker-fixer/stored/{presetName}
The checker-fixer configurations can be stored in xml or in json format in the application.properties file of the jws-srtucturechecker module and also in the application.properties file of the jws-config module.
Examples:
com.chemaxon.structurechecker.presets.exampleXML=<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<checkers>\n <AbbreviatedGroupChecker contracted=\"true\" excluded=\"\" expanded=\"true\" fixMode=\"fix\" fixerClassName=\"chemaxon.fixers.ContractGroupFixer\"/>\n</checkers>
com.chemaxon.structurechecker.presets.exampleJSON=[{"checkerSettings": {"checkerClass": "MissingAtomMapChecker","displayName": "MyStructureChecker"},"fixerSettings": {"displayName": "MyStructureFixer","exportFormat": "mrv","fixerClass": "MapMoleculeFixer"}},{"checkerSettings": {"checkerClass": "AtomMapChecker","displayName": "MyStructureChecker"}}]
Provides endpoint for executing multiple structure checkers simultaneously.
Provides endpoints for detecting errors by structure checkers one-by-one.