From f05cd575f7a8bb6bbf1057ed74b8af708a4c5770 Mon Sep 17 00:00:00 2001
From: "Erdle, Tobias"
Date: Fri, 5 Aug 2022 14:28:09 +0200
Subject: [PATCH] Remove extensions after their migration to krazo-extensions
see: #319
---
ext/asciidoc/.gitignore | 1 -
ext/asciidoc/pom.xml | 40 ----
.../ext/asciidoc/AsciiDocViewEngine.java | 81 -------
ext/asciidoc/src/main/resources/LICENSE.txt | 202 ------------------
.../src/main/resources/META-INF/beans.xml | 26 ---
ext/freemarker/pom.xml | 40 ----
.../DefaultConfigurationProducer.java | 77 -------
.../ext/freemarker/FreemarkerViewEngine.java | 77 -------
ext/freemarker/src/main/resources/LICENSE.txt | 202 ------------------
.../src/main/resources/META-INF/beans.xml | 26 ---
ext/handlebars/pom.xml | 39 ----
.../handlebars/DefaultHandlebarsProducer.java | 38 ----
.../ext/handlebars/HandlebarsViewEngine.java | 91 --------
ext/handlebars/src/main/resources/LICENSE.txt | 202 ------------------
.../src/main/resources/META-INF/beans.xml | 26 ---
ext/jade/README.md | 33 ---
ext/jade/pom.xml | 40 ----
.../ext/jade/JadeKrazoConfiguration.java | 158 --------------
.../krazo/ext/jade/JadeViewEngine.java | 79 -------
.../jade/ServletContextTemplateLoader.java | 79 -------
ext/jade/src/main/resources/LICENSE.txt | 202 ------------------
.../src/main/resources/META-INF/beans.xml | 26 ---
ext/jetbrick/pom.xml | 44 ----
.../ext/jetbrick/JetbrickViewEngine.java | 83 -------
.../src/main/resources/META-INF/beans.xml | 26 ---
ext/jinja2/pom.xml | 41 ----
.../ext/jinja2/DefaultJinjavaProducer.java | 22 --
.../krazo/ext/jinja2/Jinja2ViewEngine.java | 100 ---------
.../src/main/resources/META-INF/beans.xml | 25 ---
ext/mustache/pom.xml | 38 ----
.../DefaultMustacheFactoryProducer.java | 62 ------
.../ext/mustache/MustacheViewEngine.java | 77 -------
ext/mustache/src/main/resources/LICENSE.txt | 202 ------------------
.../src/main/resources/META-INF/beans.xml | 26 ---
ext/pebble/README.md | 50 -----
ext/pebble/pom.xml | 45 ----
.../pebble/PebbleConfigurationProducer.java | 58 -----
.../ext/pebble/PebbleEngineProducer.java | 126 -----------
.../krazo/ext/pebble/PebbleProperty.java | 57 -----
.../krazo/ext/pebble/PebbleViewEngine.java | 83 -------
.../src/main/resources/META-INF/beans.xml | 26 ---
.../ext/pebble/CustomEscapingStrategy.java | 29 ---
.../ext/pebble/CustomExecutorService.java | 92 --------
.../krazo/ext/pebble/CustomExtensionOne.java | 78 -------
.../krazo/ext/pebble/CustomExtensionTwo.java | 77 -------
.../PebbleConfigurationProducerTest.java | 71 ------
.../ext/pebble/PebbleEngineProducerTest.java | 113 ----------
.../krazo/ext/pebble/PebblePropertyTest.java | 52 -----
.../ext/pebble/PebbleViewEngineTest.java | 35 ---
.../src/test/resources/pebble.properties | 1 -
ext/pom.xml | 129 -----------
ext/stringtemplate/pom.xml | 40 ----
.../StringTemplateViewEngine.java | 83 -------
.../src/main/resources/LICENSE.txt | 202 ------------------
.../src/main/resources/META-INF/beans.xml | 26 ---
ext/thymeleaf/pom.xml | 38 ----
.../krazo/ext/thymeleaf/CDIWebContext.java | 143 -------------
...aServletWebApplicationWrapperProducer.java | 51 -----
.../DefaultTemplateEngineProducer.java | 54 -----
.../JakartaServletWebApplicationWrapper.java | 31 ---
.../ext/thymeleaf/ThymeleafViewEngine.java | 91 --------
ext/thymeleaf/src/main/resources/LICENSE.txt | 202 ------------------
.../src/main/resources/META-INF/beans.xml | 27 ---
ext/velocity/pom.xml | 40 ----
.../DefaultVelocityEngineProducer.java | 49 -----
.../ServletContextResourceLoader.java | 71 ------
.../ext/velocity/VelocityViewEngine.java | 78 -------
ext/velocity/src/main/resources/LICENSE.txt | 202 ------------------
.../src/main/resources/META-INF/beans.xml | 26 ---
pom.xml | 1 -
testsuite/pom.xml | 70 ------
.../test/ext/asciidoc/HelloController.java | 48 -----
.../test/ext/asciidoc/MyApplication.java | 33 ---
.../test/ext/freemarker/HelloController.java | 48 -----
.../test/ext/freemarker/MyApplication.java | 33 ---
.../test/ext/handlebars/MyApplication.java | 33 ---
.../krazo/test/ext/handlebars/Person.java | 64 ------
.../test/ext/handlebars/PersonController.java | 54 -----
.../krazo/test/ext/jade/DummyFilter.java | 39 ----
.../krazo/test/ext/jade/JadeApplication.java | 38 ----
.../krazo/test/ext/jade/JadeController.java | 70 ------
.../krazo/test/ext/jade/MathHelper.java | 31 ---
.../test/ext/jetbrick/HelloController.java | 48 -----
.../test/ext/jetbrick/MyApplication.java | 34 ---
.../test/ext/jinja2/HelloController.java | 42 ----
.../krazo/test/ext/jinja2/MyApplication.java | 26 ---
.../test/ext/jsr223/Jsr223Application.java | 34 ---
.../test/ext/jsr223/JythonController.java | 48 -----
.../test/ext/jsr223/NashornController.java | 48 -----
.../test/ext/mustache/HelloController.java | 48 -----
.../test/ext/mustache/MyApplication.java | 34 ---
.../test/ext/pebble/PebbleApplication.java | 26 ---
.../test/ext/pebble/PebbleController.java | 48 -----
.../ext/stringtemplate/HelloController.java | 45 ----
.../ext/stringtemplate/MyApplication.java | 34 ---
.../krazo/test/ext/thymeleaf/Greeting.java | 40 ----
.../test/ext/thymeleaf/HelloController.java | 47 ----
.../test/ext/thymeleaf/MyApplication.java | 34 ---
.../test/ext/velocity/HelloController.java | 58 -----
.../test/ext/velocity/MyApplication.java | 34 ---
.../main/resources/asciidoc/views/hello.adoc | 3 -
.../main/resources/freemarker/views/hello.ftl | 9 -
.../main/resources/handlebars/views/head.hbs | 1 -
.../resources/handlebars/views/person.hbs | 14 --
.../src/main/resources/jade/jade.properties | 4 -
.../src/main/resources/jade/views/config.jade | 10 -
.../src/main/resources/jade/views/helper.jade | 9 -
.../resources/jade/views/includes/footer.jade | 2 -
.../src/main/resources/jade/views/main.jade | 8 -
.../main/resources/jade/views/markdown.jade | 15 --
.../main/resources/jetbrick/views/hello.jetx | 11 -
.../src/main/resources/jinja2/views/hello.j2 | 11 -
.../src/main/resources/jsr223/views/index.js | 1 -
.../src/main/resources/jsr223/views/index.py | 1 -
.../resources/jtwig/views/hello.twig.html | 11 -
.../resources/mustache/views/hello.mustache | 9 -
.../main/resources/pebble/pebble.properties | 1 -
.../main/resources/pebble/views/filter.peb | 5 -
.../src/main/resources/pebble/views/home.peb | 8 -
.../resources/stringtemplate/views/hello.st | 13 --
.../main/resources/thymeleaf/views/hello.html | 11 -
.../main/resources/velocity/views/hello.vm | 9 -
.../resources/velocity/views/hello2.vhtml | 9 -
.../eclipse/krazo/test/ext/AsciiDocIT.java | 79 -------
.../eclipse/krazo/test/ext/FreemarkerIT.java | 72 -------
.../eclipse/krazo/test/ext/HandlebarsIT.java | 82 -------
.../org/eclipse/krazo/test/ext/JadeIT.java | 118 ----------
.../eclipse/krazo/test/ext/JetbrickIT.java | 76 -------
.../org/eclipse/krazo/test/ext/Jinja2IT.java | 80 -------
.../eclipse/krazo/test/ext/MustacheIT.java | 73 -------
.../org/eclipse/krazo/test/ext/PebbleIT.java | 78 -------
.../krazo/test/ext/StringTemplateIT.java | 73 -------
.../eclipse/krazo/test/ext/ThymeleafIT.java | 81 -------
.../eclipse/krazo/test/ext/VelocityIT.java | 81 -------
134 files changed, 7465 deletions(-)
delete mode 100644 ext/asciidoc/.gitignore
delete mode 100644 ext/asciidoc/pom.xml
delete mode 100644 ext/asciidoc/src/main/java/org/eclipse/krazo/ext/asciidoc/AsciiDocViewEngine.java
delete mode 100644 ext/asciidoc/src/main/resources/LICENSE.txt
delete mode 100644 ext/asciidoc/src/main/resources/META-INF/beans.xml
delete mode 100644 ext/freemarker/pom.xml
delete mode 100644 ext/freemarker/src/main/java/org/eclipse/krazo/ext/freemarker/DefaultConfigurationProducer.java
delete mode 100644 ext/freemarker/src/main/java/org/eclipse/krazo/ext/freemarker/FreemarkerViewEngine.java
delete mode 100644 ext/freemarker/src/main/resources/LICENSE.txt
delete mode 100644 ext/freemarker/src/main/resources/META-INF/beans.xml
delete mode 100644 ext/handlebars/pom.xml
delete mode 100644 ext/handlebars/src/main/java/org/eclipse/krazo/ext/handlebars/DefaultHandlebarsProducer.java
delete mode 100644 ext/handlebars/src/main/java/org/eclipse/krazo/ext/handlebars/HandlebarsViewEngine.java
delete mode 100644 ext/handlebars/src/main/resources/LICENSE.txt
delete mode 100644 ext/handlebars/src/main/resources/META-INF/beans.xml
delete mode 100644 ext/jade/README.md
delete mode 100644 ext/jade/pom.xml
delete mode 100644 ext/jade/src/main/java/org/eclipse/krazo/ext/jade/JadeKrazoConfiguration.java
delete mode 100644 ext/jade/src/main/java/org/eclipse/krazo/ext/jade/JadeViewEngine.java
delete mode 100644 ext/jade/src/main/java/org/eclipse/krazo/ext/jade/ServletContextTemplateLoader.java
delete mode 100644 ext/jade/src/main/resources/LICENSE.txt
delete mode 100644 ext/jade/src/main/resources/META-INF/beans.xml
delete mode 100644 ext/jetbrick/pom.xml
delete mode 100644 ext/jetbrick/src/main/java/org/eclipse/krazo/ext/jetbrick/JetbrickViewEngine.java
delete mode 100644 ext/jetbrick/src/main/resources/META-INF/beans.xml
delete mode 100644 ext/jinja2/pom.xml
delete mode 100644 ext/jinja2/src/main/java/org/eclipse/krazo/ext/jinja2/DefaultJinjavaProducer.java
delete mode 100644 ext/jinja2/src/main/java/org/eclipse/krazo/ext/jinja2/Jinja2ViewEngine.java
delete mode 100644 ext/jinja2/src/main/resources/META-INF/beans.xml
delete mode 100644 ext/mustache/pom.xml
delete mode 100644 ext/mustache/src/main/java/org/eclipse/krazo/ext/mustache/DefaultMustacheFactoryProducer.java
delete mode 100644 ext/mustache/src/main/java/org/eclipse/krazo/ext/mustache/MustacheViewEngine.java
delete mode 100644 ext/mustache/src/main/resources/LICENSE.txt
delete mode 100644 ext/mustache/src/main/resources/META-INF/beans.xml
delete mode 100644 ext/pebble/README.md
delete mode 100644 ext/pebble/pom.xml
delete mode 100644 ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleConfigurationProducer.java
delete mode 100644 ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleEngineProducer.java
delete mode 100644 ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleProperty.java
delete mode 100644 ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleViewEngine.java
delete mode 100644 ext/pebble/src/main/resources/META-INF/beans.xml
delete mode 100644 ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomEscapingStrategy.java
delete mode 100644 ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomExecutorService.java
delete mode 100644 ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomExtensionOne.java
delete mode 100644 ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomExtensionTwo.java
delete mode 100644 ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebbleConfigurationProducerTest.java
delete mode 100644 ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebbleEngineProducerTest.java
delete mode 100644 ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebblePropertyTest.java
delete mode 100644 ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebbleViewEngineTest.java
delete mode 100644 ext/pebble/src/test/resources/pebble.properties
delete mode 100644 ext/pom.xml
delete mode 100644 ext/stringtemplate/pom.xml
delete mode 100644 ext/stringtemplate/src/main/java/org/eclipse/krazo/ext/stringtemplate/StringTemplateViewEngine.java
delete mode 100644 ext/stringtemplate/src/main/resources/LICENSE.txt
delete mode 100644 ext/stringtemplate/src/main/resources/META-INF/beans.xml
delete mode 100644 ext/thymeleaf/pom.xml
delete mode 100644 ext/thymeleaf/src/main/java/org/eclipse/krazo/ext/thymeleaf/CDIWebContext.java
delete mode 100644 ext/thymeleaf/src/main/java/org/eclipse/krazo/ext/thymeleaf/DefaultJakartaServletWebApplicationWrapperProducer.java
delete mode 100644 ext/thymeleaf/src/main/java/org/eclipse/krazo/ext/thymeleaf/DefaultTemplateEngineProducer.java
delete mode 100644 ext/thymeleaf/src/main/java/org/eclipse/krazo/ext/thymeleaf/JakartaServletWebApplicationWrapper.java
delete mode 100644 ext/thymeleaf/src/main/java/org/eclipse/krazo/ext/thymeleaf/ThymeleafViewEngine.java
delete mode 100644 ext/thymeleaf/src/main/resources/LICENSE.txt
delete mode 100644 ext/thymeleaf/src/main/resources/META-INF/beans.xml
delete mode 100644 ext/velocity/pom.xml
delete mode 100644 ext/velocity/src/main/java/org/eclipse/krazo/ext/velocity/DefaultVelocityEngineProducer.java
delete mode 100644 ext/velocity/src/main/java/org/eclipse/krazo/ext/velocity/ServletContextResourceLoader.java
delete mode 100644 ext/velocity/src/main/java/org/eclipse/krazo/ext/velocity/VelocityViewEngine.java
delete mode 100644 ext/velocity/src/main/resources/LICENSE.txt
delete mode 100644 ext/velocity/src/main/resources/META-INF/beans.xml
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/asciidoc/HelloController.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/asciidoc/MyApplication.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/freemarker/HelloController.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/freemarker/MyApplication.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/handlebars/MyApplication.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/handlebars/Person.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/handlebars/PersonController.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/jade/DummyFilter.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/jade/JadeApplication.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/jade/JadeController.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/jade/MathHelper.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/jetbrick/HelloController.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/jetbrick/MyApplication.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/jinja2/HelloController.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/jinja2/MyApplication.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/jsr223/Jsr223Application.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/jsr223/JythonController.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/jsr223/NashornController.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/mustache/HelloController.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/mustache/MyApplication.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/pebble/PebbleApplication.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/pebble/PebbleController.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/stringtemplate/HelloController.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/stringtemplate/MyApplication.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/thymeleaf/Greeting.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/thymeleaf/HelloController.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/thymeleaf/MyApplication.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/velocity/HelloController.java
delete mode 100644 testsuite/src/main/java/org/eclipse/krazo/test/ext/velocity/MyApplication.java
delete mode 100644 testsuite/src/main/resources/asciidoc/views/hello.adoc
delete mode 100644 testsuite/src/main/resources/freemarker/views/hello.ftl
delete mode 100644 testsuite/src/main/resources/handlebars/views/head.hbs
delete mode 100644 testsuite/src/main/resources/handlebars/views/person.hbs
delete mode 100644 testsuite/src/main/resources/jade/jade.properties
delete mode 100644 testsuite/src/main/resources/jade/views/config.jade
delete mode 100644 testsuite/src/main/resources/jade/views/helper.jade
delete mode 100644 testsuite/src/main/resources/jade/views/includes/footer.jade
delete mode 100644 testsuite/src/main/resources/jade/views/main.jade
delete mode 100644 testsuite/src/main/resources/jade/views/markdown.jade
delete mode 100644 testsuite/src/main/resources/jetbrick/views/hello.jetx
delete mode 100644 testsuite/src/main/resources/jinja2/views/hello.j2
delete mode 100644 testsuite/src/main/resources/jsr223/views/index.js
delete mode 100644 testsuite/src/main/resources/jsr223/views/index.py
delete mode 100644 testsuite/src/main/resources/jtwig/views/hello.twig.html
delete mode 100644 testsuite/src/main/resources/mustache/views/hello.mustache
delete mode 100644 testsuite/src/main/resources/pebble/pebble.properties
delete mode 100644 testsuite/src/main/resources/pebble/views/filter.peb
delete mode 100644 testsuite/src/main/resources/pebble/views/home.peb
delete mode 100644 testsuite/src/main/resources/stringtemplate/views/hello.st
delete mode 100644 testsuite/src/main/resources/thymeleaf/views/hello.html
delete mode 100644 testsuite/src/main/resources/velocity/views/hello.vm
delete mode 100644 testsuite/src/main/resources/velocity/views/hello2.vhtml
delete mode 100644 testsuite/src/test/java/org/eclipse/krazo/test/ext/AsciiDocIT.java
delete mode 100644 testsuite/src/test/java/org/eclipse/krazo/test/ext/FreemarkerIT.java
delete mode 100644 testsuite/src/test/java/org/eclipse/krazo/test/ext/HandlebarsIT.java
delete mode 100644 testsuite/src/test/java/org/eclipse/krazo/test/ext/JadeIT.java
delete mode 100644 testsuite/src/test/java/org/eclipse/krazo/test/ext/JetbrickIT.java
delete mode 100644 testsuite/src/test/java/org/eclipse/krazo/test/ext/Jinja2IT.java
delete mode 100644 testsuite/src/test/java/org/eclipse/krazo/test/ext/MustacheIT.java
delete mode 100644 testsuite/src/test/java/org/eclipse/krazo/test/ext/PebbleIT.java
delete mode 100644 testsuite/src/test/java/org/eclipse/krazo/test/ext/StringTemplateIT.java
delete mode 100644 testsuite/src/test/java/org/eclipse/krazo/test/ext/ThymeleafIT.java
delete mode 100644 testsuite/src/test/java/org/eclipse/krazo/test/ext/VelocityIT.java
diff --git a/ext/asciidoc/.gitignore b/ext/asciidoc/.gitignore
deleted file mode 100644
index b83d2226..00000000
--- a/ext/asciidoc/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/target/
diff --git a/ext/asciidoc/pom.xml b/ext/asciidoc/pom.xml
deleted file mode 100644
index c73779fe..00000000
--- a/ext/asciidoc/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
- 4.0.0
-
- org.eclipse.krazo.ext
- krazo-ext-parent
- 3.0.0-SNAPSHOT
-
-
- krazo-asciidoc
- jar
- Eclipse Krazo AsciiDoc Extension
-
-
-
- org.asciidoctor
- asciidoctorj
-
-
-
diff --git a/ext/asciidoc/src/main/java/org/eclipse/krazo/ext/asciidoc/AsciiDocViewEngine.java b/ext/asciidoc/src/main/java/org/eclipse/krazo/ext/asciidoc/AsciiDocViewEngine.java
deleted file mode 100644
index 4438ef38..00000000
--- a/ext/asciidoc/src/main/java/org/eclipse/krazo/ext/asciidoc/AsciiDocViewEngine.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.asciidoc;
-
-import org.asciidoctor.Asciidoctor;
-import org.asciidoctor.Asciidoctor.Factory;
-import org.asciidoctor.Options;
-import org.eclipse.krazo.engine.ViewEngineBase;
-
-import jakarta.annotation.Priority;
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import jakarta.mvc.engine.ViewEngine;
-import jakarta.mvc.engine.ViewEngineContext;
-import jakarta.mvc.engine.ViewEngineException;
-import jakarta.servlet.ServletContext;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.HashMap;
-
-/**
- * Class AsciiDocViewEngine.
- *
- * @author Ricardo Arguello
- */
-@ApplicationScoped
-@Priority(ViewEngine.PRIORITY_FRAMEWORK)
-public class AsciiDocViewEngine extends ViewEngineBase {
-
- private final Asciidoctor asciidoctor;
-
- @Inject
- private ServletContext servletContext;
-
- public AsciiDocViewEngine() {
- asciidoctor = Factory.create();
- }
-
- @Override
- public boolean supports(String view) {
- return view.endsWith(".adoc") || view.endsWith(".asciidoc");
- }
-
- @Override
- public void processView(ViewEngineContext context) throws ViewEngineException {
- Charset charset = resolveCharsetAndSetContentType(context);
- try (Writer writer = new OutputStreamWriter(context.getOutputStream(), charset);
- InputStream is = servletContext.getResourceAsStream(resolveView(context));
- InputStreamReader isr = new InputStreamReader(is, "UTF-8");
- BufferedReader reader = new BufferedReader(isr)) {
-
- Options options = new Options();
- options.setAttributes(new HashMap<>(context.getModels().asMap()));
-
- asciidoctor.convert(reader, writer, options);
- } catch (IOException e) {
- throw new ViewEngineException(e);
- }
- }
-}
diff --git a/ext/asciidoc/src/main/resources/LICENSE.txt b/ext/asciidoc/src/main/resources/LICENSE.txt
deleted file mode 100644
index d6456956..00000000
--- a/ext/asciidoc/src/main/resources/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/ext/asciidoc/src/main/resources/META-INF/beans.xml b/ext/asciidoc/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 63cfccd6..00000000
--- a/ext/asciidoc/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
diff --git a/ext/freemarker/pom.xml b/ext/freemarker/pom.xml
deleted file mode 100644
index a84aa5f7..00000000
--- a/ext/freemarker/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
- 4.0.0
-
- org.eclipse.krazo.ext
- krazo-ext-parent
- 3.0.0-SNAPSHOT
-
-
- krazo-freemarker
- jar
- Eclipse Krazo Freemarker Extension
-
-
-
- org.freemarker
- freemarker
-
-
-
diff --git a/ext/freemarker/src/main/java/org/eclipse/krazo/ext/freemarker/DefaultConfigurationProducer.java b/ext/freemarker/src/main/java/org/eclipse/krazo/ext/freemarker/DefaultConfigurationProducer.java
deleted file mode 100644
index bebc7c58..00000000
--- a/ext/freemarker/src/main/java/org/eclipse/krazo/ext/freemarker/DefaultConfigurationProducer.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.freemarker;
-
-import org.eclipse.krazo.engine.ViewEngineConfig;
-import freemarker.cache.TemplateLoader;
-import freemarker.template.Configuration;
-
-import jakarta.enterprise.inject.Produces;
-import jakarta.inject.Inject;
-import jakarta.servlet.ServletContext;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-
-/**
- * Producer for the Freemarker {@link freemarker.template.Configuration} used by
- * {@link FreemarkerViewEngine}.
- *
- * @author Christian Kaltepoth
- */
-public class DefaultConfigurationProducer {
-
- @Inject
- private ServletContext servletContext;
-
- @Produces
- @ViewEngineConfig
- public Configuration getConfiguration() {
-
- Configuration configuration = new Configuration(Configuration.VERSION_2_3_26);
- configuration.setDefaultEncoding("UTF-8");
- configuration.setTemplateLoader(new TemplateLoader() {
-
- @Override
- public Object findTemplateSource(String s) throws IOException {
- return servletContext.getResourceAsStream("/" + s); // Freemarker drops "/"
- }
-
- @Override
- public long getLastModified(Object o) {
- return -1;
- }
-
- @Override
- public Reader getReader(Object o, String s) throws IOException {
- return new InputStreamReader((InputStream) o);
- }
-
- @Override
- public void closeTemplateSource(Object o) throws IOException {
- ((InputStream) o).close();
- }
- });
-
- return configuration;
-
- }
-
-}
diff --git a/ext/freemarker/src/main/java/org/eclipse/krazo/ext/freemarker/FreemarkerViewEngine.java b/ext/freemarker/src/main/java/org/eclipse/krazo/ext/freemarker/FreemarkerViewEngine.java
deleted file mode 100644
index 689c17f1..00000000
--- a/ext/freemarker/src/main/java/org/eclipse/krazo/ext/freemarker/FreemarkerViewEngine.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.freemarker;
-
-import freemarker.template.Configuration;
-import freemarker.template.Template;
-import freemarker.template.TemplateException;
-import org.eclipse.krazo.engine.ViewEngineBase;
-import org.eclipse.krazo.engine.ViewEngineConfig;
-
-import jakarta.annotation.Priority;
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import jakarta.mvc.engine.ViewEngine;
-import jakarta.mvc.engine.ViewEngineContext;
-import jakarta.mvc.engine.ViewEngineException;
-import jakarta.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Class FreemarkerViewEngine.
- *
- * @author Santiago Pericas-Geertsen
- */
-@ApplicationScoped
-@Priority(ViewEngine.PRIORITY_FRAMEWORK)
-public class FreemarkerViewEngine extends ViewEngineBase {
-
- @Inject
- @ViewEngineConfig
- private Configuration configuration;
-
- @Override
- public boolean supports(String view) {
- return view.endsWith(".ftl");
- }
-
- @Override
- public void processView(ViewEngineContext context) throws ViewEngineException {
-
- Charset charset = resolveCharsetAndSetContentType(context);
-
- try (Writer writer = new OutputStreamWriter(context.getOutputStream(), charset)) {
-
- Template template = configuration.getTemplate(resolveView(context));
-
- Map model = new HashMap<>(context.getModels().asMap());
- model.put("request", context.getRequest(HttpServletRequest.class));
-
- template.process(model, writer);
-
- } catch (TemplateException | IOException e) {
- throw new ViewEngineException(e);
- }
- }
-}
diff --git a/ext/freemarker/src/main/resources/LICENSE.txt b/ext/freemarker/src/main/resources/LICENSE.txt
deleted file mode 100644
index d6456956..00000000
--- a/ext/freemarker/src/main/resources/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/ext/freemarker/src/main/resources/META-INF/beans.xml b/ext/freemarker/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 63cfccd6..00000000
--- a/ext/freemarker/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
diff --git a/ext/handlebars/pom.xml b/ext/handlebars/pom.xml
deleted file mode 100644
index 13a58cb8..00000000
--- a/ext/handlebars/pom.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
- 4.0.0
-
- org.eclipse.krazo.ext
- krazo-ext-parent
- 2.0.0-SNAPSHOT
-
- krazo-handlebars
- jar
- Eclipse Krazo Handlebars Extension
-
-
- com.github.jknack
- handlebars
- 4.2.0
-
-
-
diff --git a/ext/handlebars/src/main/java/org/eclipse/krazo/ext/handlebars/DefaultHandlebarsProducer.java b/ext/handlebars/src/main/java/org/eclipse/krazo/ext/handlebars/DefaultHandlebarsProducer.java
deleted file mode 100644
index 0d6fe354..00000000
--- a/ext/handlebars/src/main/java/org/eclipse/krazo/ext/handlebars/DefaultHandlebarsProducer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.handlebars;
-
-import com.github.jknack.handlebars.Handlebars;
-import org.eclipse.krazo.engine.ViewEngineConfig;
-
-import jakarta.enterprise.inject.Produces;
-
-/**
- * Producer for the Handlebars instance used by HandlebarsViewEngine.
- *
- * @author Christian Kaltepoth
- */
-public class DefaultHandlebarsProducer {
- @Produces
- @ViewEngineConfig
- public Handlebars getHandlebars() {
- return new Handlebars();
- }
-
-}
diff --git a/ext/handlebars/src/main/java/org/eclipse/krazo/ext/handlebars/HandlebarsViewEngine.java b/ext/handlebars/src/main/java/org/eclipse/krazo/ext/handlebars/HandlebarsViewEngine.java
deleted file mode 100644
index baf8259d..00000000
--- a/ext/handlebars/src/main/java/org/eclipse/krazo/ext/handlebars/HandlebarsViewEngine.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.handlebars;
-
-import com.github.jknack.handlebars.Handlebars;
-import com.github.jknack.handlebars.Template;
-import com.github.jknack.handlebars.io.ServletContextTemplateLoader;
-import org.eclipse.krazo.engine.ViewEngineBase;
-import org.eclipse.krazo.engine.ViewEngineConfig;
-
-import jakarta.annotation.Priority;
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import jakarta.mvc.engine.ViewEngine;
-import jakarta.mvc.engine.ViewEngineContext;
-import jakarta.mvc.engine.ViewEngineException;
-import jakarta.servlet.ServletContext;
-import jakarta.servlet.http.HttpServletRequest;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * Class HandlebarsViewEngine
- *
- * @author Rahman Usta
- */
-@ApplicationScoped
-@Priority(ViewEngine.PRIORITY_FRAMEWORK)
-public class HandlebarsViewEngine extends ViewEngineBase {
-
- @Inject
- private ServletContext servletContext;
-
- @Inject
- @ViewEngineConfig
- private Handlebars handlebars;
-
- @Override
- public boolean supports(String view) {
- return view.endsWith(".hbs") || view.endsWith(".handlebars");
- }
-
- @Override
- public void processView(ViewEngineContext context) throws ViewEngineException {
- handlebars.with(new ServletContextTemplateLoader(servletContext, getViewFolder(context)));
-
- Map model = new HashMap<>(context.getModels().asMap());
- model.put("request", context.getRequest(HttpServletRequest.class));
-
- Charset charset = resolveCharsetAndSetContentType(context);
-
- try (Writer writer = new OutputStreamWriter(context.getOutputStream(), charset);
-
- InputStream resourceAsStream = servletContext.getResourceAsStream(resolveView(context));
- InputStreamReader in = new InputStreamReader(resourceAsStream, "UTF-8");
- BufferedReader bufferedReader = new BufferedReader(in);) {
-
- String viewContent = bufferedReader.lines().collect(Collectors.joining("\n"));
-
- Template template = handlebars.compileInline(viewContent);
- template.apply(model, writer);
-
- } catch (IOException e) {
- throw new ViewEngineException(e);
- }
- }
-}
diff --git a/ext/handlebars/src/main/resources/LICENSE.txt b/ext/handlebars/src/main/resources/LICENSE.txt
deleted file mode 100644
index d6456956..00000000
--- a/ext/handlebars/src/main/resources/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/ext/handlebars/src/main/resources/META-INF/beans.xml b/ext/handlebars/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 63cfccd6..00000000
--- a/ext/handlebars/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
diff --git a/ext/jade/README.md b/ext/jade/README.md
deleted file mode 100644
index 3f6be0fb..00000000
--- a/ext/jade/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# Jade View Engine
-
-An Eclipse Krazo Extension for the [Jade Template Engine][jade] using [Jade4J][jade4j].
-
-The extension can be configured via SystemProperties or a configuration file named "jade.properties" in the classpath (SystemProperties win).
-The default values are:
-
- org.eclipse.krazo.ext.jade.mode=XHML
- org.eclipse.krazo.ext.jade.caching=true
- org.eclipse.krazo.ext.jade.prettyPrint=false
- org.eclipse.krazo.ext.jade.encoding=UTF-8
-
-[Filters][filters] and [Helpers][helpers] can be registered with their fully qualified class name:
-
- org.eclipse.krazo.ext.jade.filters.myFilter=com.foo.bar.MyFilter
- org.eclipse.krazo.ext.jade.helpers.myHelper=com.foo.bar.MyHelper
-
-This extension does not register any Filter or Helper. Jade4j registers 3 filters per default:
-
- css=de.neuland.jade4j.filter.CssFilter
- js=de.neuland.jade4j.filter.JsFilter
- cdata=de.neuland.jade4j.filter.CDATAFilter
-
-## TODOs
-
-* The combination of filters and includes does not seem to work. See [jade4j #100][100].
-
-
- [jade]: http://jade-lang.com/
- [jade4j]: https://github.com/neuland/jade4j
- [filters]: https://github.com/neuland/jade4j#api-filters
- [helpers]: https://github.com/neuland/jade4j#api-helpers
- [100]: https://github.com/neuland/jade4j/issues/100
diff --git a/ext/jade/pom.xml b/ext/jade/pom.xml
deleted file mode 100644
index 01bf4ba5..00000000
--- a/ext/jade/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
- 4.0.0
-
- org.eclipse.krazo.ext
- krazo-ext-parent
- 3.0.0-SNAPSHOT
-
-
- krazo-jade
- jar
- Eclipse Krazo Jade Extension
-
-
-
- de.neuland-bfi
- jade4j
-
-
-
diff --git a/ext/jade/src/main/java/org/eclipse/krazo/ext/jade/JadeKrazoConfiguration.java b/ext/jade/src/main/java/org/eclipse/krazo/ext/jade/JadeKrazoConfiguration.java
deleted file mode 100644
index c81234a0..00000000
--- a/ext/jade/src/main/java/org/eclipse/krazo/ext/jade/JadeKrazoConfiguration.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.jade;
-
-import de.neuland.jade4j.Jade4J.Mode;
-import de.neuland.jade4j.JadeConfiguration;
-import de.neuland.jade4j.filter.Filter;
-import org.eclipse.krazo.engine.ViewEngineConfig;
-
-import jakarta.enterprise.inject.Disposes;
-import jakarta.enterprise.inject.Produces;
-import jakarta.inject.Inject;
-import jakarta.servlet.ServletContext;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Properties;
-
-/**
- * The JadeKrazoConfiguration. The configuration properties are qualified by
- * org.eclipse.krazo.ext.jade. Following precedence is used:
- *
- *
System Properties
- *
Properties defined in a file named jade.properties in the classpath.
- *
Defaults
- *
- *
- * @author Florian Hirsch
- */
-public class JadeKrazoConfiguration {
-
- /**
- * One of HTML, XML, XHTML. Default: XHTML
- */
- public static final String MODE = "org.eclipse.krazo.ext.jade.mode";
-
- /**
- * Parsed templates will be cached unless this property is set to false.
- */
- public static final String CACHING = "org.eclipse.krazo.ext.jade.caching";
-
- /**
- * Jade will produce compressed HTML unless this property is set to true.
- */
- public static final String PRETTY_PRINT = "org.eclipse.krazo.ext.jade.prettyPrint";
-
- /**
- * Qualifier for a {@link Filter} which shall be used by the Jade Engine.
- * The key part after the qualifier will be used as name for the filter. The
- * value should be a fully qualified class name of the filter. Example:
- * org.eclipse.krazo.ext.jade.filter.shiny=com.foo.bar.ShinyFilter
- * Jade4J by default registers following filters: cdata, css, js
- */
- public static final String FILTER_QUALIFIER = "org.eclipse.krazo.ext.jade.filter";
-
- /**
- * Qualifier for a Helper. The key part after the qualifier will be used as
- * name for the helper. The value should be a fully qualified class name of
- * the filter.
- * org.eclipse.krazo.ext.jade.helper.math=com.foo.bar.MathHelper
- *
- */
- public static final String HELPER_QUALIFIER = "org.eclipse.krazo.ext.jade.helper";
-
- /**
- * The encoding used for the templates. Defaults to UTF-8.
- */
- public static final String ENCODING = "org.eclipse.krazo.ext.jade.encoding";
-
- private Properties configFile;
-
- @Inject
- private ServletContext servletContext;
-
- @Produces
- @ViewEngineConfig
- JadeConfiguration produce() {
- loadConfig();
- JadeConfiguration jade = new JadeConfiguration();
- jade.setMode(Mode.valueOf(property(MODE).orElse("XHTML")));
- jade.setCaching(Boolean.valueOf(property(CACHING).orElse("true")));
- jade.setPrettyPrint(Boolean.valueOf(property(PRETTY_PRINT).orElse("false")));
- getExtensions(FILTER_QUALIFIER).entrySet().forEach(filter -> {
- jade.setFilter(filter.getKey(), (Filter) filter.getValue());
- });
- jade.setSharedVariables(getExtensions(HELPER_QUALIFIER));
- String encoding = property(ENCODING).orElse("UTF-8");
- jade.setTemplateLoader(new ServletContextTemplateLoader(servletContext, encoding));
- return jade;
- }
-
- private void loadConfig() {
- configFile = new Properties();
- InputStream config = Thread.currentThread().getContextClassLoader().getResourceAsStream("jade.properties");
- if (config != null) {
- try {
- configFile.load(config);
- } catch (IOException ignored) {
- // ignored
- }
- }
- }
-
- private Optional property(String key) {
- String property = System.getProperty(key, configFile.getProperty(key));
- return Optional.ofNullable(property);
- }
-
- private Map getExtensions(String qualifier) {
- Map properties = new HashMap<>();
- properties.putAll(filterProps(configFile, qualifier));
- properties.putAll(filterProps(System.getProperties(), qualifier));
- Map extensions = new HashMap<>();
- properties.forEach((key, value) -> {
- try {
- Class> filter = Class.forName(value);
- extensions.put(key, filter.newInstance());
- } catch (ClassNotFoundException | IllegalAccessException | InstantiationException ex) {
- String msg = String.format("Jade initialization error: Could not register extension '%s' of type %s", key, value);
- throw new IllegalArgumentException(msg, ex);
- }
- });
- return extensions;
- }
-
- private Map filterProps(Properties props, String qualifier) {
- Map filters = new HashMap<>();
- props.entrySet().stream()
- .filter(prop -> prop.getKey().toString().startsWith(qualifier))
- .forEach(prop -> {
- String key = prop.getKey().toString();
- filters.put(key.substring(key.indexOf(qualifier) + qualifier.length() + 1), prop.getValue().toString());
- });
- return filters;
- }
-
- void dispose(@Disposes @ViewEngineConfig JadeConfiguration jade) {
- jade.clearCache();
- }
-}
diff --git a/ext/jade/src/main/java/org/eclipse/krazo/ext/jade/JadeViewEngine.java b/ext/jade/src/main/java/org/eclipse/krazo/ext/jade/JadeViewEngine.java
deleted file mode 100644
index 4cf053e9..00000000
--- a/ext/jade/src/main/java/org/eclipse/krazo/ext/jade/JadeViewEngine.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.jade;
-
-import de.neuland.jade4j.JadeConfiguration;
-import de.neuland.jade4j.exceptions.JadeException;
-import de.neuland.jade4j.template.JadeTemplate;
-import org.eclipse.krazo.engine.ViewEngineBase;
-import org.eclipse.krazo.engine.ViewEngineConfig;
-
-import jakarta.annotation.Priority;
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import jakarta.mvc.engine.ViewEngine;
-import jakarta.mvc.engine.ViewEngineContext;
-import jakarta.mvc.engine.ViewEngineException;
-import jakarta.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The Jade View Engine.
- *
- * @author Florian Hirsch
- * @see Jade
- * @see Jade4J
- */
-@ApplicationScoped
-@Priority(ViewEngine.PRIORITY_FRAMEWORK)
-public class JadeViewEngine extends ViewEngineBase {
-
- @Inject
- @ViewEngineConfig
- private JadeConfiguration jade;
-
- @Override
- public boolean supports(String view) {
- return view.endsWith(".".concat(jade.getTemplateLoader().getExtension()));
- }
-
- @Override
- public void processView(ViewEngineContext context) throws ViewEngineException {
-
- Charset charset = resolveCharsetAndSetContentType(context);
-
- try (Writer writer = new OutputStreamWriter(context.getOutputStream(), charset)) {
-
- JadeTemplate template = jade.getTemplate(resolveView(context));
-
- Map model = new HashMap<>(context.getModels().asMap());
- model.put("request", context.getRequest(HttpServletRequest.class));
-
- jade.renderTemplate(template, model, writer);
-
- } catch (JadeException | IOException ex) {
- throw new ViewEngineException(String.format("Could not process view %s.", context.getView()), ex);
- }
- }
-}
diff --git a/ext/jade/src/main/java/org/eclipse/krazo/ext/jade/ServletContextTemplateLoader.java b/ext/jade/src/main/java/org/eclipse/krazo/ext/jade/ServletContextTemplateLoader.java
deleted file mode 100644
index 10113c3b..00000000
--- a/ext/jade/src/main/java/org/eclipse/krazo/ext/jade/ServletContextTemplateLoader.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.jade;
-
-import de.neuland.jade4j.template.TemplateLoader;
-
-import jakarta.servlet.ServletContext;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.nio.charset.Charset;
-import java.util.Objects;
-
-/**
- * A TemplateLoader using {@link ServletContext#getResource(String)} for loading
- * the given viewPath.
- *
- * @author Florian Hirsch
- */
-class ServletContextTemplateLoader implements TemplateLoader {
-
- private final ServletContext servletContext;
-
- private final String encoding;
-
- public ServletContextTemplateLoader(ServletContext servletContext, String encoding) {
- Objects.requireNonNull(servletContext, "servletContext must not be null!");
- Objects.requireNonNull(encoding, "encoding must not be null!");
- this.servletContext = servletContext;
- this.encoding = encoding;
- }
-
- @Override
- public Reader getReader(String name) throws IOException {
- InputStream inputStream = servletContext.getResourceAsStream(name);
- if (inputStream == null) {
- throw new FileNotFoundException(String.format("Jade Template '%s' not found.", name));
- }
- return new BufferedReader(new InputStreamReader(inputStream, Charset.forName(encoding)));
- }
-
- @Override
- public long getLastModified(String name) throws IOException {
- String path = servletContext.getRealPath(name);
- if (path == null) {
- return -1;
- }
- File template = new File(path);
- if (!template.exists()) {
- return -1;
- }
- return template.lastModified();
- }
-
- @Override
- public String getExtension() {
- return "jade";
- }
-}
diff --git a/ext/jade/src/main/resources/LICENSE.txt b/ext/jade/src/main/resources/LICENSE.txt
deleted file mode 100644
index d6456956..00000000
--- a/ext/jade/src/main/resources/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/ext/jade/src/main/resources/META-INF/beans.xml b/ext/jade/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 63cfccd6..00000000
--- a/ext/jade/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
diff --git a/ext/jetbrick/pom.xml b/ext/jetbrick/pom.xml
deleted file mode 100644
index 238c03a8..00000000
--- a/ext/jetbrick/pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
- 4.0.0
-
- org.eclipse.krazo.ext
- krazo-ext-parent
- 2.0.0-SNAPSHOT
-
- krazo-jetbrick
- jar
- Eclipse Krazo Jetbrick Extension
-
-
- com.github.subchen
- jetbrick-template
- 2.1.10
-
-
- com.github.subchen
- jetbrick-template-web
- 2.1.10
-
-
-
diff --git a/ext/jetbrick/src/main/java/org/eclipse/krazo/ext/jetbrick/JetbrickViewEngine.java b/ext/jetbrick/src/main/java/org/eclipse/krazo/ext/jetbrick/JetbrickViewEngine.java
deleted file mode 100644
index cb7e881f..00000000
--- a/ext/jetbrick/src/main/java/org/eclipse/krazo/ext/jetbrick/JetbrickViewEngine.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.jetbrick;
-
-import jetbrick.template.JetEngine;
-import jetbrick.template.JetTemplate;
-import jetbrick.template.TemplateException;
-import jetbrick.template.web.JetWebEngine;
-import org.eclipse.krazo.engine.ViewEngineBase;
-
-import jakarta.annotation.PostConstruct;
-import jakarta.annotation.Priority;
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import jakarta.mvc.engine.ViewEngine;
-import jakarta.mvc.engine.ViewEngineContext;
-import jakarta.mvc.engine.ViewEngineException;
-import jakarta.servlet.ServletContext;
-import jakarta.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Daniel Dias
- */
-@ApplicationScoped
-@Priority(ViewEngine.PRIORITY_FRAMEWORK)
-public class JetbrickViewEngine extends ViewEngineBase {
-
- private JetEngine jetEngine;
-
- @PostConstruct
- public void init() {
- jetEngine = JetWebEngine.create(servletContext);
- }
-
- @Inject
- private ServletContext servletContext;
-
- @Override
- public boolean supports(String view) {
- return view.endsWith(".jetx");
- }
-
- @Override
- public void processView(ViewEngineContext context) throws ViewEngineException {
-
- Charset charset = resolveCharsetAndSetContentType(context);
-
- try (Writer writer = new OutputStreamWriter(context.getOutputStream(), charset)) {
-
- JetTemplate template = jetEngine.getTemplate(resolveView(context));
-
- Map model = new HashMap<>(context.getModels().asMap());
- model.put("request", context.getRequest(HttpServletRequest.class));
-
- template.render(model, writer);
-
- } catch (TemplateException | IOException e) {
- throw new ViewEngineException(e);
- }
- }
-}
diff --git a/ext/jetbrick/src/main/resources/META-INF/beans.xml b/ext/jetbrick/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 63cfccd6..00000000
--- a/ext/jetbrick/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
diff --git a/ext/jinja2/pom.xml b/ext/jinja2/pom.xml
deleted file mode 100644
index 76855d8d..00000000
--- a/ext/jinja2/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
- 4.0.0
-
- org.eclipse.krazo.ext
- krazo-ext-parent
- 3.0.0-SNAPSHOT
-
-
- krazo-jinja2
- jar
- Eclipse Krazo Jinja2 Extension
-
-
-
- com.hubspot.jinjava
- jinjava
-
-
-
diff --git a/ext/jinja2/src/main/java/org/eclipse/krazo/ext/jinja2/DefaultJinjavaProducer.java b/ext/jinja2/src/main/java/org/eclipse/krazo/ext/jinja2/DefaultJinjavaProducer.java
deleted file mode 100644
index bb4af22d..00000000
--- a/ext/jinja2/src/main/java/org/eclipse/krazo/ext/jinja2/DefaultJinjavaProducer.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.eclipse.krazo.ext.jinja2;
-
-import com.hubspot.jinjava.Jinjava;
-
-import org.eclipse.krazo.engine.ViewEngineConfig;
-
-import jakarta.enterprise.inject.Produces;
-
-/**
- * Producer for {@link com.hubspot.jinjava.Jinjava} used by {@link Jinja2ViewEngine}.
- *
- * @author Jeremias Weber
- */
-public class DefaultJinjavaProducer {
-
- @Produces
- @ViewEngineConfig
- public Jinjava getJinjava() {
- return new Jinjava();
- }
-
-}
diff --git a/ext/jinja2/src/main/java/org/eclipse/krazo/ext/jinja2/Jinja2ViewEngine.java b/ext/jinja2/src/main/java/org/eclipse/krazo/ext/jinja2/Jinja2ViewEngine.java
deleted file mode 100644
index bc8a786a..00000000
--- a/ext/jinja2/src/main/java/org/eclipse/krazo/ext/jinja2/Jinja2ViewEngine.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2021 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.jinja2;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import com.hubspot.jinjava.Jinjava;
-import com.hubspot.jinjava.interpret.RenderResult;
-import com.hubspot.jinjava.interpret.TemplateError;
-
-import org.eclipse.krazo.engine.ViewEngineBase;
-import org.eclipse.krazo.engine.ViewEngineConfig;
-
-import jakarta.annotation.Priority;
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import jakarta.mvc.engine.ViewEngine;
-import jakarta.mvc.engine.ViewEngineContext;
-import jakarta.mvc.engine.ViewEngineException;
-import jakarta.servlet.ServletContext;
-
-@ApplicationScoped
-@Priority(ViewEngine.PRIORITY_FRAMEWORK)
-public class Jinja2ViewEngine extends ViewEngineBase {
-
- @Inject
- @ViewEngineConfig
- private Jinjava jinjava;
-
- @Inject
- private ServletContext servletContext;
-
- @Override
- public boolean supports(String view) {
- return view.endsWith(".j2") || view.endsWith(".jinja") || view.endsWith(".jinja2");
- }
-
- @Override
- public void processView(ViewEngineContext context) throws ViewEngineException {
-
- Charset charset = resolveCharsetAndSetContentType(context);
- try (Writer writer = new OutputStreamWriter(context.getOutputStream(), charset);
- InputStream is = servletContext.getResourceAsStream(resolveView(context));
- InputStreamReader isr = new InputStreamReader(is, "UTF-8");
- BufferedReader reader = new BufferedReader(isr)) {
-
- RenderResult result = jinjava.renderForResult(
- reader.lines().collect(Collectors.joining()),
- new HashMap<>(context.getModels().asMap())
- );
- if (result.hasErrors()) {
- throw new ViewEngineException(formatTemplateErrors(result.getErrors()));
- }
-
- writer.write(result.getOutput());
- } catch (IOException e) {
- throw new ViewEngineException(e);
- }
- }
-
- private String formatTemplateErrors(List errors) {
- StringBuilder builder = new StringBuilder("Errors rendering Jinja2 Template:\n");
- for (TemplateError error : errors) {
- builder.append("Severity: ");
- builder.append(error.getSeverity());
-
- builder.append("; Line number: ");
- builder.append(error.getLineno());
-
- builder.append("; Message: ");
- builder.append(error.getMessage());
- builder.append("\n");
- }
- return builder.toString();
- }
-}
diff --git a/ext/jinja2/src/main/resources/META-INF/beans.xml b/ext/jinja2/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 5602a9e2..00000000
--- a/ext/jinja2/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
diff --git a/ext/mustache/pom.xml b/ext/mustache/pom.xml
deleted file mode 100644
index 30ef99af..00000000
--- a/ext/mustache/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
- 4.0.0
-
- org.eclipse.krazo.ext
- krazo-ext-parent
- 3.0.0-SNAPSHOT
-
- krazo-mustache
- jar
- Eclipse Krazo Mustache Extension
-
-
- com.github.spullara.mustache.java
- compiler
-
-
-
diff --git a/ext/mustache/src/main/java/org/eclipse/krazo/ext/mustache/DefaultMustacheFactoryProducer.java b/ext/mustache/src/main/java/org/eclipse/krazo/ext/mustache/DefaultMustacheFactoryProducer.java
deleted file mode 100644
index bd61f5ec..00000000
--- a/ext/mustache/src/main/java/org/eclipse/krazo/ext/mustache/DefaultMustacheFactoryProducer.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.mustache;
-
-import com.github.mustachejava.DefaultMustacheFactory;
-import com.github.mustachejava.MustacheFactory;
-import org.eclipse.krazo.engine.ViewEngineConfig;
-
-import jakarta.enterprise.inject.Produces;
-import jakarta.inject.Inject;
-import jakarta.servlet.ServletContext;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-/**
- * Producer for the MustacheFactory used by MustacheViewEngine
- *
- * @author Christian Kaltepoth
- */
-public class DefaultMustacheFactoryProducer {
-
- @Inject
- private ServletContext servletContext;
-
- @Produces
- @ViewEngineConfig
- public MustacheFactory getMustacheFactory() {
- return new KrazoMustacheFactory();
- }
-
- private class KrazoMustacheFactory extends DefaultMustacheFactory {
- @Override
- public Reader getReader(String resourceName) {
- InputStream is = servletContext.getResourceAsStream(resourceName);
- if (is != null) {
- return new BufferedReader(new InputStreamReader(is, UTF_8));
- }
- return super.getReader(resourceName);
- }
- }
-
-}
diff --git a/ext/mustache/src/main/java/org/eclipse/krazo/ext/mustache/MustacheViewEngine.java b/ext/mustache/src/main/java/org/eclipse/krazo/ext/mustache/MustacheViewEngine.java
deleted file mode 100644
index 2b8eac98..00000000
--- a/ext/mustache/src/main/java/org/eclipse/krazo/ext/mustache/MustacheViewEngine.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.mustache;
-
-import com.github.mustachejava.Mustache;
-import com.github.mustachejava.MustacheFactory;
-import org.eclipse.krazo.engine.ViewEngineBase;
-import org.eclipse.krazo.engine.ViewEngineConfig;
-
-import jakarta.annotation.Priority;
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import jakarta.mvc.engine.ViewEngine;
-import jakarta.mvc.engine.ViewEngineContext;
-import jakarta.mvc.engine.ViewEngineException;
-import jakarta.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Class MustacheViewEngine.
- *
- * @author Rodrigo Turini
- */
-@ApplicationScoped
-@Priority(ViewEngine.PRIORITY_FRAMEWORK)
-public class MustacheViewEngine extends ViewEngineBase {
-
- @Inject
- @ViewEngineConfig
- private MustacheFactory factory;
-
- @Override
- public boolean supports(String view) {
- return view.endsWith(".mustache");
- }
-
- @Override
- public void processView(ViewEngineContext context) throws ViewEngineException {
-
- Charset charset = resolveCharsetAndSetContentType(context);
-
- try (Writer writer = new OutputStreamWriter(context.getOutputStream(), charset)) {
-
- Mustache mustache = factory.compile(resolveView(context));
-
- Map model = new HashMap<>(context.getModels().asMap());
- model.put("request", context.getRequest(HttpServletRequest.class));
-
- mustache.execute(writer, model).flush();
-
- } catch (IOException e) {
- throw new ViewEngineException(e);
- }
- }
-
-}
diff --git a/ext/mustache/src/main/resources/LICENSE.txt b/ext/mustache/src/main/resources/LICENSE.txt
deleted file mode 100644
index d6456956..00000000
--- a/ext/mustache/src/main/resources/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/ext/mustache/src/main/resources/META-INF/beans.xml b/ext/mustache/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 63cfccd6..00000000
--- a/ext/mustache/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
diff --git a/ext/pebble/README.md b/ext/pebble/README.md
deleted file mode 100644
index 64add3c4..00000000
--- a/ext/pebble/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-# Pebble View Engine
-
-An Eclipse Krazo extension for the [Pebble Template Engine][pebble].
-
-Pebble extension can be configured either by setting system properties or by creating a configuration file named `pebble.properties` on the project's classpath. System properties have higher priority and will override values set in the properties file.
-
-## Available properties
-```properties
-org.eclipse.krazo.ext.pebble.autoEscaping # true or false
-org.eclipse.krazo.ext.pebble.cacheActive # true or false
-org.eclipse.krazo.ext.pebble.escapingStrategy # fully qualified class name
-org.eclipse.krazo.ext.pebble.defaultLocale # e.q. de
-org.eclipse.krazo.ext.pebble.newLineTrimming # true or false
-org.eclipse.krazo.ext.pebble.strictVariables # true or false
-org.eclipse.krazo.ext.pebble.executorService # comma separated, fully qualified class names
-org.eclipse.krazo.ext.pebble.tagCacheMax # e.q. 150
-org.eclipse.krazo.ext.pebble.templateCacheMax # e.q. 150
-org.eclipse.krazo.ext.pebble.extension # comma separated, fully qualified class names
-```
-
-Properties with value equal to empty string will be ignored.
-All the default values are the same as described in Pebble's documentation except one:
-
-`loader` is forced to ServletLoader as it is recommended for application server usage.
-
-## Providing custom `PebbleEngine`
-If you would like to completely override the default `PebbleEngineProducer` you can make use of the following code sample:
-```java
-public class CustomPebbleEngineProducer extends PebbleEngineProducer {
-
- @Context
- ServletContext servletContext;
-
- @Override
- @Specializes
- @Produces
- @ViewEngineConfig
- public PebbleEngine pebbleEngine() {
- return new PebbleEngine.Builder()
- .loader(new ServletLoader(servletContext))
- //.autoEscaping(...)
- //.addEscapingStrategy(...)
- //...
- .build();
- }
-
-}
-```
-
- [pebble]: https://pebbletemplates.io/
diff --git a/ext/pebble/pom.xml b/ext/pebble/pom.xml
deleted file mode 100644
index 568e1b56..00000000
--- a/ext/pebble/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
- 4.0.0
-
- org.eclipse.krazo.ext
- krazo-ext-parent
- 3.0.0-SNAPSHOT
-
-
- krazo-pebble
- jar
- Eclipse Krazo Pebble Extension
-
-
-
- io.pebbletemplates
- pebble
-
-
-
- junit
- junit
-
-
-
diff --git a/ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleConfigurationProducer.java b/ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleConfigurationProducer.java
deleted file mode 100644
index c7fb7567..00000000
--- a/ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleConfigurationProducer.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.pebble;
-
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.enterprise.inject.Produces;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Objects;
-import java.util.Properties;
-import java.util.stream.Stream;
-
-@ApplicationScoped
-public class PebbleConfigurationProducer {
-
- @Produces
- public Properties pebbleConfiguration() {
- Properties pebbleProperties = loadFromFile("pebble.properties");
-
- Stream.of(PebbleProperty.values())
- .forEach(property
- -> property.systemPropertyValue().ifPresent(value -> pebbleProperties.put(property.key(), value))
- );
-
- return pebbleProperties;
- }
-
- public Properties loadFromFile(String fileName) {
- Properties props = new Properties();
-
- try (InputStream config = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName)) {
- if (Objects.nonNull(config)) {
- props.load(config);
- }
- } catch (IOException e) {
- // ignore exception
- }
-
- return props;
- }
-
-}
diff --git a/ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleEngineProducer.java b/ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleEngineProducer.java
deleted file mode 100644
index 73237105..00000000
--- a/ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleEngineProducer.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018-2021 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.pebble;
-
-import com.mitchellbosecke.pebble.PebbleEngine;
-import com.mitchellbosecke.pebble.extension.Extension;
-import com.mitchellbosecke.pebble.extension.escaper.EscapingStrategy;
-import com.mitchellbosecke.pebble.loader.Servlet5Loader;
-import java.lang.reflect.InvocationTargetException;
-import org.eclipse.krazo.engine.ViewEngineConfig;
-
-import jakarta.enterprise.inject.Produces;
-import jakarta.inject.Inject;
-import jakarta.servlet.ServletContext;
-import java.util.Locale;
-import java.util.Properties;
-import java.util.concurrent.ExecutorService;
-import java.util.stream.Stream;
-
-public class PebbleEngineProducer {
-
- protected Properties pebbleConfiguration;
- protected ServletContext servletContext;
-
- @Inject
- public PebbleEngineProducer(Properties pebbleConfiguration, ServletContext servletContext) {
- this.pebbleConfiguration = pebbleConfiguration;
- this.servletContext = servletContext;
- }
-
- protected PebbleEngineProducer(ServletContext servletContext) {
- this.servletContext = servletContext;
- }
-
- protected PebbleEngineProducer() {
- }
-
- @Produces
- @ViewEngineConfig
- public PebbleEngine pebbleEngine() {
- PebbleEngine.Builder engine = new PebbleEngine.Builder();
-
- pebbleConfiguration
- .entrySet()
- .stream()
- .filter(e -> String.valueOf(e.getValue()).trim().length() > 0)
- .forEach((e) -> {
-
- String val = String.valueOf(e.getValue());
-
- switch (PebbleProperty.fromKey(String.valueOf(e.getKey()))) {
- case AUTO_ESCAPING:
- engine.autoEscaping(Boolean.valueOf(val));
- break;
- case CACHE_ACTIVE:
- engine.cacheActive(Boolean.valueOf(val));
- break;
- case ESCAPING_STRATEGY:
- try {
- String escapingStrategyKey = "userDefinedEscapingStrategy";
- engine.addEscapingStrategy(escapingStrategyKey, (EscapingStrategy) Class.forName(val).getDeclaredConstructor().newInstance());
- engine.defaultEscapingStrategy(escapingStrategyKey);
- } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException ex) {
- String msg = String.format("Pebble initialization error: Could not register escaping strategy '%s' of type %s", String.valueOf(e.getKey()), val);
- throw new IllegalArgumentException(msg, ex);
- }
- break;
- case DEFAULT_LOCALE:
- engine.defaultLocale(Locale.forLanguageTag(val));
- break;
- case NEW_LINE_TRIMMING:
- engine.newLineTrimming(Boolean.valueOf(val));
- break;
- case STRICT_VARIABLES:
- engine.strictVariables(Boolean.valueOf(val));
- break;
- case EXECUTOR_SERVICE:
- try {
- engine.executorService((ExecutorService) Class.forName(val).getDeclaredConstructor().newInstance());
- } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException ex) {
- String msg = String.format("Pebble initialization error: Could not register executor service type %s", val);
- throw new IllegalArgumentException(msg, ex);
- }
- break;
- case EXTENSION:
- String[] extensions = val.split(",");
-
- Extension[] extensionArray = Stream.of(extensions)
- .map(clazzName -> {
- try {
- return (Extension) Class.forName(clazzName.trim()).getDeclaredConstructor().newInstance();
- } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException ex) {
- String msg = String.format("Pebble initialization error: Could not register extension of type %s", clazzName);
- throw new IllegalArgumentException(msg, ex);
- }
- }).toArray(Extension[]::new);
-
- engine.extension(extensionArray);
- break;
- default:
- break;
- }
- });
-
- engine.loader(new Servlet5Loader(servletContext));
-
- return engine.build();
- }
-
-}
diff --git a/ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleProperty.java b/ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleProperty.java
deleted file mode 100644
index d0332e98..00000000
--- a/ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleProperty.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.pebble;
-
-import java.util.Optional;
-import java.util.stream.Stream;
-
-public enum PebbleProperty {
-
- AUTO_ESCAPING("autoEscaping"),
- CACHE_ACTIVE("cacheActive"),
- ESCAPING_STRATEGY("escapingStrategy"),
- DEFAULT_LOCALE("defaultLocale"),
- NEW_LINE_TRIMMING("newLineTrimming"),
- STRICT_VARIABLES("strictVariables"),
- EXECUTOR_SERVICE("executorService"),
- EXTENSION("extension"),
- UNKNOWN("unknown");
-
- private static final String GROUP_PREFIX = "org.eclipse.krazo.ext.pebble.";
- private final String key;
-
- PebbleProperty(String key) {
- this.key = key;
- }
-
- public String key() {
- return GROUP_PREFIX + this.key;
- }
-
- public static PebbleProperty fromKey(String key) {
- return Stream.of(PebbleProperty.values())
- .filter(property -> property.key().equals(key))
- .findFirst()
- .orElse(UNKNOWN);
- }
-
- public Optional systemPropertyValue() {
- return Optional.ofNullable(System.getProperty(this.key()));
- }
-}
diff --git a/ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleViewEngine.java b/ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleViewEngine.java
deleted file mode 100644
index a0f2a449..00000000
--- a/ext/pebble/src/main/java/org/eclipse/krazo/ext/pebble/PebbleViewEngine.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.pebble;
-
-import com.mitchellbosecke.pebble.PebbleEngine;
-import com.mitchellbosecke.pebble.error.PebbleException;
-import com.mitchellbosecke.pebble.template.PebbleTemplate;
-import org.eclipse.krazo.engine.ViewEngineBase;
-import org.eclipse.krazo.engine.ViewEngineConfig;
-
-import jakarta.annotation.Priority;
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import jakarta.mvc.engine.ViewEngine;
-import jakarta.mvc.engine.ViewEngineContext;
-import jakarta.mvc.engine.ViewEngineException;
-import jakarta.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @see Pebble
- */
-@ApplicationScoped
-@Priority(ViewEngine.PRIORITY_FRAMEWORK)
-public class PebbleViewEngine extends ViewEngineBase {
-
- private PebbleEngine pebbleEngine;
-
- @SuppressWarnings("unused")
- protected PebbleViewEngine() {
- // needs a default constructor to make it proxyable
- }
-
- @Inject
- public PebbleViewEngine(@ViewEngineConfig PebbleEngine pebbleEngine) {
- this.pebbleEngine = pebbleEngine;
- }
-
- @Override
- public boolean supports(String view) {
- return view.endsWith(".peb");
- }
-
- @Override
- public void processView(ViewEngineContext context) throws ViewEngineException {
-
- Charset charset = resolveCharsetAndSetContentType(context);
-
- try (Writer writer = new OutputStreamWriter(context.getOutputStream(), charset)) {
-
- PebbleTemplate template = pebbleEngine.getTemplate(resolveView(context));
-
- Map model = new HashMap<>(context.getModels().asMap());
- model.put("request", context.getRequest(HttpServletRequest.class));
-
- template.evaluate(writer, model);
-
- } catch (PebbleException | IOException ex) {
- throw new ViewEngineException(String.format("Could not process view %s.", context.getView()), ex);
- }
- }
-}
diff --git a/ext/pebble/src/main/resources/META-INF/beans.xml b/ext/pebble/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 63cfccd6..00000000
--- a/ext/pebble/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
diff --git a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomEscapingStrategy.java b/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomEscapingStrategy.java
deleted file mode 100644
index bf76c200..00000000
--- a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomEscapingStrategy.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.pebble;
-
-import com.mitchellbosecke.pebble.extension.escaper.EscapingStrategy;
-
-public class CustomEscapingStrategy implements EscapingStrategy {
-
- @Override
- public String escape(String string) {
- return string;
- }
-}
diff --git a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomExecutorService.java b/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomExecutorService.java
deleted file mode 100644
index b889d981..00000000
--- a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomExecutorService.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.pebble;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.*;
-
-public class CustomExecutorService implements ExecutorService {
-
- @Override
- public void shutdown() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public List shutdownNow() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public boolean isShutdown() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public boolean isTerminated() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public Future submit(Callable task) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public Future submit(Runnable task, T result) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public Future> submit(Runnable task) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public List> invokeAll(Collection extends Callable> tasks) throws InterruptedException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public List> invokeAll(Collection extends Callable> tasks, long timeout, TimeUnit unit) throws InterruptedException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public T invokeAny(Collection extends Callable> tasks) throws InterruptedException, ExecutionException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public T invokeAny(Collection extends Callable> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void execute(Runnable command) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
-}
diff --git a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomExtensionOne.java b/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomExtensionOne.java
deleted file mode 100644
index 83754ac2..00000000
--- a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomExtensionOne.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.pebble;
-
-import com.mitchellbosecke.pebble.attributes.AttributeResolver;
-import com.mitchellbosecke.pebble.extension.*;
-import com.mitchellbosecke.pebble.operator.BinaryOperator;
-import com.mitchellbosecke.pebble.operator.UnaryOperator;
-import com.mitchellbosecke.pebble.tokenParser.TokenParser;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-public class CustomExtensionOne implements Extension {
-
- @Override
- public Map getFilters() {
- return Collections.EMPTY_MAP;
- }
-
- @Override
- public Map getTests() {
- return Collections.EMPTY_MAP;
- }
-
- @Override
- public Map getFunctions() {
- return Collections.EMPTY_MAP;
- }
-
- @Override
- public List getTokenParsers() {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- public List getBinaryOperators() {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- public List getUnaryOperators() {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- public Map getGlobalVariables() {
- return Collections.EMPTY_MAP;
- }
-
- @Override
- public List getNodeVisitors() {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- public List getAttributeResolver() {
- return Collections.EMPTY_LIST;
- }
-
-}
diff --git a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomExtensionTwo.java b/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomExtensionTwo.java
deleted file mode 100644
index 13a40386..00000000
--- a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/CustomExtensionTwo.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.pebble;
-
-import com.mitchellbosecke.pebble.attributes.AttributeResolver;
-import com.mitchellbosecke.pebble.extension.*;
-import com.mitchellbosecke.pebble.operator.BinaryOperator;
-import com.mitchellbosecke.pebble.operator.UnaryOperator;
-import com.mitchellbosecke.pebble.tokenParser.TokenParser;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-public class CustomExtensionTwo implements Extension {
-
- @Override
- public Map getFilters() {
- return Collections.EMPTY_MAP;
- }
-
- @Override
- public Map getTests() {
- return Collections.EMPTY_MAP;
- }
-
- @Override
- public Map getFunctions() {
- return Collections.EMPTY_MAP;
- }
-
- @Override
- public List getTokenParsers() {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- public List getBinaryOperators() {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- public List getUnaryOperators() {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- public Map getGlobalVariables() {
- return Collections.EMPTY_MAP;
- }
-
- @Override
- public List getNodeVisitors() {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- public List getAttributeResolver() {
- return Collections.EMPTY_LIST;
- }
-}
diff --git a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebbleConfigurationProducerTest.java b/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebbleConfigurationProducerTest.java
deleted file mode 100644
index 66be5462..00000000
--- a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebbleConfigurationProducerTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.pebble;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import java.util.Properties;
-
-import static org.junit.Assert.*;
-
-public class PebbleConfigurationProducerTest {
-
- PebbleConfigurationProducer pebbleConfigurationProducer;
-
- @Before
- public void setup() {
- pebbleConfigurationProducer = new PebbleConfigurationProducer();
- System.clearProperty(PebbleProperty.AUTO_ESCAPING.key());
- }
-
- @Test
- public void shouldReturnEmptyPropertiesForNonExistingPropertiesFile() {
- Properties pebbleConfiguration = pebbleConfigurationProducer.loadFromFile("unexisting.properties");
-
- assertNotNull(pebbleConfiguration);
- assertTrue(pebbleConfiguration.isEmpty());
- }
-
- @Test
- public void shouldLoadPebbleConfigurationPropertiesFromFile() {
- Properties pebbleConfiguration = pebbleConfigurationProducer.loadFromFile("pebble.properties");
-
- assertNotNull(pebbleConfiguration);
- assertEquals(pebbleConfiguration.getProperty("org.eclipse.krazo.ext.pebble.autoEscaping"), "true");
- }
-
- @Test
- public void shouldReturnPebbleConfiguration() {
- Properties pebbleConfiguration = pebbleConfigurationProducer.pebbleConfiguration();
-
- assertNotNull(pebbleConfiguration);
- assertEquals(pebbleConfiguration.getProperty("org.eclipse.krazo.ext.pebble.autoEscaping"), "true");
- }
-
- @Test
- public void systemPropertyShouldHaveHigherPriorityThanTheOneFromPropertyFile() {
- System.setProperty(PebbleProperty.AUTO_ESCAPING.key(), "false-override");
-
- Properties pebbleConfiguration = pebbleConfigurationProducer.pebbleConfiguration();
-
- assertNotNull(pebbleConfiguration);
- assertEquals(pebbleConfiguration.getProperty(PebbleProperty.AUTO_ESCAPING.key()), "false-override");
- }
-}
diff --git a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebbleEngineProducerTest.java b/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebbleEngineProducerTest.java
deleted file mode 100644
index bd287ab0..00000000
--- a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebbleEngineProducerTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018-2021 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.pebble;
-
-import com.mitchellbosecke.pebble.PebbleEngine;
-import com.mitchellbosecke.pebble.extension.escaper.EscapeFilter;
-import com.mitchellbosecke.pebble.loader.Servlet5Loader;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.util.Locale;
-import java.util.Properties;
-
-import static org.junit.Assert.*;
-
-
-public class PebbleEngineProducerTest {
-
- Properties properties;
- PebbleEngineProducer pebbleEngineProducer;
-
- @Before
- public void setup() {
- properties = new Properties();
- pebbleEngineProducer = new PebbleEngineProducer(properties, null);
- }
-
- @Test
- public void shouldCreateAnInstanceOfPebbleEngine() {
- assertNotNull(pebbleEngineProducer.pebbleEngine());
- }
-
- @Test
- public void shouldUseServletContextLoader() {
- assertTrue(pebbleEngineProducer.pebbleEngine().getLoader() instanceof Servlet5Loader);
- }
-
- @Test
- public void shouldSetCorrectLocale() {
- properties.put(PebbleProperty.DEFAULT_LOCALE.key(), "de");
-
- assertEquals(Locale.GERMAN, pebbleEngineProducer.pebbleEngine().getDefaultLocale());
- }
-
- @Test
- public void shouldCorrectlySetStrictVariables() {
- properties.put(PebbleProperty.STRICT_VARIABLES.key(), "true");
-
- assertTrue(pebbleEngineProducer.pebbleEngine().isStrictVariables());
-
- properties.put(PebbleProperty.STRICT_VARIABLES.key(), "false");
-
- assertFalse(pebbleEngineProducer.pebbleEngine().isStrictVariables());
- }
-
- @Test
- public void shouldCorrectlySetExecutorService() {
- properties.put(PebbleProperty.EXECUTOR_SERVICE.key(), CustomExecutorService.class.getCanonicalName());
-
- assertTrue(pebbleEngineProducer.pebbleEngine().getExecutorService() instanceof CustomExecutorService);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void shouldThrowExceptionWhileSettingExecutorService() {
- properties.put(PebbleProperty.EXECUTOR_SERVICE.key(), "org.dummy.DummyExecutorService");
-
- pebbleEngineProducer.pebbleEngine();
- }
-
- @Test
- public void shouldCorrectlySetExtensions() {
- properties.put(PebbleProperty.EXTENSION.key(), String.format("%s,%s", CustomExtensionOne.class.getCanonicalName(), CustomExtensionTwo.class.getCanonicalName()));
-
- pebbleEngineProducer.pebbleEngine();
-
- properties.put(PebbleProperty.EXTENSION.key(), String.format("%s , %s", CustomExtensionOne.class.getCanonicalName(), CustomExtensionTwo.class.getCanonicalName()));
-
- pebbleEngineProducer.pebbleEngine();
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void shouldThrowExceptionWhileSettingExtensions() {
- properties.put(PebbleProperty.EXTENSION.key(), String.format("%s-%s", CustomExtensionOne.class.getCanonicalName(), CustomExtensionTwo.class.getCanonicalName()));
-
- pebbleEngineProducer.pebbleEngine();
- }
-
- @Test
- public void shouldCorrectlySetEscapingStrategy() {
- properties.put(PebbleProperty.ESCAPING_STRATEGY.key(), CustomEscapingStrategy.class.getCanonicalName());
-
- PebbleEngine pebbleEngine = pebbleEngineProducer.pebbleEngine();
- EscapeFilter ef = (EscapeFilter) pebbleEngine.getExtensionRegistry().getFilter("escape");
-
- assertEquals(ef.getDefaultStrategy(), "userDefinedEscapingStrategy");
- }
-}
diff --git a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebblePropertyTest.java b/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebblePropertyTest.java
deleted file mode 100644
index 582a3784..00000000
--- a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebblePropertyTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.pebble;
-
-import org.junit.Test;
-
-import java.util.stream.Stream;
-
-import static org.junit.Assert.*;
-
-public class PebblePropertyTest {
-
- @Test
- public void propertyKeyShouldStartWithGroupPrefix() {
- final String groupPrefix = "org.eclipse.krazo.ext.pebble.";
-
- Stream.of(PebbleProperty.values()).forEach(property -> {
- assertTrue(property.key().startsWith(groupPrefix));
- });
- }
-
- @Test
- public void shouldResolvePebblePropertyFromStringKey() {
- Stream.of(PebbleProperty.values()).forEach(property -> {
- assertEquals(property, PebbleProperty.fromKey(property.key()));
- });
- }
-
- @Test
- public void shouldReturnSystemPropertyValueAsOptional() {
- System.setProperty(PebbleProperty.STRICT_VARIABLES.key(), "false");
-
- assertEquals("false", PebbleProperty.STRICT_VARIABLES.systemPropertyValue().get());
- assertFalse(PebbleProperty.NEW_LINE_TRIMMING.systemPropertyValue().isPresent());
- }
-}
diff --git a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebbleViewEngineTest.java b/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebbleViewEngineTest.java
deleted file mode 100644
index cd0a5a09..00000000
--- a/ext/pebble/src/test/java/org/eclipse/krazo/ext/pebble/PebbleViewEngineTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.pebble;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-public class PebbleViewEngineTest {
-
- @Test
- public void shouldSupportOnlyFilesWithExtensionPeb() {
- PebbleViewEngine engine = new PebbleViewEngine(null);
-
- assertTrue(engine.supports("view.peb"));
- assertFalse(engine.supports("view.txt"));
- }
-}
diff --git a/ext/pebble/src/test/resources/pebble.properties b/ext/pebble/src/test/resources/pebble.properties
deleted file mode 100644
index e1043ed3..00000000
--- a/ext/pebble/src/test/resources/pebble.properties
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.krazo.ext.pebble.autoEscaping=true
diff --git a/ext/pom.xml b/ext/pom.xml
deleted file mode 100644
index 659c9477..00000000
--- a/ext/pom.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
- 4.0.0
-
-
- org.eclipse.krazo
- krazo-parent
- 3.0.0-SNAPSHOT
-
-
- org.eclipse.krazo.ext
- krazo-ext-parent
- pom
- Eclipse Krazo Extensions Parent
-
-
- asciidoc
- freemarker
-
-
- jade
-
-
- mustache
- stringtemplate
- thymeleaf
- velocity
- pebble
- jinja2
-
-
-
-
-
- org.asciidoctor
- asciidoctorj
- 2.5.2
-
-
-
- org.freemarker
- freemarker
- 2.3.31
-
-
-
- de.neuland-bfi
- jade4j
- 1.3.2
-
-
-
- com.hubspot.jinjava
- jinjava
- 2.6.0
-
-
-
- com.github.spullara.mustache.java
- compiler
- 0.9.10
-
-
-
- io.pebbletemplates
- pebble
- 3.1.5
-
-
-
- org.antlr
- ST4
- 4.3.1
-
-
-
- org.thymeleaf
- thymeleaf
- 3.1.0.M1
-
-
-
- org.apache.velocity
- velocity-engine-core
- 2.3
- compile
-
-
-
-
-
-
- jakarta.platform
- jakarta.jakartaee-api
- provided
-
-
- jakarta.mvc
- jakarta.mvc-api
- provided
-
-
- org.eclipse.krazo
- krazo-core
- ${project.version}
- provided
-
-
-
diff --git a/ext/stringtemplate/pom.xml b/ext/stringtemplate/pom.xml
deleted file mode 100644
index 20e7d365..00000000
--- a/ext/stringtemplate/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
- 4.0.0
-
- org.eclipse.krazo.ext
- krazo-ext-parent
- 3.0.0-SNAPSHOT
-
-
- krazo-stringtemplate
- jar
- Eclipse Krazo StringTemplate Extension
-
-
-
- org.antlr
- ST4
-
-
-
diff --git a/ext/stringtemplate/src/main/java/org/eclipse/krazo/ext/stringtemplate/StringTemplateViewEngine.java b/ext/stringtemplate/src/main/java/org/eclipse/krazo/ext/stringtemplate/StringTemplateViewEngine.java
deleted file mode 100644
index 13efa53a..00000000
--- a/ext/stringtemplate/src/main/java/org/eclipse/krazo/ext/stringtemplate/StringTemplateViewEngine.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.stringtemplate;
-
-import org.eclipse.krazo.engine.ViewEngineBase;
-import org.stringtemplate.v4.*;
-
-import jakarta.annotation.Priority;
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import jakarta.mvc.engine.*;
-import jakarta.servlet.ServletContext;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.regex.Matcher;
-
-import static java.util.regex.Pattern.compile;
-
-/**
- * Class StringTemplateViewEngine.
- *
- * @author Rodrigo Turini
- */
-@ApplicationScoped
-@Priority(ViewEngine.PRIORITY_FRAMEWORK)
-public class StringTemplateViewEngine extends ViewEngineBase {
-
- @Inject
- private ServletContext servletContext;
-
- @Override
- public boolean supports(String view) {
- return view.endsWith(".st");
- }
-
- @Override
- public void processView(ViewEngineContext context) throws ViewEngineException {
- ST stringTemplate = getStringTemplate(resolveView(context));
- context.getModels().asMap().forEach((key, value) -> add(key, value, stringTemplate));
- Charset charset = resolveCharsetAndSetContentType(context);
- try(Writer writer = new OutputStreamWriter(context.getOutputStream(), charset)) {
- stringTemplate.write(new AutoIndentWriter(writer));
- stringTemplate.render();
- } catch (Exception e) {
- throw new ViewEngineException(e);
- }
- }
-
- private void add(String key, Object value, ST template) {
- if (template.getAttributes().containsKey(key)) template.add(key, value);
- }
-
- public ST getStringTemplate(String resolvedView) throws ViewEngineException {
- Matcher matcher = compile("(.+)/(.+)\\.st").matcher(resolvedView);
- if (matcher.find()) {
- String viewFolder = servletContext.getRealPath(matcher.group(1));
- String viewName = matcher.group(2);
- STGroup stGroup = new STGroupDir(viewFolder, '$', '$');
- stGroup.registerRenderer(String.class, new StringRenderer());
- ST template = stGroup.getInstanceOf(viewName);
- if (template != null) return template;
- }
- throw new ViewEngineException("Couldn't find view " + resolvedView);
- }
-}
diff --git a/ext/stringtemplate/src/main/resources/LICENSE.txt b/ext/stringtemplate/src/main/resources/LICENSE.txt
deleted file mode 100644
index d6456956..00000000
--- a/ext/stringtemplate/src/main/resources/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/ext/stringtemplate/src/main/resources/META-INF/beans.xml b/ext/stringtemplate/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index f90bbb57..00000000
--- a/ext/stringtemplate/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
diff --git a/ext/thymeleaf/pom.xml b/ext/thymeleaf/pom.xml
deleted file mode 100644
index 93473366..00000000
--- a/ext/thymeleaf/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
- 4.0.0
-
- org.eclipse.krazo.ext
- krazo-ext-parent
- 3.0.0-SNAPSHOT
-
- krazo-thymeleaf
- jar
- Eclipse Krazo Thymeleaf Extension
-
-
- org.thymeleaf
- thymeleaf
-
-
-
diff --git a/ext/thymeleaf/src/main/java/org/eclipse/krazo/ext/thymeleaf/CDIWebContext.java b/ext/thymeleaf/src/main/java/org/eclipse/krazo/ext/thymeleaf/CDIWebContext.java
deleted file mode 100644
index 7142a804..00000000
--- a/ext/thymeleaf/src/main/java/org/eclipse/krazo/ext/thymeleaf/CDIWebContext.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2014-2015 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2018, 2022 Eclipse Krazo committers and contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-package org.eclipse.krazo.ext.thymeleaf;
-
-import org.thymeleaf.context.IWebContext;
-import org.thymeleaf.context.LazyContextVariable;
-import org.thymeleaf.web.IWebExchange;
-
-import jakarta.enterprise.context.spi.CreationalContext;
-import jakarta.enterprise.inject.Any;
-import jakarta.enterprise.inject.spi.Bean;
-import jakarta.enterprise.inject.spi.BeanManager;
-import jakarta.enterprise.util.AnnotationLiteral;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * Thymeleaf context for resolving variables from the model or cdi context. In addition to the functions provided by
- * {@link org.thymeleaf.context.WebContext} this allows to resolve beans annotated with {@linkplain jakarta.inject.Named}
- * from the cdi context.
- *
- * Beans will be resolved in this order:
- *
- *
special variables (like "request")
- *
variables from the model
- *
named beans from the cdi context
- *
- *
- *
- * @author Gregor Tudan
- */
-class CDIWebContext implements IWebContext {
-
- private final IWebExchange exchange;
- private final Locale locale;
-
- private final BeanManager beanManager;
- private final Set cdiNamedBeans;
-
- /** keeps track of creational contexts, so beans can get disposed by calling {@link #close()} */
- private final Queue> contexts = new LinkedList<>();
-
- private final Map variables = new HashMap<>();
-
- CDIWebContext(BeanManager beanManager, IWebExchange exchange, Locale locale) {
- this.beanManager = beanManager;
- this.exchange = exchange;
- this.locale = locale;
- this.cdiNamedBeans = enumerateNamedBeans();
- }
-
- @SuppressWarnings("serial")
- private Set enumerateNamedBeans() {
- Set> beans = beanManager.getBeans(Object.class, new AnnotationLiteral() {
- });
- return beans.stream().map(Bean::getName).filter(Objects::nonNull).collect(Collectors.toSet());
- }
-
- @Override
- public Locale getLocale() {
- return locale;
- }
-
- @Override
- public boolean containsVariable(String name) {
- Objects.requireNonNull(name, "The variable name must not be null");
- if (variables.containsKey(name)) {
- return true;
- }
- return cdiNamedBeans.contains(name);
- }
-
- @Override
- public Set getVariableNames() {
- final Set variableNames = new HashSet<>(variables.keySet());
- variableNames.addAll(this.cdiNamedBeans);
- return variableNames;
- }
-
- @Override
- public Object getVariable(String name) {
- Objects.requireNonNull(name, "The variable name must not be null");
- if (variables.containsKey(name)) {
- return variables.get(name);
- } else if (cdiNamedBeans.contains(name)) {
- return getCdiBean(name);
- } else {
- return null;
- }
- }
-
- private Object getCdiBean(String name) {
- return new LazyContextVariable