summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2020-01-24 14:44:20 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2020-01-24 14:44:20 +0100
commit26de0cc9e84a2f7de8ca575801d7d9ab5f4e5da7 (patch)
tree5e18d0cb48fc895a51330d7a2d26e89a37f03eab /src
parent34138ba6e14c1de1d89d0789143b133ea4eb899a (diff)
Add example Qute resource.
Change-Id: Ie5be7967d6d8536270873d01641f5ff825e31e07
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java25
-rw-r--r--src/main/resources/templates/benki/wiki/wikiPage.html10
2 files changed, 35 insertions, 0 deletions
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java
new file mode 100644
index 0000000..6ef0e40
--- /dev/null
+++ b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java
@@ -0,0 +1,25 @@
+package eu.mulk.mulkcms2.benki.wiki;
+
+import static javax.ws.rs.core.MediaType.TEXT_HTML;
+
+import io.quarkus.qute.Template;
+import io.quarkus.qute.TemplateInstance;
+import io.quarkus.qute.api.ResourcePath;
+import javax.inject.Inject;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+
+@Path("/wiki")
+public class WikiResource {
+
+ @ResourcePath("benki/wiki/wikiPage.html")
+ @Inject Template wikiPage;
+
+ @GET
+ @Path("/pages/{pageName}")
+ @Produces(TEXT_HTML)
+ public TemplateInstance getPage(@PathParam("pageName") String pageName) {
+ return wikiPage.data("title", "TEST");
+ }
+}
diff --git a/src/main/resources/templates/benki/wiki/wikiPage.html b/src/main/resources/templates/benki/wiki/wikiPage.html
new file mode 100644
index 0000000..9b3af5d
--- /dev/null
+++ b/src/main/resources/templates/benki/wiki/wikiPage.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>{title} &#8212; Benki Wiki</title>
+</head>
+<body>
+ <h1>{title}</h1>
+</body>
+</html>