Batch Administration Request
By using administration requests you can simply manage SynAdmin via a script or batch file. In a first instance administration requests effect a change of the state, whereas monitoring requests primarily show the state without changing it. With the parameter action, administration requests send commands as POST request (see below) to the address https://<server>/<WebOffice application>/synadmin of SynAdmin.
These parameters are required (preferably sent via POST, see below):
•client
•user
•password
•action
•further potential parameter
Calling via POST (recommended)
Send the parameters in the body of a POST request (application/x-www-form-urlencoded) instead of the URL. A URL including the password is stored in the access logs of Apache Tomcat and of upstream proxy servers; in this case WebOffice 10.9 R5 logs the warning SECURITY_PASSWORD_IN_URL once per application start. All examples in this chapter are POST requests with curl.exe. A call with the password in the URL (GET) still works with the same parameter names, but is not recommended.
Example with curl.exe (included in Windows 10 and Windows Server 2019 or newer):
curl.exe -d client=adminbatch -d user=batchadmin --data-urlencode "password=<batchadmin_password_encoded>" -d action=recreate_fts_index --data-urlencode "subindex=ALL" https://<server>/<WebOffice application>/synadmin
Example with PowerShell:
Invoke-WebRequest -UseBasicParsing -Method Post -Uri https://<server>/<WebOffice application>/synadmin -Body @{ client='adminbatch'; user='batchadmin'; password='<batchadmin_password_encoded>'; action='recreate_fts_index'; subindex='ALL' }
With --data-urlencode, curl encodes special characters in the password and in the subindex name itself. In a .bat file, a percent sign must be written as %%.
Configuration and selection of the encoded batchadmin password in the application configuration
The configuration of the password for the batchadmin user is defined in the application configuration.
|
•Please find more information about the configuration of the encoded batchadmin password in chapter Admin User for Batch Requests. •For security reasons, this password should not be identical to the password that is used to access SynAdmin. |
After having configured a saved the password, you can get it encoded directly from the WebOffice 10.9 R5 application file (application_config.xml).
Open the application configuration in C:\Tomcat\webapps\<WebOffice-Applikation>\WEB-INF\classes\configuration\application_config.xml and search for BATCHADMIN_USER. The password is shown in the attribute pwd.

