/** * This is what needs to be added to the RDF metadata - basically the name of the embedded * Zugferd file * */ public XMPSchemaZUGFeRD(org.apache.jempbox.xmp.XMPMetadata parent, String conformanceLevel = null) : base(parent) { if (conformanceLevel != null) { this.conformanceLevel = conformanceLevel; } schema.setAttributeNS(NS_NAMESPACE, "xmlns:zf", //$NON-NLS-1$ "urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0#"); //$NON-NLS-1$ // the superclass includes this two namespaces we don't need schema.removeAttributeNS(NS_NAMESPACE, "xapGImg"); //$NON-NLS-1$ schema.removeAttributeNS(NS_NAMESPACE, "xmp"); //$NON-NLS-1$ Element textNode = schema.getOwnerDocument().createElement( "zf:DocumentType"); //$NON-NLS-1$ XMLUtil.setStringValue(textNode, "INVOICE"); //$NON-NLS-1$ schema.appendChild(textNode); textNode = schema.getOwnerDocument().createElement( "zf:DocumentFileName"); //$NON-NLS-1$ XMLUtil.setStringValue(textNode, "ZUGFeRD-invoice.xml"); //$NON-NLS-1$ schema.appendChild(textNode); textNode = schema.getOwnerDocument().createElement("zf:Version"); //$NON-NLS-1$ XMLUtil.setStringValue(textNode, "1.0"); //$NON-NLS-1$ schema.appendChild(textNode); textNode = schema.getOwnerDocument().createElement( "zf:ConformanceLevel"); //$NON-NLS-1$ XMLUtil.setStringValue(textNode, this.conformanceLevel); //$NON-NLS-1$ schema.appendChild(textNode); }
public XMPSchemaPDFAExtensions(org.apache.jempbox.xmp.XMPMetadata parent) : base(parent) { // add some namespaces schema.setAttributeNS(NS_NAMESPACE, "xmlns:pdfaExtension", //$NON-NLS-1$ "http://www.aiim.org/pdfa/ns/extension/"); //$NON-NLS-1$ schema.setAttributeNS(NS_NAMESPACE, "xmlns:pdfaSchema", //$NON-NLS-1$ "http://www.aiim.org/pdfa/ns/schema#"); //$NON-NLS-1$ schema.setAttributeNS(NS_NAMESPACE, "xmlns:pdfaProperty", //$NON-NLS-1$ "http://www.aiim.org/pdfa/ns/property#"); //$NON-NLS-1$ // the superclass includes this two namespaces we don't need schema.removeAttributeNS(NS_NAMESPACE, "xapGImg"); //$NON-NLS-1$ schema.removeAttributeNS(NS_NAMESPACE, "xmp"); //$NON-NLS-1$ /* * What we attach is basically this: * pdfaExtension:schemas-node *+--bag * +--rdf:li * +--some text node (multiple) * +--property node * +--rdf:Seq * +--rdf:li (multiple) attribute node * +--some attribute property description text node (multiple) */ Element schemasNode = schema.getOwnerDocument().createElement( "pdfaExtension:schemas"); //$NON-NLS-1$ Element bagNode = schema.getOwnerDocument() .createElement("rdf:Bag"); //$NON-NLS-1$ Element bagListNode = schema.getOwnerDocument().createElement( "rdf:li"); //$NON-NLS-1$ bagListNode.setAttribute("rdf:parseType", "Resource"); //$NON-NLS-1$ //$NON-NLS-2$ Element schemaInfoNode = schema.getOwnerDocument().createElement( "pdfaSchema:schema"); //$NON-NLS-1$ XMLUtil.setStringValue(schemaInfoNode, "ZUGFeRD PDFA Extension Schema"); //$NON-NLS-1$ bagListNode.appendChild(schemaInfoNode); Element nsInfoNode = schema.getOwnerDocument().createElement( "pdfaSchema:namespaceURI"); //$NON-NLS-1$ XMLUtil.setStringValue(nsInfoNode, "urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0#"); //$NON-NLS-1$ bagListNode.appendChild(nsInfoNode); Element prefixInfoNode = schema.getOwnerDocument().createElement( "pdfaSchema:prefix"); //$NON-NLS-1$ XMLUtil.setStringValue(prefixInfoNode, "zf"); //$NON-NLS-1$ bagListNode.appendChild(prefixInfoNode); Element propertyNode = schema.getOwnerDocument().createElement( "pdfaSchema:property"); //$NON-NLS-1$ Element valueTypeNode = schema.getOwnerDocument().createElement( "pdfaSchema:valueType"); //$NON-NLS-1$ Element seqListValueType = schema.getOwnerDocument().createElement( "rdf:Seq"); //$NON-NLS-1$ Element sequenceNode = schema.getOwnerDocument().createElement( "rdf:Seq"); //$NON-NLS-1$ Element seqList1Node = schema.getOwnerDocument().createElement( "rdf:li"); //$NON-NLS-1$ seqList1Node.setAttribute("rdf:parseType", "Resource"); //$NON-NLS-1$ //$NON-NLS-2$ addProperty(seqList1Node, "DocumentFileName", "Text", "external", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ "The name of the embedded Zugferd XML invoice file"); //$NON-NLS-1$ sequenceNode.appendChild(seqList1Node); Element seqList2Node = schema.getOwnerDocument().createElement( "rdf:li"); //$NON-NLS-1$ seqList2Node.setAttribute("rdf:parseType", "Resource"); //$NON-NLS-1$ //$NON-NLS-2$ addProperty(seqList2Node, "DocumentType", "Text", "external", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ "INVOICE"); //$NON-NLS-1$ sequenceNode.appendChild(seqList2Node); Element seqList3Node = schema.getOwnerDocument().createElement( "rdf:li"); //$NON-NLS-1$ seqList3Node.setAttribute("rdf:parseType", "Resource"); //$NON-NLS-1$ //$NON-NLS-2$ addProperty(seqList3Node, "Version", "Text", "external", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ "The version of the ZUGFeRD data"); //$NON-NLS-1$ sequenceNode.appendChild(seqList3Node); Element seqList4Node = schema.getOwnerDocument().createElement( "rdf:li"); //$NON-NLS-1$ seqList4Node.setAttribute("rdf:parseType", "Resource"); //$NON-NLS-1$ //$NON-NLS-2$ addProperty(seqList4Node, "ConformanceLevel", "Text", "external", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ "The conformance level of the ZUGFeRD data, i.e. BASIC or EXTENDED"); //$NON-NLS-1$ sequenceNode.appendChild(seqList4Node); propertyNode.appendChild(sequenceNode); bagListNode.appendChild(propertyNode); valueTypeNode.appendChild(seqListValueType); bagListNode.appendChild(valueTypeNode); bagNode.appendChild(bagListNode); schemasNode.appendChild(bagNode); schema.appendChild(schemasNode); }