X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.ui.rap%2Fsrc%2Forg%2Fargeo%2Fcms%2Fweb%2FCmsWebApp.java;h=25b30c9b3c6ef6d0ec10674668eb7126640775f6;hb=6a44d45d5e60b6187ddca5fa280f468d5763c2ad;hp=ca26c5830c7a0ad4bbf4a08928aa45a06bc53848;hpb=3eedd4220bb9f9ac91be4f0d091312f5a2e1e325;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms.ui.rap/src/org/argeo/cms/web/CmsWebApp.java b/org.argeo.cms.ui.rap/src/org/argeo/cms/web/CmsWebApp.java index ca26c5830..25b30c9b3 100644 --- a/org.argeo.cms.ui.rap/src/org/argeo/cms/web/CmsWebApp.java +++ b/org.argeo.cms.ui.rap/src/org/argeo/cms/web/CmsWebApp.java @@ -39,7 +39,6 @@ public class CmsWebApp implements ApplicationConfiguration, ExceptionHandler, Cm contextName = properties.get(CONTEXT_NAME); if (cmsApp != null) themingUpdated(); -// registerIfAllThemesAvailable(); } public void destroy(BundleContext bundleContext, Map properties) { @@ -54,12 +53,10 @@ public class CmsWebApp implements ApplicationConfiguration, ExceptionHandler, Cm if (theme != null) WebThemeUtils.apply(application, theme); } -// for (CmsTheme theme : themes.values()) -// WebThemeUtils.apply(application, theme); Map properties = new HashMap<>(); addEntryPoints(application, properties); - + application.setExceptionHandler(this); } @Override @@ -83,8 +80,6 @@ public class CmsWebApp implements ApplicationConfiguration, ExceptionHandler, Cm properties.put(WebClient.HEAD_HTML, theme.getHtmlHeaders()); } else { properties.put(WebClient.THEME_ID, RWT.DEFAULT_THEME_ID); -// if (themeId != null) -// log.warn("Theme id " + themeId + " was specified but it was not found, using default RWT theme."); } String entryPointName = !uiName.equals("") ? "/" + uiName : "/"; application.addEntryPoint(entryPointName, () -> { @@ -99,34 +94,17 @@ public class CmsWebApp implements ApplicationConfiguration, ExceptionHandler, Cm log.debug("Published CMS web app /" + (contextName != null ? contextName : "")); } -// private void registerIfAllThemesAvailable() { -// boolean themeMissing = false; -// uiNames: for (String uiName : cmsApp.getUiNames()) { -// String themeId = cmsApp.getThemeId(uiName); -// if (RWT.DEFAULT_THEME_ID.equals(themeId)) -// continue uiNames; -// if (!themes.containsKey(themeId)) { -// themeMissing = true; -// break uiNames; -// } -// } -// if (!themeMissing) { -// Dictionary regProps = LangUtils.dict(CONTEXT_NAME, contextName); -// if (bundleContext != null) { -// rwtAppReg = bundleContext.registerService(ApplicationConfiguration.class, this, regProps); -// log.info("Published CMS web app /" + (contextName != null ? contextName : "")); -// } -// } -// } - CmsApp getCmsApp() { return cmsApp; } + BundleContext getBundleContext() { + return bundleContext; + } + public void setCmsApp(CmsApp cmsApp, Map properties) { this.cmsApp = cmsApp; this.cmsApp.addCmsAppListener(this); -// registerIfAllThemesAvailable(); } public void unsetCmsApp(CmsApp cmsApp, Map properties) {