Improve structure elements
authorMathieu Baudier <mbaudier@argeo.org>
Mon, 17 Dec 2007 09:26:56 +0000 (09:26 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Mon, 17 Dec 2007 09:26:56 +0000 (09:26 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@870 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

org.argeo.slc.core/.project
org.argeo.slc.core/.settings/org.eclipse.wst.common.component [deleted file]
org.argeo.slc.core/.settings/org.eclipse.wst.common.project.facet.core.xml [deleted file]
org.argeo.slc.core/.settings/org.eclipse.wst.validation.prefs [deleted file]
org.argeo.slc.core/src/main/java/org/argeo/slc/ant/SlcAntConfig.java
org.argeo.slc.core/src/main/java/org/argeo/slc/ant/structure/SAwareTask.java
org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/DefaultSRegistry.java
org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/SimpleResultPart.java

index 469224f877b8573f6fa40fd1592ec968059775ba..15b8bfab0d487edb85130b8c4f5fa3bf7e9d2b7b 100644 (file)
@@ -5,11 +5,6 @@
        <projects>\r
        </projects>\r
        <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.wst.common.project.facet.core.builder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
                <buildCommand>\r
                        <name>org.maven.ide.eclipse.maven2Builder</name>\r
                        <arguments>\r
                        <arguments>\r
                        </arguments>\r
                </buildCommand>\r
-               <buildCommand>\r
-                       <name>org.eclipse.wst.validation.validationbuilder</name>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
        </buildSpec>\r
        <natures>\r
                <nature>org.eclipse.jdt.core.javanature</nature>\r
                <nature>org.maven.ide.eclipse.maven2Nature</nature>\r
-               <nature>org.eclipse.wst.common.project.facet.core.nature</nature>\r
-               <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>\r
-               <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>\r
        </natures>\r
 </projectDescription>\r
diff --git a/org.argeo.slc.core/.settings/org.eclipse.wst.common.component b/org.argeo.slc.core/.settings/org.eclipse.wst.common.component
deleted file mode 100644 (file)
index ecc11d8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project-modules id="moduleCoreId" project-version="1.5.0">\r
-<wb-module deploy-name="org.argeo.slc.core">\r
-<wb-resource deploy-path="/" source-path="/src/main/java"/>\r
-<wb-resource deploy-path="/" source-path="/src/main/resources"/>\r
-<wb-resource deploy-path="/" source-path="/src/test/java"/>\r
-<wb-resource deploy-path="/" source-path="/src/test/resources"/>\r
-</wb-module>\r
-</project-modules>\r
diff --git a/org.argeo.slc.core/.settings/org.eclipse.wst.common.project.facet.core.xml b/org.argeo.slc.core/.settings/org.eclipse.wst.common.project.facet.core.xml
deleted file mode 100644 (file)
index 55c9972..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<faceted-project>\r
-  <fixed facet="jst.utility"/>\r
-  <fixed facet="jst.java"/>\r
-  <installed facet="jst.java" version="5.0"/>\r
-  <installed facet="jst.utility" version="1.0"/>\r
-</faceted-project>\r
diff --git a/org.argeo.slc.core/.settings/org.eclipse.wst.validation.prefs b/org.argeo.slc.core/.settings/org.eclipse.wst.validation.prefs
deleted file mode 100644 (file)
index 0612703..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#Sun Dec 16 00:03:13 CET 2007\r
-DELEGATES_PREFERENCE=delegateValidatorListorg.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator\=org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator\=org.eclipse.wst.wsdl.validation.internal.eclipse.Validator;\r
-USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator;org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsf.validation.internal.JSPSemanticsValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidator;\r
-USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator;org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsf.validation.internal.JSPSemanticsValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidator;\r
-USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.1.102.v200709122200\r
-eclipse.preferences.version=1\r
index 11fdd64310494515431cb0c6384c4ce362a5b55a..90dc99149109ed2fb221487cbd4b1cdcfab051fd 100644 (file)
@@ -127,8 +127,8 @@ public class SlcAntConfig {
        public static String DEFAULT_TEST_RUN_PROPERTY = "slc.defaultTestRun";\r
 \r
        // SLC LOCAL PROPERTIES\r
-       /** Property for the dir description (SLC local property file). */\r
-       public static String DIR_DESCRIPTION_PROPERTY = "slc.dirDescription";\r
+       /** Property for the dir label (SLC local property file). */\r
+       public static String DIR_LABEL_PROPERTY = "slc.dirLabel";\r
 \r
        private String slcRootFileName = "slcRoot.properties";\r
        private String slcLocalFileName = "slcLocal.properties";\r
@@ -280,7 +280,7 @@ public class SlcAntConfig {
        /**\r
         * Looks for a file named {@link #getSlcLocalFileName()} in the directory,\r
         * loads it as properties file and return the value of the property\r
-        * {@link #DIR_DESCRIPTION_PROPERTY}.\r
+        * {@link #DIR_LABEL_PROPERTY}.\r
         */\r
        public String getDescriptionForDir(File dir) {\r
                String description = dir.getName();\r
@@ -289,7 +289,7 @@ public class SlcAntConfig {
                if (slcLocal.exists()) {\r
                        Properties properties = loadFile(slcLocal.getAbsolutePath());\r
                        description = properties.getProperty(\r
-                                       SlcAntConfig.DIR_DESCRIPTION_PROPERTY, description);\r
+                                       SlcAntConfig.DIR_LABEL_PROPERTY, description);\r
                }\r
                return description;\r
        }\r
index 136bd5201487e8ac8711971b576327fa625de7f9..91f59cf8f4475ea1632d16cd23d476073087c148 100644 (file)
@@ -6,6 +6,7 @@ import java.util.Vector;
 import org.apache.tools.ant.BuildException;\r
 import org.apache.tools.ant.Target;\r
 \r
+import org.argeo.slc.ant.SlcAntException;\r
 import org.argeo.slc.ant.SlcProjectHelper;\r
 import org.argeo.slc.ant.spring.AbstractSpringArg;\r
 import org.argeo.slc.ant.spring.AbstractSpringTask;\r
@@ -22,6 +23,8 @@ public abstract class SAwareTask extends AbstractSpringTask implements
        private TreeSPath path;\r
        private final List<AbstractSpringArg> sAwareArgs = new Vector<AbstractSpringArg>();\r
 \r
+       private StructureElementArg structureElementArg;\r
+\r
        @Override\r
        public void init() throws BuildException {\r
                StructureRegistry registry = getRegistry();\r
@@ -39,7 +42,7 @@ public abstract class SAwareTask extends AbstractSpringTask implements
        }\r
 \r
        /**\r
-        * Includes this arg in the checks for propagation of sstructure related\r
+        * Includes this arg in the checks for propagation of structure related\r
         * information.\r
         */\r
        protected void addSAwareArg(AbstractSpringArg arg) {\r
@@ -59,7 +62,12 @@ public abstract class SAwareTask extends AbstractSpringTask implements
                TreeSPath targetPath = createTargetPath(getOwningTarget());\r
                TreeSPath taskPath = targetPath.createChild(getTaskName()\r
                                + targetPath.listChildren(getRegistry()).size());\r
-               getRegistry().register(taskPath, this);\r
+               if (structureElementArg != null)\r
+                       getRegistry().register(taskPath,\r
+                                       structureElementArg.getStructureElement());\r
+               else\r
+                       getRegistry().register(taskPath, this);\r
+\r
                path = taskPath;\r
 \r
                // notify registered args\r
@@ -91,6 +99,14 @@ public abstract class SAwareTask extends AbstractSpringTask implements
        /** Actions to be executed by the implementor. */\r
        protected abstract void executeActions(String mode);\r
 \r
+       /** Create a reference to an external structure element. */\r
+       public StructureElementArg createStructureElement() {\r
+               if (structureElementArg != null)\r
+                       throw new SlcAntException("Arg already set.");\r
+               structureElementArg = new StructureElementArg();\r
+               return structureElementArg;\r
+       }\r
+\r
        /** Gets the underlying structure registry. */\r
        protected StructureRegistry getRegistry() {\r
                return (StructureRegistry) getProject().getReference(\r
@@ -119,3 +135,9 @@ public abstract class SAwareTask extends AbstractSpringTask implements
        }\r
 \r
 }\r
+\r
+class StructureElementArg extends AbstractSpringArg {\r
+       public StructureElement getStructureElement() {\r
+               return (StructureElement) getBeanInstance();\r
+       }\r
+}
\ No newline at end of file
index ca80d87625e379c42052b1a5050748e24ffa5ff8..f88b604dda6510d3a232197e867feb79ddf1bec7 100644 (file)
@@ -28,7 +28,7 @@ public class DefaultSRegistry implements StructureRegistry {
                StructureElement treeSElement = element;\r
                elements.add(treeSElement);\r
                paths.add(path);\r
-               log.debug("Registered " + path + " (desc: '"\r
+               log.debug("Registered " + path + " (label: '"\r
                                + treeSElement.getLabel() + "', position: "\r
                                + elements.size() + ")");\r
        }\r
index 249fd2149f58a93cd43aa1a4f56ee161e9e71fd8..eae7f4067e632ab503067ef7f8f335a232305816 100644 (file)
@@ -15,7 +15,7 @@ public class SimpleResultPart implements TestResultPart, TestStatus {
 \r
        private Integer status;\r
        private String message;\r
-       private Throwable exception;\r
+       private Exception exception;\r
 \r
        public SimpleResultPart() {\r
        }\r
@@ -24,7 +24,7 @@ public class SimpleResultPart implements TestResultPart, TestStatus {
                this(status, message, null);\r
        }\r
 \r
-       public SimpleResultPart(Integer status, String message, Throwable exception) {\r
+       public SimpleResultPart(Integer status, String message, Exception exception) {\r
                this.status = status;\r
                this.message = message;\r
                this.exception = exception;\r
@@ -46,11 +46,11 @@ public class SimpleResultPart implements TestResultPart, TestStatus {
                return status;\r
        }\r
 \r
-       public Throwable getException() {\r
+       public Exception getException() {\r
                return exception;\r
        }\r
 \r
-       public void setException(Throwable exception) {\r
+       public void setException(Exception exception) {\r
                this.exception = exception;\r
        }\r
 \r