Make WebSocket activation configurable.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / internal / kernel / DeployConfig.java
index bff544ab23dbba6fc5bcdfcf4649d81d33237a41..b1e36633a1da9cd704d0e787e4fa8673a40d5c9d 100644 (file)
@@ -86,7 +86,7 @@ class DeployConfig implements ConfigurationListener {
                        if (NodeConstants.NODE.equals(dataModel.getName()))
                                continue dataModels;
                        Dictionary<String, Object> config = InitUtils.getRepositoryConfig(dataModel.getName(),
-                                       getProps(NodeConstants.NODE_REPOS_FACTORY_PID, NodeConstants.NODE));
+                                       getProps(NodeConstants.NODE_REPOS_FACTORY_PID, dataModel.getName()));
                        if (config.size() != 0)
                                putFactoryDeployConfig(NodeConstants.NODE_REPOS_FACTORY_PID, config);
                }
@@ -122,9 +122,11 @@ class DeployConfig implements ConfigurationListener {
                // http server
                Dictionary<String, Object> webServerConfig = InitUtils
                                .getHttpServerConfig(getProps(KernelConstants.JETTY_FACTORY_PID, NodeConstants.DEFAULT));
-               if (!webServerConfig.isEmpty())
+               if (!webServerConfig.isEmpty()) {
+                       // TODO chekc for other customizers
+                       webServerConfig.put("customizer.class", "org.argeo.equinox.jetty.CmsJettyCustomizer");
                        putFactoryDeployConfig(KernelConstants.JETTY_FACTORY_PID, webServerConfig);
-
+               }
                save();
        }
 
@@ -245,7 +247,8 @@ class DeployConfig implements ConfigurationListener {
                try (Writer writer = Files.newBufferedWriter(deployConfigPath)) {
                        new LdifWriter(writer).write(deployConfigs);
                } catch (IOException e) {
-                       throw new CmsException("Cannot save deploy configs", e);
+                       // throw new CmsException("Cannot save deploy configs", e);
+                       log.error("Cannot save deploy configs", e);
                }
        }