protected static void process(FooterPart footer, FieldVisitor fldVisitor) { if ((footer != null) && (!footer.getContent().isEmpty())) { TraversalUtil.visit(footer.getContent(), fldVisitor); } }
private void createDummyHeaderFooter() { synchronized (dummyHeaderFooterMutex) { if (dummyHeader == null) { ObjectFactory factory = new ObjectFactory(); try { dummyHeader = new HeaderPart(new PartName("/word/dummyheader.xml")); dummyFooter = new FooterPart(new PartName("/word/dummyfooter.xml")); } catch (InvalidFormatException e) { //should not happen } dummyHeader.setJaxbElement(factory.createHdr()); dummyHeader.getJaxbElement().getContent().add(factory.createP()); dummyFooter.setJaxbElement(factory.createFtr()); dummyFooter.getJaxbElement().getContent().add(factory.createP()); } } }
public FooterPart(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.WORDPROCESSINGML_FOOTER)); // Used when this Part is added to a rels setRelationshipType(Namespaces.FOOTER); }
/** * Convenience method to getJaxbElement().getBody().getContent() * @since 2.7 */ public List<Object> getContent() { if (this.getJaxbElement()==null) { this.setJaxbElement( Context.getWmlObjectFactory().createFtr() ); } return this.getJaxbElement().getContent(); }
@Override public String getMceIgnorable() { return this.getJaxbElement().getIgnorable(); }
public Part CreateFooterPartObject(String partName) throws InvalidFormatException { return new FooterPart(new PartName(partName)); }
@Override protected void setMceIgnorable(McIgnorableNamespaceDeclarator namespacePrefixMapper) { // NB if you add ignorable content, it is up to you to jaxbElement.setIgnorable correctly; see further McIgnorableNamespaceDeclarator // You don't need to worry about this if you are merely loading an existing part. namespacePrefixMapper.setMcIgnorable( this.getJaxbElement().getIgnorable() ); }
/** * Convenience method to getJaxbElement().getBody().getContent() * @since 2.7 */ public List<Object> getContent() { if (this.getJaxbElement()==null) { this.setJaxbElement( Context.getWmlObjectFactory().createFtr() ); } return this.getJaxbElement().getContent(); }
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.WORDPROCESSINGML_FOOTER)); // Used when this Part is added to a rels setRelationshipType(Namespaces.FOOTER); }
clonedPart.setJaxbElement(Context.getWmlObjectFactory().createHdr()); } else if (part instanceof FooterPart) { clonedPart = new FooterPart(); clonedPart.setJaxbElement(Context.getWmlObjectFactory().createFtr());
protected static void process(FooterPart footer, FieldVisitor fldVisitor) { if ((footer != null) && (!footer.getContent().isEmpty())) { TraversalUtil.visit(footer.getContent(), fldVisitor); } }
public static Node getEvenFooter(AbstractWmlConversionContext context) { ConversionSectionWrapper currentSection = context.getSections().getCurrentSection(); Ftr ftr = (Ftr)currentSection.getHeaderFooterPolicy().getEvenFooter().getJaxbElement(); return XmlUtils.marshaltoW3CDomDocument(ftr); }
private void createDummyHeaderFooter() { synchronized (dummyHeaderFooterMutex) { if (dummyHeader == null) { ObjectFactory factory = new ObjectFactory(); try { dummyHeader = new HeaderPart(new PartName("/word/dummyheader.xml")); dummyFooter = new FooterPart(new PartName("/word/dummyfooter.xml")); } catch (InvalidFormatException e) { //should not happen } dummyHeader.setJaxbElement(factory.createHdr()); dummyHeader.getJaxbElement().getContent().add(factory.createP()); dummyFooter.setJaxbElement(factory.createFtr()); dummyFooter.getJaxbElement().getContent().add(factory.createP()); } } }
public FooterPart() throws InvalidFormatException { super(new PartName("/word/footer.xml")); // Not very useful, since normally there is more than one footer part init(); }
public Part CreateFooterPartObject(String partName) throws InvalidFormatException { return new FooterPart(new PartName(partName)); }
private void resolvedExpressionsAreReplacedInFooter(WordprocessingMLPackage document) { FooterPart footerPart = getFooterPart(document); P nameParagraph = (P) footerPart.getContent().get(1); Assert.assertEquals("In this paragraph, the variable name should be resolved to the value Homer Simpson.", new ParagraphWrapper(nameParagraph).getText()); }
public static Node getFirstFooter(AbstractWmlConversionContext context) { ConversionSectionWrapper currentSection = context.getSections().getCurrentSection(); Ftr ftr = (Ftr)currentSection.getHeaderFooterPolicy().getFirstFooter().getJaxbElement(); return XmlUtils.marshaltoW3CDomDocument(ftr); }
public FooterPart(PartName partName) throws InvalidFormatException { super(partName); init(); }
clonedPart.setJaxbElement(Context.getWmlObjectFactory().createHdr()); } else if (part instanceof FooterPart) { clonedPart = new FooterPart(); clonedPart.setJaxbElement(Context.getWmlObjectFactory().createFtr());