]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.core/src/main/java/org/argeo/slc/ant/structure/SAwareTask.java
Updates required by deploy
[gpl/argeo-slc.git] / org.argeo.slc.core / src / main / java / org / argeo / slc / ant / structure / SAwareTask.java
index 9db63f141dcc4437c2ba481466f8a41b8c0e2a74..d248a38705378bfa318781385bf1a5400362e48d 100644 (file)
@@ -17,8 +17,7 @@ import org.argeo.slc.core.structure.StructureRegistry;
 import org.argeo.slc.core.structure.tree.TreeSPath;\r
 \r
 /** Ant task that can be registered within a structure. */\r
-public abstract class SAwareTask extends AbstractSpringTask implements\r
-               StructureElement {\r
+public abstract class SAwareTask extends AbstractSpringTask {\r
        private String path;\r
        private TreeSPath treeSPath;\r
        private final List<AbstractSpringArg> sAwareArgs = new Vector<AbstractSpringArg>();\r
@@ -66,14 +65,21 @@ public abstract class SAwareTask extends AbstractSpringTask implements
 \r
                        treeSPath = taskPath;\r
                } else {\r
-                       treeSPath = TreeSPath.parseToCreatePath(path);\r
+                       treeSPath = new TreeSPath(path);\r
                }\r
 \r
-               if (structureElementArg != null)\r
-                       getRegistry().register(treeSPath,\r
-                                       structureElementArg.getStructureElement());\r
-               else\r
-                       getRegistry().register(treeSPath, this);\r
+               if (getRegistry().getElement(treeSPath) == null) {\r
+                       // No structure element registered.\r
+                       if (structureElementArg != null) {\r
+                               getRegistry().register(treeSPath,\r
+                                               structureElementArg.getStructureElement());\r
+                       } else {\r
+                               if (getDescription() != null) {\r
+                                       getRegistry().register(treeSPath,\r
+                                                       new SimpleSElement(getDescription()));\r
+                               }\r
+                       }\r
+               }\r
 \r
                // notify registered args\r
                for (AbstractSpringArg arg : sAwareArgs) {\r