// if (themeId != null)
// log.warn("Theme id " + themeId + " was specified but it was not found, using default RWT theme.");
}
- application.addEntryPoint("/" + uiName, () -> {
+ String entryPointName = !uiName.equals("") ? "/" + uiName : "/";
+ application.addEntryPoint(entryPointName, () -> {
CmsWebEntryPoint entryPoint = new CmsWebEntryPoint(this, uiName);
entryPoint.setEventAdmin(eventAdmin);
return entryPoint;
}, properties);
if (log.isDebugEnabled())
- log.info("Added web entry point /" + (contextName != null ? contextName : "") + "/" + uiName);
+ log.info("Added web entry point " + (contextName != null ? "/" + contextName : "") + entryPointName);
}
- log.debug("Published CMS web app /" + (contextName != null ? contextName : ""));
+ if (log.isDebugEnabled())
+ log.debug("Published CMS web app /" + (contextName != null ? contextName : ""));
}
// private void registerIfAllThemesAvailable() {
Set<String> addCss(Bundle themeBundle, String path) {
Set<String> paths = new TreeSet<>();
- Enumeration<URL> themeResources = themeBundle.findEntries(path, "*.css", true);
- if (themeResources == null)
- return paths;
- while (themeResources.hasMoreElements()) {
- String resource = themeResources.nextElement().getPath();
- // remove first '/' so that RWT registers it
- resource = resource.substring(1);
- if (!resource.endsWith("/")) {
- paths.add(resource);
- }
- }
// common CSS
Enumeration<URL> commonResources = themeBundle.findEntries(styleCssPath, "*.css", true);
- if (commonResources == null)
- return paths;
- while (commonResources.hasMoreElements()) {
- String resource = commonResources.nextElement().getPath();
- // remove first '/' so that RWT registers it
- resource = resource.substring(1);
- if (!resource.endsWith("/")) {
- paths.add(resource);
+ if (commonResources != null) {
+ while (commonResources.hasMoreElements()) {
+ String resource = commonResources.nextElement().getPath();
+ // remove first '/' so that RWT registers it
+ resource = resource.substring(1);
+ if (!resource.endsWith("/")) {
+ paths.add(resource);
+ }
+ }
+ }
+
+ // specific CSS
+ Enumeration<URL> themeResources = themeBundle.findEntries(path, "*.css", true);
+ if (themeResources != null) {
+ while (themeResources.hasMoreElements()) {
+ String resource = themeResources.nextElement().getPath();
+ // remove first '/' so that RWT registers it
+ resource = resource.substring(1);
+ if (!resource.endsWith("/")) {
+ paths.add(resource);
+ }
}
}
return paths;
return themeBundle;
}
+ @Override
+ public int hashCode() {
+ return themeId.hashCode();
+ }
+
+ @Override
+ public String toString() {
+ return "Bundle CMS Theme " + themeId;
+ }
+
}