/** * Convenience method to getBody().getContent() * @since 2.7 */ public List<Object> getContent() { return getBody().getContent(); }
/** The dummy section wrappers only contains one section with all the document. Therefore * any sections within the document are ignored in the conversion process. As it doesn't * need to check for sections it is faster and the html-Output only uses one section.<br> * It will use the Header/Footer of the body sectPr. This isn't correct, if there are * several Sections in the document, but to find the correct SectPr it would need to check * the document content - and the aim of this method is a low overhead. * * @param wmlPackage * @param dummyPageNumbering * @return */ protected static List<ConversionSectionWrapper> processDummy(WordprocessingMLPackage wmlPackage, Document document, RelationshipsPart rels, BooleanDefaultTrue evenAndOddHeaders, boolean dummyPageNumbering) { log.debug("starting"); List<ConversionSectionWrapper> conversionSections = new ArrayList<ConversionSectionWrapper>(); ConversionSectionWrapper currentSectionWrapper = null; HeaderFooterPolicy previousHF = new HeaderFooterPolicy(document.getBody().getSectPr(), null, rels, evenAndOddHeaders); // SectionWrapper does work where sectPr is null (ie document has no body level sectPr), // so document.getBody().getSectPr() is ok currentSectionWrapper = createSectionWrapper( document.getBody().getSectPr(), previousHF, rels, evenAndOddHeaders, 1, document.getBody().getContent(), dummyPageNumbering); conversionSections.add(currentSectionWrapper); return conversionSections; }
/** * If the first w:p starts with a w:sectPr, this is moved into a * new following w:p. This prevents the creation of an empty fo:flow, * which causes a validation exception in FOP. */ public static void process(WordprocessingMLPackage wmlPackage) { Body body = wmlPackage.getMainDocumentPart().getJaxbElement().getBody(); moveSectPr(body); }
/** * If a page-break w:br w:type="page" is found within a run with some formatting applied to it * then it will be generated into an fo:inline tag. This page break will be ignored by fop. This class * moves the page-breaks to the enclosing block. */ public static void process(WordprocessingMLPackage wmlPackage) { Body body = wmlPackage.getMainDocumentPart().getJaxbElement().getBody(); //TODO: Convert to visitor movePageBreaks(body); }
for (Object o : document.getBody().getContent() ) { if (document.getBody().getSectPr()!=null) { sectPrs.add(document.getBody().getSectPr()); List<Object> all = document.getBody().getContent(); Object last = all.get( all.size()-1 ); if (last instanceof P document.getBody().setSectPr(thisSectPr); ((P) last).getPPr().setSectPr(null); sectPrs.remove(thisSectPr); document.getBody().setSectPr(Context.getWmlObjectFactory().createSectPr()); sectPrs.add(document.getBody().getSectPr());
private void process() { propertyResolver = wmlPackage.getMainDocumentPart().getPropertyResolver(); List<Object> newContent = process(wmlPackage.getMainDocumentPart().getContent()); wmlPackage.getMainDocumentPart().getJaxbElement().getBody().getContent().clear(); wmlPackage.getMainDocumentPart().getJaxbElement().getBody().getContent().addAll(newContent); }
public static void process(WordprocessingMLPackage wmlPackage) { Body body = wmlPackage.getMainDocumentPart().getJaxbElement().getBody(); if (body==null || body.getContent().size()==0) { log.warn("w:document/w:body null or empty"); return; } Object o = body.getContent().get(0); if (o instanceof P && ((P)o).getPPr()!=null) { PPr pPr = ((P)o).getPPr(); BooleanDefaultTrue val = new BooleanDefaultTrue(); val.setVal(Boolean.FALSE); pPr.setPageBreakBefore(val); } } }
Body body = wmlDocumentEl.getBody();
clone.getMainDocumentPart().getJaxbElement().getBody().setSectPr(null);
= new SingleTraversalUtilVisitorCallback(visitor); ccFinder.walkJAXBElements( wordMLPackage.getMainDocumentPart().getJaxbElement().getBody()); if (visitor.customXmlDataStoragePart==null) { log.error("FATAL. Couldn't find CustomXmlDataStoragePart " );
Body body = wmlDocumentEl.getBody();
groupAdjacentBorders(mainDocument.getJaxbElement().getBody().getContent());
callback.walkJAXBElements(mainDocument.getJaxbElement().getBody()); if (!bodyOnly) { relPart = mainDocument.getRelationshipsPart();
Body body = wmlDocumentEl.getBody();
Body body = wmlDocumentEl.getBody();
SectPr sectPr = template.getMainDocumentPart().getJaxbElement().getBody().getSectPr();
/** * Convenience method to getJaxbElement().getBody().getContent() * @since 2.7 */ public List<Object> getContent() { if (this.getJaxbElement()==null) { this.setJaxbElement( Context.getWmlObjectFactory().createDocument() ); } if (this.getJaxbElement().getBody()==null) { this.getJaxbElement().setBody( Context.getWmlObjectFactory().createBody() ); } return this.getJaxbElement().getContent(); }
Body body = wmlDocumentEl.getBody();
Body body = wmlDocumentEl.getBody();