RESOLVED - issue BATCH-1300: Add description element to <job/> and <step/>
This commit is contained in:
@@ -101,6 +101,11 @@ public abstract class AbstractStepParser {
|
||||
if (StringUtils.hasText(jobFactoryRef)) {
|
||||
bd.setAttribute("jobParserJobFactoryBeanRef", jobFactoryRef);
|
||||
}
|
||||
|
||||
Element description = DomUtils.getChildElementByTagName(stepElement, "description");
|
||||
if (description!=null) {
|
||||
bd.setDescription(description.getTextContent());
|
||||
}
|
||||
|
||||
return bd;
|
||||
|
||||
|
||||
@@ -101,6 +101,11 @@ public class JobParser extends AbstractSingleBeanDefinitionParser {
|
||||
builder.addPropertyValue("flow", flowDef);
|
||||
}
|
||||
|
||||
Element description = DomUtils.getChildElementByTagName(element, "description");
|
||||
if (description!=null) {
|
||||
builder.getBeanDefinition().setDescription(description.getTextContent());
|
||||
}
|
||||
|
||||
List<Element> listenersElements = DomUtils.getChildElementsByTagName(element, "listeners");
|
||||
if (listenersElements.size() == 1) {
|
||||
Element listenersElement = listenersElements.get(0);
|
||||
|
||||
@@ -26,23 +26,26 @@
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
<xsd:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:group ref="flowGroup" />
|
||||
<xsd:element name="listeners">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
List of all listeners for the job
|
||||
]]>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="listener" type="jobExecutionListenerType" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xsd:sequence>
|
||||
<xsd:attributeGroup ref="mergeAttribute" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="description" minOccurs="0"/>
|
||||
<xsd:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:group ref="flowGroup" />
|
||||
<xsd:element name="listeners">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
List of all listeners for the job
|
||||
]]>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="listener" type="jobExecutionListenerType" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xsd:sequence>
|
||||
<xsd:attributeGroup ref="mergeAttribute" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="id" type="xsd:ID" use="required" />
|
||||
<xsd:attributeGroup ref="jobRepositoryAttribute" />
|
||||
<xsd:attribute name="incrementer" type="xsd:string" use="optional">
|
||||
@@ -82,17 +85,20 @@
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
<xsd:choice minOccurs="0" maxOccurs="1">
|
||||
<xsd:element name="tasklet">
|
||||
<xsd:complexType>
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="taskletType">
|
||||
<xsd:attributeGroup ref="jobRepositoryAttribute"/>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="description" minOccurs="0"/>
|
||||
<xsd:choice minOccurs="0" maxOccurs="1">
|
||||
<xsd:element name="tasklet">
|
||||
<xsd:complexType>
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="taskletType">
|
||||
<xsd:attributeGroup ref="jobRepositoryAttribute"/>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="id" type="xsd:ID" use="required" />
|
||||
<xsd:attributeGroup ref="parentAttribute"/>
|
||||
<xsd:attributeGroup ref="abstractAttribute" />
|
||||
@@ -231,10 +237,13 @@
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
<xsd:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:element name="tasklet" type="taskletType"/>
|
||||
<xsd:group ref="transitions" />
|
||||
</xsd:choice>
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="description" minOccurs="0"/>
|
||||
<xsd:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:element name="tasklet" type="taskletType"/>
|
||||
<xsd:group ref="transitions" />
|
||||
</xsd:choice>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="id" type="xsd:ID" use="required" />
|
||||
<xsd:attributeGroup ref="parentAttribute"/>
|
||||
<xsd:attributeGroup ref="nextAttribute" />
|
||||
@@ -916,5 +925,17 @@
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:attributeGroup>
|
||||
|
||||
<xsd:element name="description">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Contains informative text describing the purpose of the enclosing element.
|
||||
Used primarily for user documentation of XML bean definition documents.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType mixed="true">
|
||||
<xsd:choice minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
</xsd:schema>
|
||||
|
||||
@@ -7,7 +7,10 @@
|
||||
<beans:import resource="common-context.xml" />
|
||||
|
||||
<job id="job" incrementer="testIncrementer" job-repository="jobRepository">
|
||||
<step id="s1" parent="step1"/>
|
||||
<description>A job that executes step1</description>
|
||||
<step id="s1" parent="step1">
|
||||
<description>A step that does some stuff</description>
|
||||
</step>
|
||||
<listeners>
|
||||
<listener after-job-method="afterJob" ref="testListener"/>
|
||||
<listener after-job-method="afterJob">
|
||||
|
||||
Reference in New Issue
Block a user