Move various CMS extensions to Argeo SLC.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / internal / kernel / DeployConfig.java
index 9d2925948ceef806191c82f9aa508697ad755da3..0a7d26584d96b14538c2f69309a51f30cc80e498 100644 (file)
@@ -16,14 +16,11 @@ import javax.naming.directory.Attributes;
 import javax.naming.directory.BasicAttributes;
 import javax.naming.ldap.LdapName;
 import javax.naming.ldap.Rdn;
-import javax.websocket.server.ServerEndpointConfig;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.argeo.api.NodeConstants;
 import org.argeo.cms.CmsException;
-import org.argeo.cms.internal.http.InternalHttpConstants;
-import org.argeo.cms.websocket.CmsWebSocketConfigurator;
 import org.argeo.naming.AttributesDictionary;
 import org.argeo.naming.LdifParser;
 import org.argeo.naming.LdifWriter;
@@ -88,7 +85,7 @@ class DeployConfig implements ConfigurationListener {
 
                // additional repositories
                dataModels: for (DataModels.DataModel dataModel : dataModels.getNonAbstractDataModels()) {
-                       if (NodeConstants.NODE.equals(dataModel.getName()))
+                       if (NodeConstants.NODE_REPOSITORY.equals(dataModel.getName()))
                                continue dataModels;
                        Dictionary<String, Object> config = InitUtils.getRepositoryConfig(dataModel.getName(),
                                        getProps(NodeConstants.NODE_REPOS_FACTORY_PID, dataModel.getName()));
@@ -147,16 +144,16 @@ class DeployConfig implements ConfigurationListener {
                // activator of the Equinox Jetty bundle.
                Dictionary<String, Object> webServerConfig = InitUtils
                                .getHttpServerConfig(getProps(KernelConstants.JETTY_FACTORY_PID, NodeConstants.DEFAULT));
-               if (!webServerConfig.isEmpty()) {
-                       webServerConfig.put("customizer.class", KernelConstants.CMS_JETTY_CUSTOMIZER_CLASS);
-
-                       // TODO centralise with Jetty extender
-                       Object webSocketEnabled = webServerConfig.get(InternalHttpConstants.WEBSOCKET_ENABLED);
-                       if (webSocketEnabled != null && webSocketEnabled.toString().equals("true")) {
-                               bc.registerService(ServerEndpointConfig.Configurator.class, new CmsWebSocketConfigurator(), null);
-                               webServerConfig.put(InternalHttpConstants.WEBSOCKET_ENABLED, "true");
-                       }
-               }
+//             if (!webServerConfig.isEmpty()) {
+//                     webServerConfig.put("customizer.class", KernelConstants.CMS_JETTY_CUSTOMIZER_CLASS);
+//
+//                     // TODO centralise with Jetty extender
+//                     Object webSocketEnabled = webServerConfig.get(InternalHttpConstants.WEBSOCKET_ENABLED);
+//                     if (webSocketEnabled != null && webSocketEnabled.toString().equals("true")) {
+//                             bc.registerService(ServerEndpointConfig.Configurator.class, new CmsWebSocketConfigurator(), null);
+//                             webServerConfig.put(InternalHttpConstants.WEBSOCKET_ENABLED, "true");
+//                     }
+//             }
 
                int tryCount = 60;
                try {
@@ -174,6 +171,7 @@ class DeployConfig implements ConfigurationListener {
                                        } catch (Exception e1) {
                                                // silent
                                        }
+                                       tryCount--;
                                }
                        }
                } catch (Exception e) {
@@ -188,6 +186,8 @@ class DeployConfig implements ConfigurationListener {
                        deployConfigs = new LdifParser().read(in);
                }
                if (isClean) {
+                       if(log.isDebugEnabled())
+                               log.debug("Clean state, loading from framework properties...");
                        setFromFrameworkProperties(isFirstInit);
                        for (LdapName dn : deployConfigs.keySet()) {
                                Rdn lastRdn = dn.getRdn(dn.size() - 1);