protected String addPropertiesPart(WordprocessingMLPackage pkgOut, Part customXmlDataStoragePart, String ns) throws InvalidFormatException { CustomXmlDataStoragePropertiesPart part = new CustomXmlDataStoragePropertiesPart(); org.docx4j.customXmlProperties.ObjectFactory of = new org.docx4j.customXmlProperties.ObjectFactory(); DatastoreItem dsi = of.createDatastoreItem(); String newItemId = "{" + UUID.randomUUID().toString().toUpperCase() + "}"; dsi.setItemID(newItemId); if (ns!=null) { SchemaRefs srefs = of.createSchemaRefs(); dsi.setSchemaRefs(srefs); SchemaRef sref = of.createSchemaRefsSchemaRef(); sref.setUri(ns); srefs.getSchemaRef().add(sref); } part.setJaxbElement(dsi); customXmlDataStoragePart.addTargetPart(part, AddPartBehaviour.RENAME_IF_NAME_EXISTS); pkgOut.getCustomXmlDataStorageParts().put(newItemId.toLowerCase(), (CustomXmlPart)customXmlDataStoragePart); return newItemId; }
public String getItemId() { return ((DatastoreItem)this.getJaxbElement()).getItemID(); } }
public CustomXmlDataStoragePropertiesPart(PartName partName) throws InvalidFormatException { super(partName); init(); }
public void init() { // Used if this Part is added to [Content_Types].xml setContentType(new org.docx4j.openpackaging.contenttype.ContentType( org.docx4j.openpackaging.contenttype.ContentTypes.OFFICEDOCUMENT_CUSTOMXML_DATASTORAGEPROPERTIES)); // Used when this Part is added to a rels setRelationshipType(Namespaces.CUSTOM_XML_DATA_STORAGE_PROPERTIES); this.setJAXBContext(Context.jcCustomXmlProperties); }
/** * @since 3.0.2 */ public String getItemId() { if (this.getRelationshipsPart()==null) { return null; } else { // Look in its rels for rel of @Type customXmlProps (eg @Target="itemProps1.xml") Relationship r = this.getRelationshipsPart().getRelationshipByType( Namespaces.CUSTOM_XML_DATA_STORAGE_PROPERTIES); if (r==null) { log.warn(".. but that doesn't point to a customXmlProps part"); return null; } CustomXmlDataStoragePropertiesPart customXmlProps = (CustomXmlDataStoragePropertiesPart)this.getRelationshipsPart().getPart(r); if (customXmlProps==null) { log.warn(".. but the target seems to be missing?"); return null; } else { return customXmlProps.getItemId().toLowerCase(); } } }
public Part CreateCustomXmlDataStoragePropertiesPartObject(String partName) throws InvalidFormatException { return new CustomXmlDataStoragePropertiesPart(new PartName(partName)); }
public void init() { // Used if this Part is added to [Content_Types].xml setContentType(new org.docx4j.openpackaging.contenttype.ContentType( org.docx4j.openpackaging.contenttype.ContentTypes.OFFICEDOCUMENT_CUSTOMXML_DATASTORAGEPROPERTIES)); // Used when this Part is added to a rels setRelationshipType(Namespaces.CUSTOM_XML_DATA_STORAGE_PROPERTIES); this.setJAXBContext(Context.jcCustomXmlProperties); }
/** * @since 3.0.2 */ public String getItemId() { if (this.getRelationshipsPart()==null) { return null; } else { // Look in its rels for rel of @Type customXmlProps (eg @Target="itemProps1.xml") Relationship r = this.getRelationshipsPart().getRelationshipByType( Namespaces.CUSTOM_XML_DATA_STORAGE_PROPERTIES); if (r==null) { log.warn(".. but that doesn't point to a customXmlProps part"); return null; } CustomXmlDataStoragePropertiesPart customXmlProps = (CustomXmlDataStoragePropertiesPart)this.getRelationshipsPart().getPart(r); if (customXmlProps==null) { log.warn(".. but the target seems to be missing?"); return null; } else { return customXmlProps.getItemId().toLowerCase(); } } }
public Part CreateCustomXmlDataStoragePropertiesPartObject(String partName) throws InvalidFormatException { return new CustomXmlDataStoragePropertiesPart(new PartName(partName)); }
protected String addPropertiesPart(WordprocessingMLPackage pkgOut, Part customXmlDataStoragePart, String ns) throws InvalidFormatException { CustomXmlDataStoragePropertiesPart part = new CustomXmlDataStoragePropertiesPart(); org.docx4j.customXmlProperties.ObjectFactory of = new org.docx4j.customXmlProperties.ObjectFactory(); DatastoreItem dsi = of.createDatastoreItem(); String newItemId = "{" + UUID.randomUUID().toString().toUpperCase() + "}"; dsi.setItemID(newItemId); if (ns!=null) { SchemaRefs srefs = of.createSchemaRefs(); dsi.setSchemaRefs(srefs); SchemaRef sref = of.createSchemaRefsSchemaRef(); sref.setUri(ns); srefs.getSchemaRef().add(sref); } part.setJaxbElement(dsi); customXmlDataStoragePart.addTargetPart(part, AddPartBehaviour.RENAME_IF_NAME_EXISTS); pkgOut.getCustomXmlDataStorageParts().put(newItemId.toLowerCase(), (CustomXmlPart)customXmlDataStoragePart); return newItemId; }
itemId = customXmlProps.getItemId().toLowerCase();
public CustomXmlDataStoragePropertiesPart() throws InvalidFormatException { super(new PartName("/customXML/itemProps1.xml")); init(); }
public String getItemId() { return ((DatastoreItem)this.getJaxbElement()).getItemID(); } }
/** * @since 3.0.2 */ public String getItemId() { if (this.getRelationshipsPart()==null) { return null; } else { // Look in its rels for rel of @Type customXmlProps (eg @Target="itemProps1.xml") Relationship r = this.getRelationshipsPart().getRelationshipByType( Namespaces.CUSTOM_XML_DATA_STORAGE_PROPERTIES); if (r==null) { log.warn(".. but that doesn't point to a customXmlProps part"); return null; } CustomXmlDataStoragePropertiesPart customXmlProps = (CustomXmlDataStoragePropertiesPart)this.getRelationshipsPart().getPart(r); if (customXmlProps==null) { log.warn(".. but the target seems to be missing?"); return null; } else { return customXmlProps.getItemId().toLowerCase(); } } }
public CustomXmlDataStoragePropertiesPart(PartName partName) throws InvalidFormatException { super(partName); init(); }
/** * @since 3.0.2 */ public String getItemId() { if (this.getRelationshipsPart()==null) { return null; } else { // Look in its rels for rel of @Type customXmlProps (eg @Target="itemProps1.xml") Relationship r = this.getRelationshipsPart().getRelationshipByType( Namespaces.CUSTOM_XML_DATA_STORAGE_PROPERTIES); if (r==null) { log.warn(".. but that doesn't point to a customXmlProps part"); return null; } CustomXmlDataStoragePropertiesPart customXmlProps = (CustomXmlDataStoragePropertiesPart)this.getRelationshipsPart().getPart(r); if (customXmlProps==null) { log.warn(".. but the target seems to be missing?"); return null; } else { return customXmlProps.getItemId().toLowerCase(); } } }
public CustomXmlDataStoragePropertiesPart() throws InvalidFormatException { super(new PartName("/customXML/itemProps1.xml")); init(); }
itemId = customXmlProps.getItemId().toLowerCase();