]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Use prefixes for system nodes
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 10 Feb 2012 18:51:17 +0000 (18:51 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 10 Feb 2012 18:51:17 +0000 (18:51 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@5046 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

modules/server/org.argeo.slc.node.jackrabbit/META-INF/spring/jackrabbit.xml
runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/SlcJcrConstants.java
runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrExecutionModulesListener.java
runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrExecutionProcess.java
runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/OsgiExecutionModulesManager.java

index e5aeb2b2bccfb16fa05b4a6dcf60ad8805432103..097866055256adcfe71e5cae24f2d59be363405d 100644 (file)
@@ -16,7 +16,7 @@
                <property name="cndFiles">
                        <list>
                                <value>/org/argeo/slc/jcr/slc.cnd</value>
-                               <value>/org/argeo/slc/repo/repo.cnd</value>
+<!--                           <value>/org/argeo/slc/repo/repo.cnd</value> -->
                        </list>
                </property>
                <property name="repository" ref="nodeRepository" />
index f797033566d46d509681b1d41b38bbd4b2d04a4a..edd56e80044afa677a4bdaddf9d6d73eaf691b7e 100644 (file)
@@ -3,8 +3,12 @@ package org.argeo.slc.jcr;
 /** JCR related constants used across SLC */
 public interface SlcJcrConstants {
        public final static String PROPERTY_PATH = "argeo.slc.jcr.path";
-       public final static String PROCESSES_BASE_PATH = "/slc/processes";
-       public final static String AGENTS_BASE_PATH = "/slc/agents";
-       public final static String RESULTS_BASE_PATH = "/slc/results";
-       public final static String VM_AGENT_FACTORY_PATH = AGENTS_BASE_PATH + "/vm";
+       public final static String SLC_BASE_PATH = "/slc:system";
+       public final static String PROCESSES_BASE_PATH = SLC_BASE_PATH
+                       + "/slc:processes";
+       public final static String AGENTS_BASE_PATH = SLC_BASE_PATH + "/slc:agents";
+       public final static String RESULTS_BASE_PATH = SLC_BASE_PATH
+                       + "/slc:results";
+       public final static String VM_AGENT_FACTORY_PATH = AGENTS_BASE_PATH
+                       + "/slc:vm";
 }
index 1f2a2bb3c79d49cf94b996019c1ab09b1c5b9e16..cefc67093e3a9476f716fa85fb39845f2ba0ed44 100644 (file)
@@ -67,7 +67,7 @@ public class JcrExecutionModulesListener implements ExecutionModulesListener,
                                if (executionModules != null) {
                                        Node agentNode = session.getNode(agent.getNodePath());
                                        for (String executionModule : executionModules.split(",")) {
-                                               for (ModuleDescriptor moduleDescriptor : moduleDescriptors) {
+                                               allModules: for (ModuleDescriptor moduleDescriptor : moduleDescriptors) {
                                                        String moduleNodeName = SlcJcrUtils
                                                                        .getModuleNodeName(moduleDescriptor);
                                                        if (moduleDescriptor.getName().equals(
@@ -88,10 +88,12 @@ public class JcrExecutionModulesListener implements ExecutionModulesListener,
                                                                                Property.JCR_DESCRIPTION,
                                                                                moduleDescriptor.getDescription());
                                                                moduleNode.setProperty(SLC_STARTED, false);
+                                                               break allModules;
                                                        }
                                                }
                                        }
-                                       session.save();
+                                       if (session.hasPendingChanges())
+                                               session.save();
                                }
                        }
                } catch (RepositoryException e) {
index 83b442fbf77c1f6462f88a8e1bfbb1de9e1b69e8..725270a62d6e101c8293c42fb3425c7eaf94f151 100644 (file)
@@ -85,13 +85,13 @@ public class JcrExecutionProcess implements ExecutionProcess, SlcNames {
                                        // skip
                                        continue steps;
 
-                               String relPath = SLC_LOG + '/' + step.getThread() + '/'
+                               String relPath = SLC_LOG + '/'
+                                               + step.getThread().replace('/', '_') + '/'
                                                + step.getLocation().replace('.', '/');
                                String path = node.getPath() + '/' + relPath;
                                // clean special character
                                // TODO factorize in JcrUtils
-                               path = path.replace('@', '_').replace('/', '_')
-                                               .replace(':', '_');
+                               path = path.replace('@', '_').replace(':', '_');
 
                                Node location = JcrUtils.mkdirs(node.getSession(), path);
                                Node logEntry = location.addNode(Long.toString(nextLogLine),
index 8cdb682b531e7106d505988b18225b3c2f54acbe..f2fc44f810f19bbf6d90617442030d7cc4c868ce 100644 (file)
@@ -508,7 +508,7 @@ public class OsgiExecutionModulesManager extends
                String path = executionFlow.getPath();
                String name = executionFlow.getName();
                if (path == null && name.indexOf('/') >= 0) {
-                       path = name.substring(0, name.lastIndexOf('/') - 1);
+                       path = name.substring(0, name.lastIndexOf('/'));
                        name = name.substring(name.lastIndexOf('/'));
                }