From eb73092c37233810c777342132a873f50b23f71c Mon Sep 17 00:00:00 2001 From: Jens Pelzetter Date: Wed, 16 Sep 2020 08:40:53 +0200 Subject: [PATCH] JavaDoc update --- .../libreccm/mvc/facelets/package-info.java | 11 +++++++++- .../mvc/freemarker/KrazoTemplateLoader.java | 16 ++++++-------- .../java/org/libreccm/mvc/package-info.java | 21 ++++++++++++++++++- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/ccm-core/src/main/java/org/libreccm/mvc/facelets/package-info.java b/ccm-core/src/main/java/org/libreccm/mvc/facelets/package-info.java index 335aff91a..04b4a3562 100644 --- a/ccm-core/src/main/java/org/libreccm/mvc/facelets/package-info.java +++ b/ccm-core/src/main/java/org/libreccm/mvc/facelets/package-info.java @@ -18,6 +18,15 @@ */ /** * Integration of the LibreCCM theme system with the Facelet ViewEngine of - * Eclipse Krazo. + * Eclipse Krazo. The integration allows it to load Facelets either from + * a theme using a {@link Themes} or from the default locations. To enable the + * integration the following snippet has to be added to the + * {@code faces-config.xml}: + *
+ *     <application>
+ *         &tl;resource-handler>org.libreccm.ui.CcmFaceletsResourceHandler</resource-handler>
+ *     </application>
+ * 
+ * */ package org.libreccm.mvc.facelets; diff --git a/ccm-core/src/main/java/org/libreccm/mvc/freemarker/KrazoTemplateLoader.java b/ccm-core/src/main/java/org/libreccm/mvc/freemarker/KrazoTemplateLoader.java index c11b975bf..6b31bbc11 100644 --- a/ccm-core/src/main/java/org/libreccm/mvc/freemarker/KrazoTemplateLoader.java +++ b/ccm-core/src/main/java/org/libreccm/mvc/freemarker/KrazoTemplateLoader.java @@ -28,21 +28,17 @@ import java.io.Reader; import javax.servlet.ServletContext; -/** - * - * @author Jens Pelzetter - */ /** * A copy of the {@link TemplateLoader} used by Krazo. * * The {@code TemplateLoader} used by Krazo is defined as inner class. This - * class provides the same behaviour as "real" class so that we can use it with - * Freemarker {@link MultiTemplateLoader}. + * class provides the same behaviour as this inner class so that we can use it + * with Freemarker's {@link MultiTemplateLoader}. * - * As extension this implementation of the {@code TemplateLoader} interface will - * not process template paths which start with {@code @themes/} or - * {@code /@themes/}. These path are processed by the templates loaders for the - * theming system. + * As extension to Krazo's implementation this implementation of the + * {@code TemplateLoader} interface will not process template paths which start + * with {@code @themes/} or {@code /@themes/}. These path are processed by the + * {@link ThemesTemplateLoader} for the theming system. * * @author Jens Pelzetter */ diff --git a/ccm-core/src/main/java/org/libreccm/mvc/package-info.java b/ccm-core/src/main/java/org/libreccm/mvc/package-info.java index 5d3b11aa2..f5b36a939 100644 --- a/ccm-core/src/main/java/org/libreccm/mvc/package-info.java +++ b/ccm-core/src/main/java/org/libreccm/mvc/package-info.java @@ -18,8 +18,27 @@ */ /** * The classes in this package integrate LibreCCM with Jakarta EE MVC and its - * reference implementation Eclipse Krazo. + * reference implementation Eclipse Krazo. + * + * And the the moment the ViewEngines for Facelets and Freemarker are supported. + * The integration allows it to load templates for these ViewEngines either from + * the default locations or from a theme. If the path of template starts with + * {@code @themes/} or {@code /@themes/} the integration will delegate loading of + * the template to {@link Themes} of the theme. The path must follow the following + * pattern: * + *
+ *     @themes/$themeName/$version/$pathToTemplate
+ * 
+ * + * Where {@code $themeName} is the name of the theme, {@code $version} is the + * version of the theme (either {@code live} or {@code draft} and + * {@code $pathToFile} is the path the template. + * + * If the path does not start with {@code @themes/} or {@code /@themes/} the + * template will be loaded from the default location(s) used by Jakarta EE + * MVC/Eclipse Krazo. + * * @see https://www.mvc-spec.org/ */ package org.libreccm.mvc;