diff --git a/src/fr/devinsy/statoolinfos/core/Category.java b/src/fr/devinsy/statoolinfos/core/Category.java index 3f5e09b..7791d97 100644 --- a/src/fr/devinsy/statoolinfos/core/Category.java +++ b/src/fr/devinsy/statoolinfos/core/Category.java @@ -27,7 +27,7 @@ import fr.devinsy.strings.StringList; */ public class Category { - public static final String DEFAULT_LOGO_PATH = "categories/default.png"; + public static final String DEFAULT_LOGO_PATH = "categories/default.svg"; private String name; private String description; @@ -68,9 +68,26 @@ public class Category return this.description; } + /** + * Gets the logo path. + * + * @return the logo path + */ public String getLogoPath() { - return this.logoPath; + String result; + + if (StringUtils.isBlank(this.logoPath)) + { + result = DEFAULT_LOGO_PATH; + } + else + { + result = this.logoPath; + } + + // + return result; } public String getName() @@ -141,7 +158,7 @@ public class Category } else { - this.logoPath = logoPath; + this.logoPath = "categories/" + logoPath; } } diff --git a/src/fr/devinsy/statoolinfos/core/Factory.java b/src/fr/devinsy/statoolinfos/core/Factory.java index 2797d98..e8e149f 100644 --- a/src/fr/devinsy/statoolinfos/core/Factory.java +++ b/src/fr/devinsy/statoolinfos/core/Factory.java @@ -70,7 +70,7 @@ public class Factory String name = properties.get(prefix + ".name"); String description = properties.get(prefix + ".description"); String softwares = properties.get(prefix + ".softwares"); - String logoPath = properties.get(prefix + ".logoPath"); + String logoPath = properties.get(prefix + ".logo"); StringList softwareList = new StringList(); if (StringUtils.isNotBlank(softwares)) diff --git a/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java b/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java index 15cb6de..7e59a5d 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java +++ b/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java @@ -21,6 +21,7 @@ package fr.devinsy.statoolinfos.htmlize; import java.io.File; import java.io.IOException; +import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -78,6 +79,31 @@ public class Htmlizer } } + /** + * Copy categories stuff. + * + * @param path + * the path + * @throws IOException + * Signals that an I/O exception has occurred. + */ + private static void copyCategoriesStuff(final String path, final File targetDirectory) throws IOException + { + if (StringUtils.isNotBlank(path)) + { + File source = new File(path); + File target = new File(targetDirectory, "categories"); + + for (File file : source.listFiles()) + { + if (file.isFile()) + { + FileUtils.copyFileToDirectory(file, target); + } + } + } + } + /** * Copy stuff. * @@ -189,7 +215,7 @@ public class Htmlizer // File categories = new File(targetDirectory, "categories"); categories.mkdirs(); - StatoolInfosUtils.copyRessource(source + "categories/default.png", categories); + StatoolInfosUtils.copyRessource(source + "categories/default.svg", categories); } } @@ -212,6 +238,7 @@ public class Htmlizer File htmlizeDirectory = HtmlizerContext.instance().getHtmlizeDirectory(); copyStuff(htmlizeDirectory); + copyCategoriesStuff(HtmlizerContext.instance().getConfiguration().get("conf.htmlize.categories.icons"), htmlizeDirectory); AboutPage.build(); FederationPage.build(); diff --git a/src/fr/devinsy/statoolinfos/htmlize/categories.xhtml b/src/fr/devinsy/statoolinfos/htmlize/categories.xhtml index f6e2a24..3f6ac17 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/categories.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/categories.xhtml @@ -31,7 +31,7 @@ - + n/a diff --git a/src/fr/devinsy/statoolinfos/htmlize/categoriesView.xhtml b/src/fr/devinsy/statoolinfos/htmlize/categoriesView.xhtml index bf77deb..d4c54dc 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/categoriesView.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/categoriesView.xhtml @@ -11,7 +11,7 @@ - + n/a diff --git a/src/fr/devinsy/statoolinfos/htmlize/category.xhtml b/src/fr/devinsy/statoolinfos/htmlize/category.xhtml index fd951c1..d2feb83 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/category.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/category.xhtml @@ -14,7 +14,7 @@
- +
n/a
diff --git a/src/fr/devinsy/statoolinfos/htmlize/socialNetworks.xhtml b/src/fr/devinsy/statoolinfos/htmlize/socialNetworks.xhtml index 7703b13..98a0059 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/socialNetworks.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/socialNetworks.xhtml @@ -68,12 +68,15 @@
diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/categories/default.png.txt b/src/fr/devinsy/statoolinfos/htmlize/stuff/categories/default.png.txt new file mode 100644 index 0000000..904988c --- /dev/null +++ b/src/fr/devinsy/statoolinfos/htmlize/stuff/categories/default.png.txt @@ -0,0 +1,4 @@ +Copyright : CC-BY-SA +Creator : GNOME project +Artist : GNOME project +Relation : https://commons.wikimedia.org/wiki/File:Gnome-folder-visiting.svg diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/categories/default.svg b/src/fr/devinsy/statoolinfos/htmlize/stuff/categories/default.svg new file mode 100644 index 0000000..8027dad --- /dev/null +++ b/src/fr/devinsy/statoolinfos/htmlize/stuff/categories/default.svg @@ -0,0 +1,210 @@ + + + + + + + image/svg+xml + + Folder Active + + + Jakub Steiner + + + 2005-02-01 + + http://jimmac.musichall.cz/ + + + folder + directory + storage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +