From: Mathieu Baudier Date: Mon, 17 Dec 2007 09:26:56 +0000 (+0000) Subject: Improve structure elements X-Git-Tag: argeo-slc-2.1.7~3100 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=b2d63165e30499440a4c4f118faf9e98e8741702;p=gpl%2Fargeo-slc.git Improve structure elements git-svn-id: https://svn.argeo.org/slc/trunk@870 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/org.argeo.slc.core/.project b/org.argeo.slc.core/.project index 469224f87..15b8bfab0 100644 --- a/org.argeo.slc.core/.project +++ b/org.argeo.slc.core/.project @@ -5,11 +5,6 @@ - - org.eclipse.wst.common.project.facet.core.builder - - - org.maven.ide.eclipse.maven2Builder @@ -20,17 +15,9 @@ - - org.eclipse.wst.validation.validationbuilder - - - org.eclipse.jdt.core.javanature org.maven.ide.eclipse.maven2Nature - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.wst.common.modulecore.ModuleCoreNature - org.eclipse.jem.workbench.JavaEMFNature 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 index ecc11d82b..000000000 --- a/org.argeo.slc.core/.settings/org.eclipse.wst.common.component +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - 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 index 55c9972e3..000000000 --- a/org.argeo.slc.core/.settings/org.eclipse.wst.common.project.facet.core.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - 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 index 06127039b..000000000 --- a/org.argeo.slc.core/.settings/org.eclipse.wst.validation.prefs +++ /dev/null @@ -1,6 +0,0 @@ -#Sun Dec 16 00:03:13 CET 2007 -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; -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; -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; -USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.1.102.v200709122200 -eclipse.preferences.version=1 diff --git a/org.argeo.slc.core/src/main/java/org/argeo/slc/ant/SlcAntConfig.java b/org.argeo.slc.core/src/main/java/org/argeo/slc/ant/SlcAntConfig.java index 11fdd6431..90dc99149 100644 --- a/org.argeo.slc.core/src/main/java/org/argeo/slc/ant/SlcAntConfig.java +++ b/org.argeo.slc.core/src/main/java/org/argeo/slc/ant/SlcAntConfig.java @@ -127,8 +127,8 @@ public class SlcAntConfig { public static String DEFAULT_TEST_RUN_PROPERTY = "slc.defaultTestRun"; // SLC LOCAL PROPERTIES - /** Property for the dir description (SLC local property file). */ - public static String DIR_DESCRIPTION_PROPERTY = "slc.dirDescription"; + /** Property for the dir label (SLC local property file). */ + public static String DIR_LABEL_PROPERTY = "slc.dirLabel"; private String slcRootFileName = "slcRoot.properties"; private String slcLocalFileName = "slcLocal.properties"; @@ -280,7 +280,7 @@ public class SlcAntConfig { /** * Looks for a file named {@link #getSlcLocalFileName()} in the directory, * loads it as properties file and return the value of the property - * {@link #DIR_DESCRIPTION_PROPERTY}. + * {@link #DIR_LABEL_PROPERTY}. */ public String getDescriptionForDir(File dir) { String description = dir.getName(); @@ -289,7 +289,7 @@ public class SlcAntConfig { if (slcLocal.exists()) { Properties properties = loadFile(slcLocal.getAbsolutePath()); description = properties.getProperty( - SlcAntConfig.DIR_DESCRIPTION_PROPERTY, description); + SlcAntConfig.DIR_LABEL_PROPERTY, description); } return description; } diff --git a/org.argeo.slc.core/src/main/java/org/argeo/slc/ant/structure/SAwareTask.java b/org.argeo.slc.core/src/main/java/org/argeo/slc/ant/structure/SAwareTask.java index 136bd5201..91f59cf8f 100644 --- a/org.argeo.slc.core/src/main/java/org/argeo/slc/ant/structure/SAwareTask.java +++ b/org.argeo.slc.core/src/main/java/org/argeo/slc/ant/structure/SAwareTask.java @@ -6,6 +6,7 @@ import java.util.Vector; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Target; +import org.argeo.slc.ant.SlcAntException; import org.argeo.slc.ant.SlcProjectHelper; import org.argeo.slc.ant.spring.AbstractSpringArg; import org.argeo.slc.ant.spring.AbstractSpringTask; @@ -22,6 +23,8 @@ public abstract class SAwareTask extends AbstractSpringTask implements private TreeSPath path; private final List sAwareArgs = new Vector(); + private StructureElementArg structureElementArg; + @Override public void init() throws BuildException { StructureRegistry registry = getRegistry(); @@ -39,7 +42,7 @@ public abstract class SAwareTask extends AbstractSpringTask implements } /** - * Includes this arg in the checks for propagation of sstructure related + * Includes this arg in the checks for propagation of structure related * information. */ protected void addSAwareArg(AbstractSpringArg arg) { @@ -59,7 +62,12 @@ public abstract class SAwareTask extends AbstractSpringTask implements TreeSPath targetPath = createTargetPath(getOwningTarget()); TreeSPath taskPath = targetPath.createChild(getTaskName() + targetPath.listChildren(getRegistry()).size()); - getRegistry().register(taskPath, this); + if (structureElementArg != null) + getRegistry().register(taskPath, + structureElementArg.getStructureElement()); + else + getRegistry().register(taskPath, this); + path = taskPath; // notify registered args @@ -91,6 +99,14 @@ public abstract class SAwareTask extends AbstractSpringTask implements /** Actions to be executed by the implementor. */ protected abstract void executeActions(String mode); + /** Create a reference to an external structure element. */ + public StructureElementArg createStructureElement() { + if (structureElementArg != null) + throw new SlcAntException("Arg already set."); + structureElementArg = new StructureElementArg(); + return structureElementArg; + } + /** Gets the underlying structure registry. */ protected StructureRegistry getRegistry() { return (StructureRegistry) getProject().getReference( @@ -119,3 +135,9 @@ public abstract class SAwareTask extends AbstractSpringTask implements } } + +class StructureElementArg extends AbstractSpringArg { + public StructureElement getStructureElement() { + return (StructureElement) getBeanInstance(); + } +} \ No newline at end of file diff --git a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/DefaultSRegistry.java b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/DefaultSRegistry.java index ca80d8762..f88b604dd 100644 --- a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/DefaultSRegistry.java +++ b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/DefaultSRegistry.java @@ -28,7 +28,7 @@ public class DefaultSRegistry implements StructureRegistry { StructureElement treeSElement = element; elements.add(treeSElement); paths.add(path); - log.debug("Registered " + path + " (desc: '" + log.debug("Registered " + path + " (label: '" + treeSElement.getLabel() + "', position: " + elements.size() + ")"); } diff --git a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/SimpleResultPart.java b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/SimpleResultPart.java index 249fd2149..eae7f4067 100644 --- a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/SimpleResultPart.java +++ b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/SimpleResultPart.java @@ -15,7 +15,7 @@ public class SimpleResultPart implements TestResultPart, TestStatus { private Integer status; private String message; - private Throwable exception; + private Exception exception; public SimpleResultPart() { } @@ -24,7 +24,7 @@ public class SimpleResultPart implements TestResultPart, TestStatus { this(status, message, null); } - public SimpleResultPart(Integer status, String message, Throwable exception) { + public SimpleResultPart(Integer status, String message, Exception exception) { this.status = status; this.message = message; this.exception = exception; @@ -46,11 +46,11 @@ public class SimpleResultPart implements TestResultPart, TestStatus { return status; } - public Throwable getException() { + public Exception getException() { return exception; } - public void setException(Throwable exception) { + public void setException(Exception exception) { this.exception = exception; }