Getting the encoded password for 'batchadmin' user from the application configuration
Administration parameter
The parameter action can assume the following content:
•action=restart
restart of the application
curl.exe -d client=adminbatch -d user=batchadmin --data-urlencode "password=<batchadmin_password_encoded>" -d action=restart https://<server>/<WebOffice application>/synadmin
•action=reload_resources
reload resources for a certain project (with parameter &project=)
curl.exe -d client=adminbatch -d user=batchadmin --data-urlencode "password=<batchadmin_password_encoded>" -d action=reload_resources --data-urlencode "project=<project>" https://<server>/<WebOffice application>/synadmin
•action=recreate_fts_index&subindex=...
Recreation of a defined subindex. Enter a complete subindex name. Sample:
curl.exe -d client=adminbatch -d user=batchadmin --data-urlencode "password=<batchadmin_password_encoded>" -d action=recreate_fts_index --data-urlencode "subindex=user@http://<server>:6080/arcgis/SampleProject/SampleProject_Cadaster/MapServer//Properties" https://<server>/<WebOffice application>/synadmin
Address a thematic subindex by using &subindex=<project name>_<external ID>
curl.exe -d client=adminbatch -d user=batchadmin --data-urlencode "password=<batchadmin_password_encoded>" -d action=recreate_fts_index --data-urlencode "subindex=WebOffice_SampleProject_transport" https://<server>/<WebOffice application>/synadmin
Using &subindex=ALL all subindices will be recreated. Sample:
curl.exe -d client=adminbatch -d user=batchadmin --data-urlencode "password=<password_encoded>" -d action=recreate_fts_index --data-urlencode "subindex=ALL" https://<server>/<WebOffice application>/synadmin
Using &subindex=ALL_OUTDATED all subindices with the state SCHEDULED, ABORTING, MISSING, OUT_OF_DATE or FAILED will be recreated. Sample:
curl.exe -d client=adminbatch -d user=batchadmin --data-urlencode "password=<batchadmin_password_encoded>" -d action=recreate_fts_index --data-urlencode "subindex=ALL_OUTDATED" https://<server>/<WebOffice application>/synadmin
|
•The complete URL for the recreation of a specific subindex can be found in the SynAdmin Full-Text Search Tab in the details of a particular layer. It is possible to add the parameter &password= for the password of the administration site (SynAdmin) to the URL. The password has to be written in plain terms (uncoded). If you use special characters in the password (e.g. #), be sure to encode those characters (e.g. %23). •By using the index-recreation time ALL subindices will be recreated periodically. |
|
The recreation of subindices should be done automatically using batch scripts. Use the windows task scheduler for executing the scripts hourly/daily. During the recreation the projects could be used normally (search, etc.) because the index recreation is independent. Please consider, that the user running the windows task indeed has access to the batch script itself. If you add the command chcp 1252 at the begin of the batch file, you don't have to care about the encoding of special characters. Example:
date /t time /t
@ECHO OFF chcp 1252 echo. curl.exe -s -d client=adminbatch -d user=batchadmin --data-urlencode "password=<batchadmin_password_encoded>" -d action=recreate_fts_index --data-urlencode "subindex=ALL" https://<server>/<WebOffice application>/synadmin |
You can download an example of a batch script for recalculating all FTS indices here. In this example, you must also adjust
▪the host name,
▪the name of the WebOffice application and
▪the encrypted password of the user batchadmin.
•action=status_fts_index
provides information about the current state of a particular subindex. Complete sub-index name required.
The following values can be used for the parameter <subindexname>:
1. Global subindex - Full name of a Global Subindex as listed in WebOffice SynAdmin - see screenshot below using the Show Subindex Details button
Example:
curl.exe -d client=adminbatch -d user=batchadmin --data-urlencode "password=<batchadmin_passwort_verschlüsselt>" -d action=status_fts_index --data-urlencode "subindex=user@http://<server>:6080/arcgis/SampleProject/SampleProject_Cadaster/MapServer//Properties" https://<server>/<WebOfficeApplikation>/synadmin
2.Thematic subindex - Full name of a Thematic Subindex as listed in WebOffice SynAdmin - see screenshot below using the Show Subindex Details button
The designation of thematic sub-indices consists of the project name and the external ID of the search layer (<project name>_<ID for external search>).
Example:
curl.exe -d client=adminbatch -d user=batchadmin --data-urlencode "password=<batchadmin_password_encoded>" -d action=status_fts_index --data-urlencode "subindex=<Subindex-Name>" https://<server>/<WebOffice application>/synadmin
3.subindex=ALL - Calculation of all defined subindices
Example:
curl.exe -d client=adminbatch -d user=batchadmin --data-urlencode "password=<batchadmin_password_encoded>" -d action=status_fts_index --data-urlencode "subindex=ALL" https://<server>/<WebOfficeApplikation>/synadmin
Response
The following answers can be returned for the parameter action=status_fts_index:
•OK (A list of all defined subindices with their current status is returned.)
|
The state of a FTS subindex can have the following values: ▪SCHEDULED ▪CREATING ▪CREATED ▪UNNEEDED ▪MISSING ▪FAILED ▪ABORTING ▪OUT_OF_DATE ▪NOT_NEEDED ▪PENDING_COMMIT The value UNKNOWN_SUBINDEX_NAME is returned, if the subindex does not exist. |
|
Please pay attention to WebOffice Project's Monitoring for monitoring the ArcGIS Server services (Esri System Monitor) and your WebOffice 10.9 R5 projects. |