Examples of RelationshipsPart


Examples of org.docx4j.openpackaging.parts.relationships.RelationshipsPart

   
    fontsDiscovered.add(
        runFontSelector.getDefaultFont() );
   
    // fonts in headers, footers?
    RelationshipsPart rp = this.getRelationshipsPart();
    if (rp!=null) {
      for ( Relationship r : rp.getRelationships().getRelationship() ) {
        Part part = rp.getPart(r);
        if ( part instanceof FooterPart ) {
         
          Ftr ftr = ((FooterPart)part).getJaxbElement();
          finder.walkJAXBElements(ftr);
         
View Full Code Here

Examples of org.docx4j.openpackaging.parts.relationships.RelationshipsPart

   
    new TraversalUtil(bodyChildren, finder);
    finder.finish();
   
    // Styles in headers, footers?
    RelationshipsPart rp = this.getRelationshipsPart();
    if (rp!=null) {
      for ( Relationship r : rp.getRelationships().getRelationship() ) {
        Part part = rp.getPart(r);
        if ( part instanceof FooterPart ) {
         
          Ftr ftr = ((FooterPart)part).getJaxbElement();
          finder.walkJAXBElements(ftr);
         
View Full Code Here

Examples of org.docx4j.openpackaging.parts.relationships.RelationshipsPart

      getHyperlinkResolver().activateHyperlinkStyle(wordMLPackage);

      applyBindings(wordMLPackage.getMainDocumentPart());
 
      // Add headers/footers
      RelationshipsPart rp = wordMLPackage.getMainDocumentPart()
          .getRelationshipsPart();
      for (Relationship r : rp.getRelationships().getRelationship()) {
 
        if (r.getType().equals(Namespaces.HEADER)) {
          applyBindings((HeaderPart) rp.getPart(r));
        } else if (r.getType().equals(Namespaces.FOOTER)) {
          applyBindings((FooterPart) rp.getPart(r));
        }
      }
    }
View Full Code Here

Examples of org.docx4j.openpackaging.parts.relationships.RelationshipsPart

  private void findSdtsInTemplate(WordprocessingMLPackage pkg, TopLevelSdtTemplateFinder sdtPrFinder) throws Docx4JException {

    findSdtsInTemplatePart(pkg.getMainDocumentPart(), sdtPrFinder);

    // Add headers/footers
    RelationshipsPart rp = pkg.getMainDocumentPart()
        .getRelationshipsPart();
    for (Relationship r : rp.getRelationships().getRelationship()) {

      if (r.getType().equals(Namespaces.HEADER)) {
        findSdtsInTemplatePart((HeaderPart) rp.getPart(r), sdtPrFinder);
      } else if (r.getType().equals(Namespaces.FOOTER)) {
        findSdtsInTemplatePart((FooterPart) rp.getPart(r), sdtPrFinder);
      }
    }
  }
View Full Code Here

Examples of org.docx4j.openpackaging.parts.relationships.RelationshipsPart

  private void handleSdtsInInstance() throws Docx4JException {

    handleSdtsInInstancePart(instancePkg.getMainDocumentPart());

    // Add headers/footers
    RelationshipsPart rp = instancePkg.getMainDocumentPart()
        .getRelationshipsPart();
    for (Relationship r : rp.getRelationships().getRelationship()) {

      if (r.getType().equals(Namespaces.HEADER)) {
        handleSdtsInInstancePart((HeaderPart) rp.getPart(r));
      } else if (r.getType().equals(Namespaces.FOOTER)) {
        handleSdtsInInstancePart((FooterPart) rp.getPart(r));
      }
    }
  }
View Full Code Here

Examples of org.docx4j.openpackaging.parts.relationships.RelationshipsPart

   
    if (printContentTypes)
      printContentTypes(opcPackage);
   
    // List the parts by walking the rels tree
    RelationshipsPart rp = opcPackage.getRelationshipsPart();
    StringBuilder sb = new StringBuilder();
    printInfo(rp, sb, "");
    traverseRelationships(opcPackage, rp, sb, "    ");
   
    System.out.println(sb.toString());
View Full Code Here

Examples of org.docx4j.openpackaging.parts.relationships.RelationshipsPart

      // http://forums.opendope.org/Support-components-in-headers-footers-tp2964174p2964174.html
     
      process(wordMLPackage.getMainDocumentPart());
 
      // Add headers/footers
      RelationshipsPart rp = wordMLPackage.getMainDocumentPart()
          .getRelationshipsPart();
      for (Relationship r : rp.getRelationships().getRelationship()) {
 
        if (r.getType().equals(Namespaces.HEADER)) {
          process((HeaderPart) rp.getPart(r));
        } else if (r.getType().equals(Namespaces.FOOTER)) {
          process((FooterPart) rp.getPart(r));
        }
      }
    }
View Full Code Here

Examples of org.docx4j.openpackaging.parts.relationships.RelationshipsPart


                removeSDTs(wordMLPackage.getMainDocumentPart(), quantifier, keys);

                // Add headers/footers
                RelationshipsPart rp = wordMLPackage.getMainDocumentPart()
                                .getRelationshipsPart();
                for (Relationship r : rp.getRelationships().getRelationship()) {

                        if (r.getType().equals(Namespaces.HEADER)) {
                                removeSDTs((HeaderPart) rp.getPart(r), quantifier, keys);
                        } else if (r.getType().equals(Namespaces.FOOTER)) {
                                removeSDTs((FooterPart) rp.getPart(r), quantifier, keys);
                        }
                }
        }
View Full Code Here

Examples of org.docx4j.openpackaging.parts.relationships.RelationshipsPart

  /** Default build method, get's called with a P.Hyperlink.
   */
  public void build(AbstractWmlConversionContext conversionContext, Object node, Node content) throws TransformerException {
   
    Relationship relationship = null;
    RelationshipsPart rPart = null;
    P.Hyperlink pHyperlink = (P.Hyperlink)node;
   
//    log.debug(XmlUtils.marshaltoString(hyperlink, true, true));
   
    this.content = content;
    setAnchor(pHyperlink.getAnchor());
    setDocLocation(pHyperlink.getDocLocation());
    setRId(pHyperlink.getId());
    setTgtFrame(pHyperlink.getTgtFrame());
    setTooltip(pHyperlink.getTooltip());
    if (conversionContext.getCurrentPart() == null) {
      log.warn("set currentPart (via conversionContext)");
    } else if ((getRId() != null) &&
      (getRId().length() > 0) ) {
      rPart = conversionContext.getCurrentPart().getRelationshipsPart();
      if (rPart == null) {
        log.error("RelationshipsPart is missing!");       
      } else {
        log.debug("looking for rel" + getRId());
        relationship = rPart.getRelationshipByID(getRId());
        if ((relationship != null) &&
          (Namespaces.HYPERLINK.equals(relationship.getType()))) {
          setTarget(relationship.getTarget());
          setExternal("External".equals(relationship.getTargetMode()));
        }
View Full Code Here

Examples of org.docx4j.openpackaging.parts.relationships.RelationshipsPart

   * you'll need to call this method in order for the changes to be
   * reflected in the DocumentModel.
   */
  public void refresh() {
   
    RelationshipsPart rels = wordMLPackage.getMainDocumentPart().getRelationshipsPart();
       
    Document doc = (Document)wordMLPackage.getMainDocumentPart().getJaxbElement();
   
    HeaderFooterPolicy previousHF = null;
    BooleanDefaultTrue evenAndOddHeaders = null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.