Move theme constants to Argeo Commons.
authorMathieu Baudier <mbaudier@argeo.org>
Sun, 27 Sep 2020 10:46:29 +0000 (12:46 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Sun, 27 Sep 2020 10:46:29 +0000 (12:46 +0200)
org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/AppDeployer.java
org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/ArgeoRapApp.java

index c1588119efd1a8a8ef178c8c94f5e55eec59ac1c..bb3248838fe71b58baf27703eaa592133f62571a 100644 (file)
@@ -19,9 +19,6 @@ import org.osgi.service.cm.ManagedServiceFactory;
  * Managed service factory deploying Argeo RAP app based on OSGi configurations.
  */
 public class AppDeployer implements ManagedServiceFactory {
-       public final static String CMS_THEME_BUNDLE_PROPERTY = "argeo.cms.theme.bundle";
-       public final static String DEFAULT_CMS_THEME_BUNDLE = "org.argeo.theme.argeo2";
-
        private final static Log log = LogFactory.getLog(AppDeployer.class);
        private BundleContext bundleContext;
 
@@ -49,11 +46,11 @@ public class AppDeployer implements ManagedServiceFactory {
 
        protected void deploy(Bundle bundle, Map<String, String> properties) {
                CmsTheme cmsTheme;
-               if (properties.containsKey(CMS_THEME_BUNDLE_PROPERTY)) {
-                       String cmsThemeBundle = properties.get(CMS_THEME_BUNDLE_PROPERTY);
+               if (properties.containsKey(CmsTheme.CMS_THEME_BUNDLE_PROPERTY)) {
+                       String cmsThemeBundle = properties.get(CmsTheme.CMS_THEME_BUNDLE_PROPERTY);
                        cmsTheme = new CmsTheme(bundleContext, cmsThemeBundle);
                } else {
-                       cmsTheme = new CmsTheme(bundleContext, DEFAULT_CMS_THEME_BUNDLE);
+                       cmsTheme = new CmsTheme(bundleContext, CmsTheme.DEFAULT_CMS_THEME_BUNDLE);
                }
 
                ArgeoRapApp app = new ArgeoRapApp(bundleContext, bundle, cmsTheme);
index 322a1bff7d773cab3038598f7631a382d073d1ca..bb4fae976e63ee422e0f7f490d9818a7ea0195cc 100644 (file)
@@ -1,8 +1,5 @@
 package org.argeo.suite.e4.rap.settings;
 
-import static org.argeo.suite.e4.rap.settings.AppDeployer.CMS_THEME_BUNDLE_PROPERTY;
-import static org.argeo.suite.e4.rap.settings.AppDeployer.DEFAULT_CMS_THEME_BUNDLE;
-
 import java.util.Enumeration;
 import java.util.Map;
 
@@ -41,11 +38,11 @@ public class ArgeoRapApp extends AbstractRapE4App {
        public void init(BundleContext bundleContext, Map<String, Object> properties) {
                super.init(bundleContext, properties);
                // super must be first
-               if (getBaseProperties().containsKey(CMS_THEME_BUNDLE_PROPERTY)) {
-                       String cmsThemeBundle = getBaseProperties().get(CMS_THEME_BUNDLE_PROPERTY);
+               if (getBaseProperties().containsKey(CmsTheme.CMS_THEME_BUNDLE_PROPERTY)) {
+                       String cmsThemeBundle = getBaseProperties().get(CmsTheme.CMS_THEME_BUNDLE_PROPERTY);
                        cmsTheme = new CmsTheme(getBundleContext(), cmsThemeBundle);
                } else {
-                       cmsTheme = new CmsTheme(getBundleContext(), DEFAULT_CMS_THEME_BUNDLE);
+                       cmsTheme = new CmsTheme(getBundleContext(), CmsTheme.DEFAULT_CMS_THEME_BUNDLE);
                }
                bundle = bundleContext.getBundle();
        }