Skip to content

Commit 05de3c6

Browse files
committed
Fix pipeline with new schema configuration
1 parent dd70a9d commit 05de3c6

7 files changed

Lines changed: 55 additions & 24 deletions

File tree

bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/factory/SchemaFactoryExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static SchemaFactory newInstance() throws SAXNotSupportedException, SAXNo
4040
schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
4141
schemaFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
4242
schemaFactory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
43-
schemaFactory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
43+
schemaFactory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "file");
4444

4545
return schemaFactory;
4646
}

bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/XMLDocumentBodyCreator.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package software.xdev.bzst.dip.client.xmldocument;
1717

1818
import java.math.BigDecimal;
19+
import java.math.BigInteger;
1920
import java.time.LocalDate;
2021
import java.time.LocalDateTime;
2122
import java.util.GregorianCalendar;
@@ -92,18 +93,20 @@ private ConsignmentItemType createConsignmentItem(
9293
) throws DatatypeConfigurationException
9394
{
9495
final ConsignmentItemType consignmentItem = new ConsignmentItemType();
96+
consignmentItem.setConsignmentItemPosition(BigInteger.ZERO);
9597
consignmentItem.setData(this.createData(correctableReportableSellerTypes, platformOperatorType));
96-
98+
9799
return consignmentItem;
98100
}
99-
101+
100102
private ConsignmentItemType createConsignmentItem(
101103
final PaymentDataBodyType paymentDataBodyType
102104
) throws DatatypeConfigurationException
103105
{
104106
final ConsignmentItemType consignmentItem = new ConsignmentItemType();
107+
consignmentItem.setConsignmentItemPosition(BigInteger.ZERO);
105108
consignmentItem.setData(this.createData(paymentDataBodyType));
106-
109+
107110
return consignmentItem;
108111
}
109112

bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/XMLDocumentCreator.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -225,18 +225,10 @@ private void validateXMLDocument(final String xmlString)
225225

226226
final Schema schema = factory.newSchema(new Source[]
227227
{
228-
new StreamSource(this.getClass()
229-
.getClassLoader()
230-
.getResourceAsStream(XSD_SUBDIRECTORY + "/" + DIP_XSD)),
231-
new StreamSource(this.getClass()
232-
.getClassLoader()
233-
.getResourceAsStream(XSD_SUBDIRECTORY + "/" + ISO_DPI_TYPES_XSD)),
234-
new StreamSource(this.getClass()
235-
.getClassLoader()
236-
.getResourceAsStream(XSD_SUBDIRECTORY + "/" + OECD_DPI_TYPES_XSD)),
237-
new StreamSource(this.getClass()
238-
.getClassLoader()
239-
.getResourceAsStream(XSD_SUBDIRECTORY + "/" + DPI_XML_XSD))
228+
createStreamSource(DIP_XSD),
229+
createStreamSource(ISO_DPI_TYPES_XSD),
230+
createStreamSource(OECD_DPI_TYPES_XSD),
231+
createStreamSource(DPI_XML_XSD)
240232
});
241233

242234
final Validator validator = schema.newValidator();
@@ -251,6 +243,15 @@ private void validateXMLDocument(final String xmlString)
251243
}
252244
}
253245

