Docx4jProperties.getProperties().getProperty("docx4j.dc.write", "false"));
if (dcWrite) {
// p.setSourcePartStore(sourcePartStore);
CoreProperties cp = ((DocPropsCorePart)part).getJaxbElement();
// Only set creator if not already present
String creator= Docx4jProperties.getProperties().getProperty("docx4j.dc.creator.value", "docx4j");
if (cp.getCreator()==null) {
org.docx4j.docProps.core.dc.elements.ObjectFactory of = new org.docx4j.docProps.core.dc.elements.ObjectFactory();
cp.setCreator(of.createSimpleLiteral() );
cp.getCreator().getContent().add(creator);
}
String modifier= Docx4jProperties.getProperties().getProperty("docx4j.dc.lastModifiedBy.value", "docx4j");
cp.setLastModifiedBy(modifier);
// p.setSourcePartStore(targetPartStore);
}
}
if (part instanceof DocPropsExtendedPart) {
boolean appWrite= Boolean.parseBoolean(
Docx4jProperties.getProperties().getProperty("docx4j.App.write", "false"));
if (appWrite) {
// p.setSourcePartStore(sourcePartStore);
Properties cp = ((DocPropsExtendedPart)part).getJaxbElement();
cp.setApplication(
Docx4jProperties.getProperties().getProperty("docx4j.Application", "docx4j")
);
String version = Docx4jProperties.getProperties().getProperty("docx4j.AppVersion");
if ( version!=null ) {
cp.setAppVersion(version);
}
// p.setSourcePartStore(targetPartStore);
}
}