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
parent
c0352bbb43
commit
00d799dd5e
|
|
@ -27,23 +27,17 @@ import org.reflections.Reflections;
|
||||||
import org.reflections.scanners.ResourcesScanner;
|
import org.reflections.scanners.ResourcesScanner;
|
||||||
import org.reflections.util.ClasspathHelper;
|
import org.reflections.util.ClasspathHelper;
|
||||||
import org.reflections.util.ConfigurationBuilder;
|
import org.reflections.util.ConfigurationBuilder;
|
||||||
import org.reflections.util.FilterBuilder;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.URISyntaxException;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Enumeration;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.jar.JarEntry;
|
|
||||||
import java.util.jar.JarFile;
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,9 @@ public class ThemeManifest implements Serializable {
|
||||||
@XmlElement(name = "type", namespace = THEMES_XML_NS)
|
@XmlElement(name = "type", namespace = THEMES_XML_NS)
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
@XmlElement(name = "master-theme", namespace = THEMES_XML_NS)
|
||||||
|
private String masterTheme;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The (localised) title of the theme.
|
* The (localised) title of the theme.
|
||||||
*/
|
*/
|
||||||
|
|
@ -105,6 +108,14 @@ public class ThemeManifest implements Serializable {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMasterTheme() {
|
||||||
|
return masterTheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMasterTheme(final String masterTheme) {
|
||||||
|
this.masterTheme = masterTheme;
|
||||||
|
}
|
||||||
|
|
||||||
public LocalizedString getTitle() {
|
public LocalizedString getTitle() {
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
@ -150,6 +161,7 @@ public class ThemeManifest implements Serializable {
|
||||||
int hash = 7;
|
int hash = 7;
|
||||||
hash = 83 * hash + Objects.hashCode(name);
|
hash = 83 * hash + Objects.hashCode(name);
|
||||||
hash = 83 * hash + Objects.hashCode(type);
|
hash = 83 * hash + Objects.hashCode(type);
|
||||||
|
hash = 83 * hash + Objects.hashCode(masterTheme);
|
||||||
hash = 83 * hash + Objects.hashCode(title);
|
hash = 83 * hash + Objects.hashCode(title);
|
||||||
hash = 83 * hash + Objects.hashCode(description);
|
hash = 83 * hash + Objects.hashCode(description);
|
||||||
hash = 83 * hash + Objects.hashCode(templates);
|
hash = 83 * hash + Objects.hashCode(templates);
|
||||||
|
|
@ -178,6 +190,9 @@ public class ThemeManifest implements Serializable {
|
||||||
if (!Objects.equals(type, other.getType())) {
|
if (!Objects.equals(type, other.getType())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!Objects.equals(masterTheme, other.getMasterTheme())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!Objects.equals(title, other.getTitle())) {
|
if (!Objects.equals(title, other.getTitle())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -203,6 +218,8 @@ public class ThemeManifest implements Serializable {
|
||||||
|
|
||||||
return String.format("%s{ "
|
return String.format("%s{ "
|
||||||
+ "name = \"%s\", "
|
+ "name = \"%s\", "
|
||||||
|
+ "type = \"%s\", "
|
||||||
|
+ "masterTheme = \"%s\", "
|
||||||
+ "title = \"%s\", "
|
+ "title = \"%s\", "
|
||||||
+ "description = \"%s\", "
|
+ "description = \"%s\", "
|
||||||
+ "templates = %s, "
|
+ "templates = %s, "
|
||||||
|
|
@ -210,6 +227,8 @@ public class ThemeManifest implements Serializable {
|
||||||
+ " }",
|
+ " }",
|
||||||
super.toString(),
|
super.toString(),
|
||||||
name,
|
name,
|
||||||
|
type,
|
||||||
|
masterTheme,
|
||||||
Objects.toString(title),
|
Objects.toString(title),
|
||||||
Objects.toString(description),
|
Objects.toString(description),
|
||||||
Objects.toString(templates),
|
Objects.toString(templates),
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:ccm="http://xmlns.libreccm.org">
|
||||||
|
|
||||||
|
<xsl:template match="ccm:categoryPage">
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Category page</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<xsl:apply-template select="ccm:greetingItem" />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="ccm:greetingItem">
|
||||||
|
|
||||||
|
<h1>
|
||||||
|
<xsl:value-of select="./ccm:title" />
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
||||||
Loading…
Reference in New Issue