246+
private StreamSource createStreamSource(final String xsdFileName)
247+
{
248+
final String resourcePath = XSD_SUBDIRECTORY + "/" + xsdFileName;
249+
return new StreamSource(
250+
this.getClass().getClassLoader().getResourceAsStream(resourcePath),
251+
this.getClass().getClassLoader().getResource(resourcePath).toExternalForm()
252+
);
253+
}
254+
254255
public static XMLGregorianCalendar parseLocalDateToXMLGregorianCalendarDate(final LocalDate localDate)
255256
{
256257
try

bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/model/ApplicationType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* </pre>
3939
*/
4040
@XmlAccessorType(XmlAccessType.FIELD)
41-
@XmlType(name = "ApplicationType", namespace = "http://itzbund.de/ozg/bzst/post/dip/v1/")
41+
@XmlType(name = "ApplicationType", namespace = "http://itzbund.de/ozg/bzst/post/dip/v2/")
4242
public class ApplicationType
4343
{
4444

bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/model/ConsignmentItemType.java

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616

1717
package software.xdev.bzst.dip.client.xmldocument.model;
1818

19+
import java.math.BigInteger;
20+
1921
import jakarta.xml.bind.annotation.XmlAccessType;
2022
import jakarta.xml.bind.annotation.XmlAccessorType;
2123
import jakarta.xml.bind.annotation.XmlAnyElement;
24+
import jakarta.xml.bind.annotation.XmlAttribute;
2225
import jakarta.xml.bind.annotation.XmlElement;
2326
import jakarta.xml.bind.annotation.XmlSeeAlso;
2427
import jakarta.xml.bind.annotation.XmlType;
@@ -34,28 +37,32 @@
3437
* &lt;complexContent&gt;
3538
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
3639
* &lt;sequence&gt;
37-
* &lt;element name="bopAccountId" type="{http://itzbund.de/ozg/bzst/post/dip/v1/}bopAccountIdType" minOccurs="0"/&gt;
40+
* &lt;element name="bopAccountId" type="{http://itzbund.de/ozg/bzst/post/dip/v2/}bopAccountIdType" minOccurs="0"/&gt;
3841
* &lt;element name="data" type="{http://www.w3.org/2001/XMLSchema}anyType"/&gt;
3942
* &lt;/sequence&gt;
43+
* &lt;attribute name="consignmentItemPosition" type="{http://itzbund.de/ozg/bzst/post/dip/v2/}consignmentItemPositionType" use="required"/&gt;
4044
* &lt;/restriction&gt;
4145
* &lt;/complexContent&gt;
4246
* &lt;/complexType&gt;
4347
* </pre>
4448
*/
4549
@XmlAccessorType(XmlAccessType.FIELD)
46-
@XmlType(name = "ConsignmentItemType", namespace = "http://itzbund.de/ozg/bzst/post/dip/v1/", propOrder = {
50+
@XmlType(name = "ConsignmentItemType", namespace = "http://itzbund.de/ozg/bzst/post/dip/v2/", propOrder = {
4751
"bopAccountId",
4852
"data"
4953
})
5054
@XmlSeeAlso(DataType.class)
5155
public class ConsignmentItemType
5256
{
53-
54-
@XmlElement(namespace = "http://itzbund.de/ozg/bzst/post/dip/v1/")
57+
58+
@XmlElement(namespace = "http://itzbund.de/ozg/bzst/post/dip/v2/")
5559
protected String bopAccountId;
56-
60+
5761
@XmlAnyElement(lax = true)
5862
protected Object data;
63+
64+
@XmlAttribute(name = "consignmentItemPosition", required = true)
65+
protected BigInteger consignmentItemPosition;
5966

6067
/**
6168
* Gets the value of the bopAccountId property.
@@ -96,4 +103,24 @@ public void setData(final Object value)
96103
{
97104
this.data = value;
98105
}
106+
107+
/**
108+
* Gets the value of the consignmentItemPosition property.
109+
*
110+
* @return possible object is {@link BigInteger }
111+
*/
112+
public BigInteger getConsignmentItemPosition()
113+
{
114+
return this.consignmentItemPosition;
115+
}
116+
117+
/**
118+
* Sets the value of the consignmentItemPosition property.
119+
*
120+
* @param value allowed object is {@link BigInteger }
121+
*/
122+
public void setConsignmentItemPosition(final BigInteger value)
123+
{
124+
this.consignmentItemPosition = value;
125+
}
99126
}

bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/model/EnvironmentType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* &lt;/simpleType&gt;
3434
* </pre>
3535
*/
36-
@XmlType(name = "environmentType", namespace = "http://itzbund.de/ozg/bzst/post/dip/v1/")
36+
@XmlType(name = "environmentType", namespace = "http://itzbund.de/ozg/bzst/post/dip/v2/")
3737
@XmlEnum
3838
public enum EnvironmentType
3939
{

bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/xmldocument/model/IdentityProviderType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* &lt;/simpleType&gt;
3535
* </pre>
3636
*/
37-
@XmlType(name = "identityProviderType", namespace = "http://itzbund.de/ozg/bzst/post/dip/v1/")
37+
@XmlType(name = "identityProviderType", namespace = "http://itzbund.de/ozg/bzst/post/dip/v2/")
3838
@XmlEnum
3939
public enum IdentityProviderType
4040
{

0 commit comments

Comments
 (0)