Skip to content

Commit acbfe62

Browse files
committed
initial commit
0 parents  commit acbfe62

39 files changed

+5213
-0
lines changed

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.vscode
2+
Utility.bat
3+
classes
4+
root/LICENSE
5+
root/webapp/docs/lib
6+
root/webapp/docs/webfonts
7+
root/webapp/WEB-INF/classes
8+
root/webapp/WEB-INF/lib
9+
lib
10+
**/*.jar
11+
**/*.addon
12+
**/*.zip
13+
openapi
14+
README.html

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
# REST API Add-On
3+
4+
---
5+
> **WebCTRL** is a trademark of Automated Logic Corporation. Any other trademarks mentioned herein are the property of their respective owners.
6+
---
7+
8+
## Overview
9+
10+
The REST API Add-On provides secure access to WebCTRL server data and functionality via HTTP endpoints. It is designed for integration with custom clients, automation scripts, and web applications.
11+
12+
---
13+
> :book: **Full interactive documentation** is available from the add-on's main page once installed on your WebCTRL server. This README is meant only to give a brief overview of the capabilities.
14+
---
15+
16+
## :satellite: Endpoints
17+
18+
The add-on exposes the following endpoints:
19+
20+
- `GetSchema` — Retrieves the JSON schema used to validate input for an API endpoint.
21+
- `ResolveGQL` — Resolves a GQL path or DBID and retrieves details about the node.
22+
- `ExecCommand` — Executes manual commands on the server.
23+
24+
---
25+
26+
## :hammer_and_wrench: SDKs
27+
28+
- **JavaScript SDK**: For use in HTML content controls within graphics and other web pages. Provides convenient methods for sending API requests and handling authentication automatically.
29+
- **PowerShell SDK**: For scripted automation and CLI use cases. Compatible with PowerShell 5.1 and later.
30+
31+
---
32+
33+
## :package: Third-Party Libraries
34+
35+
This add-on uses the following third-party libraries:
36+
37+
- [fastjson2](https://github.com/alibaba/fastjson2) v2.0.58 — High-performance JSON parser and serializer for Java.
38+
- [fontawesome](https://fontawesome.com/) v6.7.2 — Icon toolkit for scalable vector icons.
39+
- [highlight.js](https://highlightjs.org/) v11.11.1 — Syntax highlighting for code blocks in documentation.

config/BUILD_DETAILS

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
JDK Version:
2+
openjdk 24.0.1 2025-04-15
3+
OpenJDK Runtime Environment (build 24.0.1+9-30)
4+
OpenJDK 64-Bit Server VM (build 24.0.1+9-30, mixed mode, sharing)
5+
6+
Compilation Flags:
7+
--release 11
8+
9+
Runtime Dependencies:
10+
addonsupport-api-addon-1.10.0
11+
alarmmanager-api-addon-1.10.0
12+
bacnet-api-core-1.11.004-20250407.1435r
13+
datatable-api-addon-1.10.0
14+
directaccess-api-addon-1.10.0
15+
logicbuilder-api-addon-1.10.0
16+
semantics-api-addon-1.10.0
17+
tomcat-embed-core-9.0.104
18+
webaccess-api-addon-1.10.0
19+
xdatabase-api-addon-1.10.0
20+
common-9.0.002
21+
commonbaseutils-2.0.5
22+
commonexceptions-9.0.002
23+
core-9.0.002
24+
core-api-9.0.002
25+
datatable-9.0.002
26+
directaccess-9.0.002
27+
directaccess-api-9.0.002
28+
manualcommands-9.0.002
29+
webaccess-api-9.0.002
30+
webserver-api-9.0.002
31+
webui-9.0.002
32+
33+
Packaged Dependencies:
34+
fastjson2-2.0.58-sources
35+
fastjson2-2.0.58

config/COMPILE_FLAGS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--release 11

config/EXTERNAL_DEPS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
url:fastjson2-2.0.58.jar:https://repo1.maven.org/maven2/com/alibaba/fastjson2/fastjson2/2.0.58/fastjson2-2.0.58.jar
2+
url:fastjson2-2.0.58-sources.jar:https://repo1.maven.org/maven2/com/alibaba/fastjson2/fastjson2/2.0.58/fastjson2-2.0.58-sources.jar

config/RUNTIME_DEPS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
file:webserver-api:modules\webserver
2+
file:core:modules\core
3+
file:core-api:modules\core
4+
file:common:modules\common
5+
file:commonexceptions:modules\commonexceptions
6+
file:commonbaseutils:bin\lib
7+
file:webui:webroot\WEB-INF\lib
8+
file:webaccess-api:modules\webaccess
9+
file:directaccess-api:modules\directaccess
10+
file:directaccess:modules\directaccess
11+
file:manualcommands:modules\manualcommands
12+
file:datatable:modules\datatable

ext/jslibs.bat

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
if /i "%*" EQU "--help" (
2+
echo JSLIBS Download third-party JavaScript libraries.
3+
exit /b 0
4+
)
5+
if "%*" NEQ "" (
6+
echo Unexpected parameter.
7+
exit /b 1
8+
)
9+
setlocal
10+
echo Downloading third-party JavaScript libraries...
11+
rmdir /S /Q "%root%\webapp\docs\lib" >nul 2>nul
12+
mkdir "%root%\webapp\docs\lib" >nul 2>nul
13+
curl --location --fail --silent --output-dir "%root%\webapp\docs\lib" --remote-name "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"
14+
curl --location --fail --silent --output-dir "%root%\webapp\docs\lib" --remote-name "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/atom-one-dark.min.css"
15+
curl --location --fail --silent --output-dir "%root%\webapp\docs\lib" --remote-name "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"
16+
curl --location --fail --silent --output-dir "%root%\webapp\docs\lib" --remote-name "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/languages/http.min.js"
17+
curl --location --fail --silent --output-dir "%root%\webapp\docs\lib" --remote-name "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/languages/powershell.min.js"
18+
rmdir /S /Q "%root%\webapp\docs\webfonts" >nul 2>nul
19+
mkdir "%root%\webapp\docs\webfonts" >nul 2>nul
20+
curl --location --fail --silent --output-dir "%root%\webapp\docs\webfonts" --remote-name "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/webfonts/fa-brands-400.ttf"
21+
curl --location --fail --silent --output-dir "%root%\webapp\docs\webfonts" --remote-name "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/webfonts/fa-brands-400.woff2"
22+
curl --location --fail --silent --output-dir "%root%\webapp\docs\webfonts" --remote-name "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/webfonts/fa-solid-900.ttf"
23+
curl --location --fail --silent --output-dir "%root%\webapp\docs\webfonts" --remote-name "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/webfonts/fa-solid-900.woff2"
24+
echo Download completed.
25+
endlocal
26+
exit /b 0

ext/zip.bat

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
if /i "%*" EQU "--help" (
2+
echo ZIP Create PowerShell SDK ZIP archive.
3+
exit /b 0
4+
)
5+
if "%*" NEQ "" (
6+
echo Unexpected parameter.
7+
exit /b 1
8+
)
9+
setlocal
10+
echo Zipping PowerShell SDK...
11+
del /F "%root%\webapp\docs\WebCTRLAPIClient.zip" >nul 2>nul
12+
"%JDKBin%\jar.exe" -cMf "%root%\webapp\docs\WebCTRLAPIClient.zip" -C "%root%\webapp\docs\WebCTRLAPIClient" .
13+
echo Zipping completed.
14+
endlocal
15+
exit /b 0

root/info.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<extension version="1">
2+
<name>RestAPI</name>
3+
<description>Exposes an OpenAPI-compatible REST API.</description>
4+
<version>0.1.0</version>
5+
<vendor>Automatic Controls Equipment Systems, Inc.</vendor>
6+
</extension>

root/webapp/WEB-INF/web.xml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<web-app>
4+
5+
<listener>
6+
<listener-class>aces.webctrl.restapi.core.Initializer</listener-class>
7+
</listener>
8+
9+
<welcome-file-list>
10+
<welcome-file>index</welcome-file>
11+
</welcome-file-list>
12+
13+
<servlet>
14+
<servlet-name>MainPage</servlet-name>
15+
<servlet-class>aces.webctrl.restapi.web.MainPage</servlet-class>
16+
</servlet>
17+
<servlet-mapping>
18+
<servlet-name>MainPage</servlet-name>
19+
<url-pattern>/index</url-pattern>
20+
</servlet-mapping>
21+
22+
<servlet>
23+
<servlet-name>API</servlet-name>
24+
<servlet-class>aces.webctrl.restapi.api.ApiHandler</servlet-class>
25+
</servlet>
26+
<servlet-mapping>
27+
<servlet-name>API</servlet-name>
28+
<url-pattern>/api/*</url-pattern>
29+
</servlet-mapping>
30+
31+
<security-constraint>
32+
<web-resource-collection>
33+
<web-resource-name>WEB</web-resource-name>
34+
<url-pattern>/*</url-pattern>
35+
</web-resource-collection>
36+
</security-constraint>
37+
38+
<filter>
39+
<filter-name>RoleFilterAJAX</filter-name>
40+
<filter-class>com.controlj.green.addonsupport.web.RoleFilter</filter-class>
41+
<init-param>
42+
<param-name>roles</param-name>
43+
<param-value>login</param-value>
44+
</init-param>
45+
</filter>
46+
<filter-mapping>
47+
<filter-name>RoleFilterAJAX</filter-name>
48+
<url-pattern>/docs/*</url-pattern>
49+
</filter-mapping>
50+
51+
<filter>
52+
<filter-name>CacheFilter</filter-name>
53+
<filter-class>aces.webctrl.restapi.web.CacheFilter</filter-class>
54+
</filter>
55+
<filter-mapping>
56+
<filter-name>CacheFilter</filter-name>
57+
<url-pattern>/docs/*</url-pattern>
58+
</filter-mapping>
59+
60+
</web-app>

0 commit comments

Comments
 (0)