From 0a821fc8e5f159ff62a0b90e9d70326f0751c66d Mon Sep 17 00:00:00 2001 From: open-autonomous-connection Date: Mon, 2 Mar 2026 16:32:06 +0000 Subject: [PATCH 1/3] Update README.MD --- README.MD | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.MD b/README.MD index 07774dd..361589a 100644 --- a/README.MD +++ b/README.MD @@ -22,6 +22,4 @@ Download all license here: https://open-autonomous-connection.org/assets/license # In progress -# TODO - -everything \ No newline at end of file +# TODO \ No newline at end of file From 14e2af25d64171239c060d3796c4632d9dbcc43c Mon Sep 17 00:00:00 2001 From: open-autonomous-connection Date: Mon, 2 Mar 2026 16:32:28 +0000 Subject: [PATCH 2/3] Update src/main/java/org/openautonomousconnection/webserver/api/WebPage.java --- .../webserver/api/WebPage.java | 68 +++++-------------- 1 file changed, 18 insertions(+), 50 deletions(-) diff --git a/src/main/java/org/openautonomousconnection/webserver/api/WebPage.java b/src/main/java/org/openautonomousconnection/webserver/api/WebPage.java index e44994b..361589a 100644 --- a/src/main/java/org/openautonomousconnection/webserver/api/WebPage.java +++ b/src/main/java/org/openautonomousconnection/webserver/api/WebPage.java @@ -1,57 +1,25 @@ -package org.openautonomousconnection.webserver.api; +# Open Autonomous Connection WebServer -import org.openautonomousconnection.protocol.packets.v1_0_1.beta.web.impl.resource.WebResourceResponsePacket; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.html.HTMLBodyElement; -import org.w3c.dom.html.HTMLDocument; -import org.w3c.dom.html.HTMLHeadElement; +This is the WebServer for our Open Autonomous Connection project.
+Feel free to join our Discord. +
-import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; +## License Notice -/** - * Server-side Java page (v1.0.1-BETA). - * - *

Every .java page must extend this class.

- */ -public abstract class WebPage { +This project (OAC) is licensed under +the [Open Autonomous Public License (OAPL)](https://open-autonomous-connection.org/license.html). - private static final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); +**Third-party components:** +
+Download all license here: https://open-autonomous-connection.org/assets/licenses.zip +- *UnlegitLibrary* is authored by the same copyright holder and is used here under a special agreement: + While [UnlegitLibrary](https://repo.unlegitdqrk.dev/UnlegitDqrk/unlegitlibrary/) is generally distributed under + the [GNU GPLv3](https://repo.unlegitdqrk.dev/UnlegitDqrk/unlegitlibrary/src/branch/master/LICENSE), + it is additionally licensed under OAPL **exclusively for the OAC project**. + Therefore, within OAC, the OAPL terms apply to UnlegitLibrary as well. - private static final DocumentBuilder documentBuilder; +# Bugs/Problems - static { - try { - documentBuilder = factory.newDocumentBuilder(); - } catch (ParserConfigurationException e) { - throw new RuntimeException(e); - } - } +# In progress - protected Document document; - - protected HTMLBodyElement body; - - protected HTMLHeadElement head; - /** - * Default constructor that creates a new Document instance - */ - public WebPage() { - this.document = documentBuilder.newDocument(); - - this.head = (HTMLHeadElement) this.document.createElement("head"); - - this.body = (HTMLBodyElement) this.document.createElement("body"); - } - - /** - * Handles a web request. - * - * @param ctx context (client, request, session) - * @return resource response packet - * @throws Exception on unexpected failures - */ - public abstract WebResourceResponsePacket handle(WebPageContext ctx) throws Exception; -} \ No newline at end of file +# TODO \ No newline at end of file From 1a7a4617beabe1befffc05c51f9d13dd3ca39465 Mon Sep 17 00:00:00 2001 From: open-autonomous-connection Date: Mon, 2 Mar 2026 16:32:42 +0000 Subject: [PATCH 3/3] Update src/main/java/org/openautonomousconnection/webserver/api/WebPage.java --- .../webserver/api/WebPage.java | 70 ++++++++++++++----- 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/openautonomousconnection/webserver/api/WebPage.java b/src/main/java/org/openautonomousconnection/webserver/api/WebPage.java index 361589a..b0df9d2 100644 --- a/src/main/java/org/openautonomousconnection/webserver/api/WebPage.java +++ b/src/main/java/org/openautonomousconnection/webserver/api/WebPage.java @@ -1,25 +1,59 @@ -# Open Autonomous Connection WebServer +package org.openautonomousconnection.webserver.api; -This is the WebServer for our Open Autonomous Connection project.
-Feel free to join our Discord. -
+import org.openautonomousconnection.protocol.packets.v1_0_1.beta.web.impl.resource.WebResourceResponsePacket; +import org.openautonomousconnection.webserver.Main; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.html.HTMLBodyElement; +import org.w3c.dom.html.HTMLDocument; +import org.w3c.dom.html.HTMLHeadElement; -## License Notice +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; -This project (OAC) is licensed under -the [Open Autonomous Public License (OAPL)](https://open-autonomous-connection.org/license.html). +/** + * Server-side Java page (v1.0.1-BETA). + * + *

Every .java page must extend this class.

+ */ +public abstract class WebPage { -**Third-party components:** -
-Download all license here: https://open-autonomous-connection.org/assets/licenses.zip -- *UnlegitLibrary* is authored by the same copyright holder and is used here under a special agreement: - While [UnlegitLibrary](https://repo.unlegitdqrk.dev/UnlegitDqrk/unlegitlibrary/) is generally distributed under - the [GNU GPLv3](https://repo.unlegitdqrk.dev/UnlegitDqrk/unlegitlibrary/src/branch/master/LICENSE), - it is additionally licensed under OAPL **exclusively for the OAC project**. - Therefore, within OAC, the OAPL terms apply to UnlegitLibrary as well. + private static final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); -# Bugs/Problems + private static final DocumentBuilder documentBuilder; -# In progress + static { + DocumentBuilder temp = null; + try { + temp = factory.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + Main.getValues().logger.exception("Failed to create document builder", e); + temp = null; + } -# TODO \ No newline at end of file + documentBuilder = temp; + } + + protected final Document document; + protected final HTMLHeadElement head; + protected final HTMLBodyElement body; + + /** + * Default constructor that creates a new Document instance + */ + public WebPage() { + this.document = documentBuilder.newDocument(); + this.head = (HTMLHeadElement) this.document.createElement("head"); + this.body = (HTMLBodyElement) this.document.createElement("body"); + } + + /** + * Handles a web request. + * + * @param ctx context (client, request, session) + * @return resource response packet + * @throws Exception on unexpected failures + */ + public abstract WebResourceResponsePacket handle(WebPageContext ctx) throws Exception; +} \ No newline at end of file