From 00d799dd5e453a3d73d7c74b1254d62ee1085aef Mon Sep 17 00:00:00 2001 From: jensp Date: Wed, 22 Nov 2017 11:21:15 +0000 Subject: [PATCH] CCM NG: - Some minor changes for theming - Very basic template for static default theme, will be used for first tests git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5131 8810af33-2d31-482b-a856-94f89814c4df --- .../libreccm/theming/StaticThemeProvider.java | 6 ----- .../theming/manifest/ThemeManifest.java | 19 ++++++++++++++ .../resources/themes/ccm/category-page.xsl | 25 +++++++++++++++++++ 3 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 ccm-core/src/main/resources/themes/ccm/category-page.xsl diff --git a/ccm-core/src/main/java/org/libreccm/theming/StaticThemeProvider.java b/ccm-core/src/main/java/org/libreccm/theming/StaticThemeProvider.java index ff47d2594..53842507a 100644 --- a/ccm-core/src/main/java/org/libreccm/theming/StaticThemeProvider.java +++ b/ccm-core/src/main/java/org/libreccm/theming/StaticThemeProvider.java @@ -27,23 +27,17 @@ import org.reflections.Reflections; import org.reflections.scanners.ResourcesScanner; import org.reflections.util.ClasspathHelper; import org.reflections.util.ConfigurationBuilder; -import org.reflections.util.FilterBuilder; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.net.URISyntaxException; import java.net.URL; import java.util.ArrayList; import java.util.Collections; -import java.util.Enumeration; import java.util.List; import java.util.Objects; import java.util.Optional; import java.util.Set; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; import java.util.regex.Pattern; import java.util.stream.Collectors; diff --git a/ccm-core/src/main/java/org/libreccm/theming/manifest/ThemeManifest.java b/ccm-core/src/main/java/org/libreccm/theming/manifest/ThemeManifest.java index 9cea077ef..76133ed7e 100644 --- a/ccm-core/src/main/java/org/libreccm/theming/manifest/ThemeManifest.java +++ b/ccm-core/src/main/java/org/libreccm/theming/manifest/ThemeManifest.java @@ -60,6 +60,9 @@ public class ThemeManifest implements Serializable { @XmlElement(name = "type", namespace = THEMES_XML_NS) private String type; + @XmlElement(name = "master-theme", namespace = THEMES_XML_NS) + private String masterTheme; + /** * The (localised) title of the theme. */ @@ -105,6 +108,14 @@ public class ThemeManifest implements Serializable { this.type = type; } + public String getMasterTheme() { + return masterTheme; + } + + public void setMasterTheme(final String masterTheme) { + this.masterTheme = masterTheme; + } + public LocalizedString getTitle() { return title; } @@ -150,6 +161,7 @@ public class ThemeManifest implements Serializable { int hash = 7; hash = 83 * hash + Objects.hashCode(name); hash = 83 * hash + Objects.hashCode(type); + hash = 83 * hash + Objects.hashCode(masterTheme); hash = 83 * hash + Objects.hashCode(title); hash = 83 * hash + Objects.hashCode(description); hash = 83 * hash + Objects.hashCode(templates); @@ -178,6 +190,9 @@ public class ThemeManifest implements Serializable { if (!Objects.equals(type, other.getType())) { return false; } + if (!Objects.equals(masterTheme, other.getMasterTheme())) { + return false; + } if (!Objects.equals(title, other.getTitle())) { return false; } @@ -203,6 +218,8 @@ public class ThemeManifest implements Serializable { return String.format("%s{ " + "name = \"%s\", " + + "type = \"%s\", " + + "masterTheme = \"%s\", " + "title = \"%s\", " + "description = \"%s\", " + "templates = %s, " @@ -210,6 +227,8 @@ public class ThemeManifest implements Serializable { + " }", super.toString(), name, + type, + masterTheme, Objects.toString(title), Objects.toString(description), Objects.toString(templates), diff --git a/ccm-core/src/main/resources/themes/ccm/category-page.xsl b/ccm-core/src/main/resources/themes/ccm/category-page.xsl new file mode 100644 index 000000000..2f4482250 --- /dev/null +++ b/ccm-core/src/main/resources/themes/ccm/category-page.xsl @@ -0,0 +1,25 @@ + + + + + + + + Category page + + + + + + + + + +

+ +

+ +
+ +