reactivated a test
This commit is contained in:
@@ -53,10 +53,12 @@ public class XMPSchemaPDFAExtensions extends PDFAExtensionSchema {
|
|||||||
public String namespace = null;
|
public String namespace = null;
|
||||||
public String prefix = null;
|
public String prefix = null;
|
||||||
|
|
||||||
|
protected ZUGFeRDExporter exporter;
|
||||||
|
|
||||||
|
|
||||||
protected void setZUGFeRDVersion(int ver) {
|
protected void setZUGFeRDVersion(int ver) {
|
||||||
namespace = ZUGFeRDExporter.getNamespaceForVersion(ver);
|
namespace = exporter.getNamespaceForVersion(ver);
|
||||||
prefix = ZUGFeRDExporter.getPrefixForVersion(ver);
|
prefix = exporter.getPrefixForVersion(ver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -87,14 +89,16 @@ public class XMPSchemaPDFAExtensions extends PDFAExtensionSchema {
|
|||||||
return li;
|
return li;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XMPSchemaPDFAExtensions(XMPMetadata metadata, int ZFVersion) {
|
public XMPSchemaPDFAExtensions(ZUGFeRDExporter ze, XMPMetadata metadata, int ZFVersion) {
|
||||||
super(metadata);
|
super(metadata);
|
||||||
|
exporter=ze;
|
||||||
setZUGFeRDVersion(ZFVersion);
|
setZUGFeRDVersion(ZFVersion);
|
||||||
attachExtensions(metadata, true);
|
attachExtensions(metadata, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public XMPSchemaPDFAExtensions(XMPMetadata metadata, int ZFVersion, boolean withZF) {
|
public XMPSchemaPDFAExtensions(ZUGFeRDExporter ze, XMPMetadata metadata, int ZFVersion, boolean withZF) {
|
||||||
super(metadata);
|
super(metadata);
|
||||||
|
exporter=ze;
|
||||||
setZUGFeRDVersion(ZFVersion);
|
setZUGFeRDVersion(ZFVersion);
|
||||||
attachExtensions(metadata, withZF);
|
attachExtensions(metadata, withZF);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class ZUGFeRDExporter implements Closeable {
|
|||||||
|
|
||||||
public static final int DefaultZUGFeRDVersion = 1;
|
public static final int DefaultZUGFeRDVersion = 1;
|
||||||
|
|
||||||
private static boolean isFacturX = false;
|
private boolean isFacturX = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To use the ZUGFeRD exporter, implement IZUGFeRDExportableTransaction in
|
* To use the ZUGFeRD exporter, implement IZUGFeRDExportableTransaction in
|
||||||
@@ -133,7 +133,7 @@ public class ZUGFeRDExporter implements Closeable {
|
|||||||
additionalXMLs.put(filename, xml);
|
additionalXMLs.put(filename, xml);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getNamespaceForVersion(int ver) {
|
public String getNamespaceForVersion(int ver) {
|
||||||
if (isFacturX) {
|
if (isFacturX) {
|
||||||
return "urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#";
|
return "urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#";
|
||||||
} else if (ver == 1) {
|
} else if (ver == 1) {
|
||||||
@@ -146,7 +146,7 @@ public class ZUGFeRDExporter implements Closeable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getPrefixForVersion(int ver) {
|
public String getPrefixForVersion(int ver) {
|
||||||
if (isFacturX) {
|
if (isFacturX) {
|
||||||
return "fx";
|
return "fx";
|
||||||
} else {
|
} else {
|
||||||
@@ -154,7 +154,7 @@ public class ZUGFeRDExporter implements Closeable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFilenameForVersion(int ver) {
|
public String getFilenameForVersion(int ver) {
|
||||||
if (isFacturX) {
|
if (isFacturX) {
|
||||||
return "factur-x.xml";
|
return "factur-x.xml";
|
||||||
} else {
|
} else {
|
||||||
@@ -498,13 +498,13 @@ public class ZUGFeRDExporter implements Closeable {
|
|||||||
|
|
||||||
if (attachZUGFeRDHeaders) {
|
if (attachZUGFeRDHeaders) {
|
||||||
XMPSchemaZugferd zf = new XMPSchemaZugferd(metadata, profile,
|
XMPSchemaZugferd zf = new XMPSchemaZugferd(metadata, profile,
|
||||||
ZUGFeRDExporter.getNamespaceForVersion(ZFVersion), ZUGFeRDExporter.getPrefixForVersion(ZFVersion),
|
getNamespaceForVersion(ZFVersion), getPrefixForVersion(ZFVersion),
|
||||||
ZUGFeRDExporter.getFilenameForVersion(ZFVersion));
|
getFilenameForVersion(ZFVersion));
|
||||||
|
|
||||||
metadata.addSchema(zf);
|
metadata.addSchema(zf);
|
||||||
}
|
}
|
||||||
|
|
||||||
XMPSchemaPDFAExtensions pdfaex = new XMPSchemaPDFAExtensions(metadata, ZFVersion, attachZUGFeRDHeaders);
|
XMPSchemaPDFAExtensions pdfaex = new XMPSchemaPDFAExtensions(this, metadata, ZFVersion, attachZUGFeRDHeaders);
|
||||||
pdfaex.setZUGFeRDVersion(ZFVersion);
|
pdfaex.setZUGFeRDVersion(ZFVersion);
|
||||||
metadata.addSchema(pdfaex);
|
metadata.addSchema(pdfaex);
|
||||||
|
|
||||||
|
|||||||
@@ -506,6 +506,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
|||||||
assertEquals(zi.getForeignReference(), getNumber());
|
assertEquals(zi.getForeignReference(), getNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void testFXExport() throws Exception {
|
public void testFXExport() throws Exception {
|
||||||
|
|
||||||
final String TARGET_PDF = "./target/testout-MustangGnuaccountingBeispielRE-20171118_506fx.pdf";
|
final String TARGET_PDF = "./target/testout-MustangGnuaccountingBeispielRE-20171118_506fx.pdf";
|
||||||
|
|||||||
Reference in New Issue
Block a user