Package org.docx4j.docProps.core

Examples of org.docx4j.docProps.core.CoreProperties


        if (part instanceof DocPropsCorePart) {
         
          boolean dcWrite= Boolean.parseBoolean(
              Docx4jProperties.getProperties().getProperty("docx4j.dc.write", "false"));
          if (dcWrite) {         
            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);
          }
        }       
        if (part instanceof DocPropsExtendedPart) {
          boolean appWrite= Boolean.parseBoolean(
              Docx4jProperties.getProperties().getProperty("docx4j.App.write", "false"));
          if (appWrite) {
            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);
            }
           
          }
        }
View Full Code Here


              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);           
          }
        }
View Full Code Here

TOP

Related Classes of org.docx4j.docProps.core.CoreProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.