From d50f05b5a428faaa76f3d94b7d8898a43a2999fe Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Wed, 4 Sep 2024 16:55:28 +0200 Subject: [PATCH] #219 merge content and template module --- cms-content/pom.xml | 18 +++++++ .../cms/content/DefaultContentRenderer.java | 10 ++-- .../AbstractCurrentNodeFunction.java | 2 +- .../template/functions/LinkFunction.java | 2 +- .../functions/hooks/HooksTemlateFunction.java | 2 +- .../functions/list/NodeListFunction.java | 4 +- .../list/NodeListFunctionBuilder.java | 4 +- .../navigation/NavigationFunction.java | 4 +- .../functions/query/QueryFunction.java | 4 +- .../shortcode/ShortCodeTemplateFunction.java | 2 +- .../functions/taxonomy/TaxonomyFunction.java | 2 +- .../cms/content/views/NodeResolver.java | 5 +- .../navigation/NavigationFunctionTest.java | 3 +- ...eeMarkerShortCodeTemplateFunctionTest.java | 3 +- .../PebbleShortCodeTemplateFunctionTest.java | 3 +- ...hymeleafShortCodeTemplateFunctionTest.java | 3 +- cms-template/pom.xml | 50 ------------------- pom.xml | 1 - 18 files changed, 46 insertions(+), 76 deletions(-) rename {cms-template/src/main/java/com/github/thmarx/cms => cms-content/src/main/java/com/github/thmarx/cms/content}/template/functions/AbstractCurrentNodeFunction.java (98%) rename {cms-template/src/main/java/com/github/thmarx/cms => cms-content/src/main/java/com/github/thmarx/cms/content}/template/functions/LinkFunction.java (95%) rename {cms-template/src/main/java/com/github/thmarx/cms => cms-content/src/main/java/com/github/thmarx/cms/content}/template/functions/hooks/HooksTemlateFunction.java (96%) rename {cms-template/src/main/java/com/github/thmarx/cms => cms-content/src/main/java/com/github/thmarx/cms/content}/template/functions/list/NodeListFunction.java (97%) rename {cms-template/src/main/java/com/github/thmarx/cms => cms-content/src/main/java/com/github/thmarx/cms/content}/template/functions/list/NodeListFunctionBuilder.java (97%) rename {cms-template/src/main/java/com/github/thmarx/cms => cms-content/src/main/java/com/github/thmarx/cms/content}/template/functions/navigation/NavigationFunction.java (97%) rename {cms-template/src/main/java/com/github/thmarx/cms => cms-content/src/main/java/com/github/thmarx/cms/content}/template/functions/query/QueryFunction.java (96%) rename {cms-template/src/main/java/com/github/thmarx/cms => cms-content/src/main/java/com/github/thmarx/cms/content}/template/functions/shortcode/ShortCodeTemplateFunction.java (94%) rename {cms-template/src/main/java/com/github/thmarx/cms => cms-content/src/main/java/com/github/thmarx/cms/content}/template/functions/taxonomy/TaxonomyFunction.java (97%) rename {cms-template/src/test/java/com/github/thmarx/cms/template/functions => cms-content/src/test/java/com/github/thmarx/cms/content/template}/navigation/NavigationFunctionTest.java (96%) rename {cms-template/src/test/java/com/github/thmarx/cms/template/functions => cms-content/src/test/java/com/github/thmarx/cms/content/template}/shortcode/FreeMarkerShortCodeTemplateFunctionTest.java (94%) rename {cms-template/src/test/java/com/github/thmarx/cms/template/functions => cms-content/src/test/java/com/github/thmarx/cms/content/template}/shortcode/PebbleShortCodeTemplateFunctionTest.java (94%) rename {cms-template/src/test/java/com/github/thmarx/cms/template/functions => cms-content/src/test/java/com/github/thmarx/cms/content/template}/shortcode/ThymeleafShortCodeTemplateFunctionTest.java (94%) delete mode 100644 cms-template/pom.xml diff --git a/cms-content/pom.xml b/cms-content/pom.xml index ca69e6a7..a2e04dff 100644 --- a/cms-content/pom.xml +++ b/cms-content/pom.xml @@ -40,5 +40,23 @@ org.jsoup jsoup + + org.freemarker + freemarker + 2.3.33 + test + + + org.thymeleaf + thymeleaf + 3.1.2.RELEASE + test + + + io.pebbletemplates + pebble + 3.2.2 + test + \ No newline at end of file diff --git a/cms-content/src/main/java/com/github/thmarx/cms/content/DefaultContentRenderer.java b/cms-content/src/main/java/com/github/thmarx/cms/content/DefaultContentRenderer.java index c941df6c..ec6634f9 100644 --- a/cms-content/src/main/java/com/github/thmarx/cms/content/DefaultContentRenderer.java +++ b/cms-content/src/main/java/com/github/thmarx/cms/content/DefaultContentRenderer.java @@ -49,11 +49,11 @@ import com.github.thmarx.cms.extensions.hooks.DBHooks; import com.github.thmarx.cms.extensions.hooks.TemplateHooks; import com.github.thmarx.cms.extensions.request.RequestExtensions; -import com.github.thmarx.cms.template.functions.LinkFunction; -import com.github.thmarx.cms.template.functions.list.NodeListFunctionBuilder; -import com.github.thmarx.cms.template.functions.navigation.NavigationFunction; -import com.github.thmarx.cms.template.functions.query.QueryFunction; -import com.github.thmarx.cms.template.functions.taxonomy.TaxonomyFunction; +import com.github.thmarx.cms.content.template.functions.LinkFunction; +import com.github.thmarx.cms.content.template.functions.list.NodeListFunctionBuilder; +import com.github.thmarx.cms.content.template.functions.navigation.NavigationFunction; +import com.github.thmarx.cms.content.template.functions.query.QueryFunction; +import com.github.thmarx.cms.content.template.functions.taxonomy.TaxonomyFunction; import com.github.thmarx.modules.api.ModuleManager; import java.io.IOException; import java.util.ArrayList; diff --git a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/AbstractCurrentNodeFunction.java b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/AbstractCurrentNodeFunction.java similarity index 98% rename from cms-template/src/main/java/com/github/thmarx/cms/template/functions/AbstractCurrentNodeFunction.java rename to cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/AbstractCurrentNodeFunction.java index a082b65a..2abf6347 100644 --- a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/AbstractCurrentNodeFunction.java +++ b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/AbstractCurrentNodeFunction.java @@ -1,4 +1,4 @@ -package com.github.thmarx.cms.template.functions; +package com.github.thmarx.cms.content.template.functions; /*- * #%L diff --git a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/LinkFunction.java b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/LinkFunction.java similarity index 95% rename from cms-template/src/main/java/com/github/thmarx/cms/template/functions/LinkFunction.java rename to cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/LinkFunction.java index a4d3a3b6..d52bd6a5 100644 --- a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/LinkFunction.java +++ b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/LinkFunction.java @@ -1,4 +1,4 @@ -package com.github.thmarx.cms.template.functions; +package com.github.thmarx.cms.content.template.functions; /*- * #%L diff --git a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/hooks/HooksTemlateFunction.java b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/hooks/HooksTemlateFunction.java similarity index 96% rename from cms-template/src/main/java/com/github/thmarx/cms/template/functions/hooks/HooksTemlateFunction.java rename to cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/hooks/HooksTemlateFunction.java index 98eb2273..e7831eb0 100644 --- a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/hooks/HooksTemlateFunction.java +++ b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/hooks/HooksTemlateFunction.java @@ -1,4 +1,4 @@ -package com.github.thmarx.cms.template.functions.hooks; +package com.github.thmarx.cms.content.template.functions.hooks; /*- * #%L diff --git a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/list/NodeListFunction.java b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/list/NodeListFunction.java similarity index 97% rename from cms-template/src/main/java/com/github/thmarx/cms/template/functions/list/NodeListFunction.java rename to cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/list/NodeListFunction.java index 8121deb4..20242c40 100644 --- a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/list/NodeListFunction.java +++ b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/list/NodeListFunction.java @@ -1,4 +1,4 @@ -package com.github.thmarx.cms.template.functions.list; +package com.github.thmarx.cms.content.template.functions.list; /*- * #%L @@ -32,7 +32,7 @@ import com.github.thmarx.cms.api.feature.features.MarkdownRendererFeature; import com.github.thmarx.cms.api.model.ListNode; import com.github.thmarx.cms.api.request.RequestContext; -import com.github.thmarx.cms.template.functions.AbstractCurrentNodeFunction; +import com.github.thmarx.cms.content.template.functions.AbstractCurrentNodeFunction; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; diff --git a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/list/NodeListFunctionBuilder.java b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/list/NodeListFunctionBuilder.java similarity index 97% rename from cms-template/src/main/java/com/github/thmarx/cms/template/functions/list/NodeListFunctionBuilder.java rename to cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/list/NodeListFunctionBuilder.java index 416ec5e8..f174e635 100644 --- a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/list/NodeListFunctionBuilder.java +++ b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/list/NodeListFunctionBuilder.java @@ -1,4 +1,4 @@ -package com.github.thmarx.cms.template.functions.list; +package com.github.thmarx.cms.content.template.functions.list; /*- * #%L @@ -33,7 +33,7 @@ import com.github.thmarx.cms.api.model.ListNode; import com.github.thmarx.cms.api.request.RequestContext; import com.github.thmarx.cms.api.utils.NodeUtil; -import com.github.thmarx.cms.template.functions.AbstractCurrentNodeFunction; +import com.github.thmarx.cms.content.template.functions.AbstractCurrentNodeFunction; import java.util.Comparator; import java.util.Objects; import java.util.function.Function; diff --git a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/navigation/NavigationFunction.java b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/navigation/NavigationFunction.java similarity index 97% rename from cms-template/src/main/java/com/github/thmarx/cms/template/functions/navigation/NavigationFunction.java rename to cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/navigation/NavigationFunction.java index 03e6475c..603c3142 100644 --- a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/navigation/NavigationFunction.java +++ b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/navigation/NavigationFunction.java @@ -1,4 +1,4 @@ -package com.github.thmarx.cms.template.functions.navigation; +package com.github.thmarx.cms.content.template.functions.navigation; /*- * #%L @@ -35,7 +35,7 @@ import com.github.thmarx.cms.api.request.RequestContext; import com.github.thmarx.cms.api.utils.NodeUtil; import com.github.thmarx.cms.api.utils.PathUtil; -import com.github.thmarx.cms.template.functions.AbstractCurrentNodeFunction; +import com.github.thmarx.cms.content.template.functions.AbstractCurrentNodeFunction; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/query/QueryFunction.java b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/query/QueryFunction.java similarity index 96% rename from cms-template/src/main/java/com/github/thmarx/cms/template/functions/query/QueryFunction.java rename to cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/query/QueryFunction.java index c5d313de..5eaef6cd 100644 --- a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/query/QueryFunction.java +++ b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/query/QueryFunction.java @@ -1,4 +1,4 @@ -package com.github.thmarx.cms.template.functions.query; +package com.github.thmarx.cms.content.template.functions.query; /*- * #%L @@ -31,7 +31,7 @@ import com.github.thmarx.cms.api.model.ListNode; import com.github.thmarx.cms.api.request.RequestContext; import com.github.thmarx.cms.filesystem.metadata.query.ExtendableQuery; -import com.github.thmarx.cms.template.functions.AbstractCurrentNodeFunction; +import com.github.thmarx.cms.content.template.functions.AbstractCurrentNodeFunction; import com.google.common.base.Strings; import java.util.HashMap; import java.util.Map; diff --git a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/shortcode/ShortCodeTemplateFunction.java b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/shortcode/ShortCodeTemplateFunction.java similarity index 94% rename from cms-template/src/main/java/com/github/thmarx/cms/template/functions/shortcode/ShortCodeTemplateFunction.java rename to cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/shortcode/ShortCodeTemplateFunction.java index 80526ca3..74b62940 100644 --- a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/shortcode/ShortCodeTemplateFunction.java +++ b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/shortcode/ShortCodeTemplateFunction.java @@ -1,4 +1,4 @@ -package com.github.thmarx.cms.template.functions.shortcode; +package com.github.thmarx.cms.content.template.functions.shortcode; /*- * #%L diff --git a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/taxonomy/TaxonomyFunction.java b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/taxonomy/TaxonomyFunction.java similarity index 97% rename from cms-template/src/main/java/com/github/thmarx/cms/template/functions/taxonomy/TaxonomyFunction.java rename to cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/taxonomy/TaxonomyFunction.java index a2a3bf7a..ffc5c0d3 100644 --- a/cms-template/src/main/java/com/github/thmarx/cms/template/functions/taxonomy/TaxonomyFunction.java +++ b/cms-content/src/main/java/com/github/thmarx/cms/content/template/functions/taxonomy/TaxonomyFunction.java @@ -1,4 +1,4 @@ -package com.github.thmarx.cms.template.functions.taxonomy; +package com.github.thmarx.cms.content.template.functions.taxonomy; /*- * #%L diff --git a/cms-content/src/main/java/com/github/thmarx/cms/content/views/NodeResolver.java b/cms-content/src/main/java/com/github/thmarx/cms/content/views/NodeResolver.java index 2766a4f5..89f9a134 100644 --- a/cms-content/src/main/java/com/github/thmarx/cms/content/views/NodeResolver.java +++ b/cms-content/src/main/java/com/github/thmarx/cms/content/views/NodeResolver.java @@ -31,10 +31,9 @@ import com.github.thmarx.cms.api.model.ListNode; import com.github.thmarx.cms.api.request.RequestContext; import com.github.thmarx.cms.content.views.model.View; -import com.github.thmarx.cms.template.functions.list.NodeListFunctionBuilder; -import com.github.thmarx.cms.template.functions.query.QueryFunction; +import com.github.thmarx.cms.content.template.functions.list.NodeListFunctionBuilder; +import com.github.thmarx.cms.content.template.functions.query.QueryFunction; import com.google.common.base.Strings; -import java.nio.file.Path; import java.util.List; import java.util.Map; import lombok.RequiredArgsConstructor; diff --git a/cms-template/src/test/java/com/github/thmarx/cms/template/functions/navigation/NavigationFunctionTest.java b/cms-content/src/test/java/com/github/thmarx/cms/content/template/navigation/NavigationFunctionTest.java similarity index 96% rename from cms-template/src/test/java/com/github/thmarx/cms/template/functions/navigation/NavigationFunctionTest.java rename to cms-content/src/test/java/com/github/thmarx/cms/content/template/navigation/NavigationFunctionTest.java index 2b5fa908..90b6f037 100644 --- a/cms-template/src/test/java/com/github/thmarx/cms/template/functions/navigation/NavigationFunctionTest.java +++ b/cms-content/src/test/java/com/github/thmarx/cms/content/template/navigation/NavigationFunctionTest.java @@ -1,4 +1,4 @@ -package com.github.thmarx.cms.template.functions.navigation; +package com.github.thmarx.cms.content.template.navigation; /*- * #%L @@ -22,6 +22,7 @@ * #L% */ +import com.github.thmarx.cms.content.template.functions.navigation.NavigationFunction; import com.github.thmarx.cms.api.content.ContentParser; import com.github.thmarx.cms.api.db.Content; import com.github.thmarx.cms.api.db.DB; diff --git a/cms-template/src/test/java/com/github/thmarx/cms/template/functions/shortcode/FreeMarkerShortCodeTemplateFunctionTest.java b/cms-content/src/test/java/com/github/thmarx/cms/content/template/shortcode/FreeMarkerShortCodeTemplateFunctionTest.java similarity index 94% rename from cms-template/src/test/java/com/github/thmarx/cms/template/functions/shortcode/FreeMarkerShortCodeTemplateFunctionTest.java rename to cms-content/src/test/java/com/github/thmarx/cms/content/template/shortcode/FreeMarkerShortCodeTemplateFunctionTest.java index c3ba3373..44df21c1 100644 --- a/cms-template/src/test/java/com/github/thmarx/cms/template/functions/shortcode/FreeMarkerShortCodeTemplateFunctionTest.java +++ b/cms-content/src/test/java/com/github/thmarx/cms/content/template/shortcode/FreeMarkerShortCodeTemplateFunctionTest.java @@ -1,4 +1,4 @@ -package com.github.thmarx.cms.template.functions.shortcode; +package com.github.thmarx.cms.content.template.shortcode; /*- * #%L @@ -22,6 +22,7 @@ * #L% */ +import com.github.thmarx.cms.content.template.functions.shortcode.ShortCodeTemplateFunction; import com.github.thmarx.cms.content.shortcodes.ShortCodes; import freemarker.template.Configuration; import freemarker.template.Template; diff --git a/cms-template/src/test/java/com/github/thmarx/cms/template/functions/shortcode/PebbleShortCodeTemplateFunctionTest.java b/cms-content/src/test/java/com/github/thmarx/cms/content/template/shortcode/PebbleShortCodeTemplateFunctionTest.java similarity index 94% rename from cms-template/src/test/java/com/github/thmarx/cms/template/functions/shortcode/PebbleShortCodeTemplateFunctionTest.java rename to cms-content/src/test/java/com/github/thmarx/cms/content/template/shortcode/PebbleShortCodeTemplateFunctionTest.java index de6f3980..ac6375e0 100644 --- a/cms-template/src/test/java/com/github/thmarx/cms/template/functions/shortcode/PebbleShortCodeTemplateFunctionTest.java +++ b/cms-content/src/test/java/com/github/thmarx/cms/content/template/shortcode/PebbleShortCodeTemplateFunctionTest.java @@ -1,4 +1,4 @@ -package com.github.thmarx.cms.template.functions.shortcode; +package com.github.thmarx.cms.content.template.shortcode; /*- * #%L @@ -22,6 +22,7 @@ * #L% */ +import com.github.thmarx.cms.content.template.functions.shortcode.ShortCodeTemplateFunction; import com.github.thmarx.cms.content.shortcodes.ShortCodes; import io.pebbletemplates.pebble.PebbleEngine; import io.pebbletemplates.pebble.loader.StringLoader; diff --git a/cms-template/src/test/java/com/github/thmarx/cms/template/functions/shortcode/ThymeleafShortCodeTemplateFunctionTest.java b/cms-content/src/test/java/com/github/thmarx/cms/content/template/shortcode/ThymeleafShortCodeTemplateFunctionTest.java similarity index 94% rename from cms-template/src/test/java/com/github/thmarx/cms/template/functions/shortcode/ThymeleafShortCodeTemplateFunctionTest.java rename to cms-content/src/test/java/com/github/thmarx/cms/content/template/shortcode/ThymeleafShortCodeTemplateFunctionTest.java index c5c1e7de..9c91ee5f 100644 --- a/cms-template/src/test/java/com/github/thmarx/cms/template/functions/shortcode/ThymeleafShortCodeTemplateFunctionTest.java +++ b/cms-content/src/test/java/com/github/thmarx/cms/content/template/shortcode/ThymeleafShortCodeTemplateFunctionTest.java @@ -1,4 +1,4 @@ -package com.github.thmarx.cms.template.functions.shortcode; +package com.github.thmarx.cms.content.template.shortcode; /*- * #%L @@ -22,6 +22,7 @@ * #L% */ +import com.github.thmarx.cms.content.template.functions.shortcode.ShortCodeTemplateFunction; import com.github.thmarx.cms.content.shortcodes.ShortCodes; import java.util.Map; import org.assertj.core.api.Assertions; diff --git a/cms-template/pom.xml b/cms-template/pom.xml deleted file mode 100644 index 8198b52f..00000000 --- a/cms-template/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - 4.0.0 - - com.github.thmarx.cms - cms-parent - 5.3.0 - - cms-template - jar - - - - com.github.thmarx.cms - cms-api - - - com.github.thmarx.cms - cms-content - - - com.github.thmarx.cms - cms-filesystem - - - org.projectlombok - lombok - provided - - - - org.freemarker - freemarker - 2.3.33 - test - - - org.thymeleaf - thymeleaf - 3.1.2.RELEASE - test - - - io.pebbletemplates - pebble - 3.2.2 - test - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 44dcd4a6..47b8cf66 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,6 @@ cms-media cms-git cms-sandbox - cms-template cms-content cms-extensions cms-auth