Package org.docx4j.openpackaging.parts.opendope

Examples of org.docx4j.openpackaging.parts.opendope.XPathsPart


     
      if (pkg instanceof WordprocessingMLPackage) {
        getHyperlinkResolver().activateHyperlinkStyle((WordprocessingMLPackage)pkg);
      }
           
      XPathsPart xPathsPart = null;
     
      if ( ((WordprocessingMLPackage)pkg).getMainDocumentPart().getXPathsPart() == null) {
        log.warn("OpenDoPE XPaths part missing"); // OK if no OpenDoPE stuff is used
      } else {
        xPathsPart = ((WordprocessingMLPackage)pkg).getMainDocumentPart().getXPathsPart();
View Full Code Here


   
    // We need to lookup the XPaths part.
    // In principle, that part should be identical in both
    // openDopePkg and instancePkg.
    // We'll get it from instancePkg
    XPathsPart xPathsPart = ((WordprocessingMLPackage)instancePkg).getMainDocumentPart().getXPathsPart();
    if ( xPathsPart==null) {
      throw new Docx4JException("OpenDoPE XPaths part missing");
    }
   
    for ( Object entry : instanceSdtPrFinder.boundSdtPotentialRepair ) {
     
      // If the SDT was made to contain a w:hyperlink, we had to remove:
      //   <w:dataBinding w:storeItemID="{5448916C-134B-45E6-B8FE-88CC1FFC17C3}" w:xpath="/myxml[1]/element2[1]" w:prefixMappings=""/>
      //   <w:text w:multiLine="true"/>
      // Now we need to add those back in
      SdtElement sdt = (SdtElement)entry;
      SdtPr sdtPr = sdt.getSdtPr();
     
      if (sdtPr.getDataBinding()==null ) {
       
        // Identify xpathId
        Tag tag = sdtPr.getTag();
        HashMap<String, String> map = QueryString.parseQueryString(tag.getVal(), true);
        String xpathId= map.get(OpenDoPEHandler.BINDING_ROLE_XPATH);
       
        // Look up - throws InputIntegrityException if not found
        Xpath xp = xPathsPart.getXPathById(xpathId);
         
          // Create object for dataBinding
          CTDataBinding databinding = Context.getWmlObjectFactory().createCTDataBinding();
          sdtPr.setDataBinding(databinding);
              databinding.setXpath( xp.getDataBinding().getXpath());
View Full Code Here

    ConditionsPart conditionsPart = new ConditionsPart(new PartName("/customXml/item1.xml")); // name doesn't matter
    pkgOut.getMainDocumentPart().addTargetPart(conditionsPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // Word will silently drop the CXPs if they aren't added to the MDP!
    addPropertiesPart(conditionsPart, "http://opendope.org/conditions");
    conditionsPart.setJaxbElement(new Conditions());
    // .. XPaths
    xPathsPart = new XPathsPart(new PartName("/customXml/item1.xml"));
    pkgOut.getMainDocumentPart().addTargetPart(xPathsPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS);
    addPropertiesPart(xPathsPart, "http://opendope.org/xpaths");
    xPathsPart.setJaxbElement(new Xpaths());
    // .. Questions
    questionsPart = new QuestionsPart(new PartName("/customXml/item1.xml"));
View Full Code Here

              ((ConditionsPart)part).setJaxbElement(
                  (org.opendope.conditions.Conditions)o);             
             
            } else if (o instanceof org.opendope.xpaths.Xpaths) {
             
              part = new XPathsPart(name);
              ((XPathsPart)part).setJaxbElement(
                  (org.opendope.xpaths.Xpaths)o);

            } else if (o instanceof org.opendope.questions.Questionnaire) {
             
View Full Code Here

                  (org.opendope.conditions.Conditions)o);
             
             
            } else if (o instanceof org.opendope.xpaths.Xpaths) {
             
              part = new XPathsPart(name);
              ((XPathsPart)part).setJaxbElement(
                  (org.opendope.xpaths.Xpaths)o);

            } else if (o instanceof org.opendope.questions.Questionnaire) {
             
View Full Code Here

                  (org.opendope.conditions.Conditions)o);
             
             
            } else if (o instanceof org.opendope.xpaths.Xpaths) {
             
              part = new XPathsPart(name);
              ((XPathsPart)part).setJaxbElement(
                  (org.opendope.xpaths.Xpaths)o);
                           
            } else if (o instanceof org.opendope.questions.Questionnaire) {
             
View Full Code Here

                  (org.opendope.conditions.Conditions)o);
             
             
            } else if (o instanceof org.opendope.xpaths.Xpaths) {
             
              part = new XPathsPart(name);
              ((XPathsPart)part).setJaxbElement(
                  (org.opendope.xpaths.Xpaths)o);
                           
            } else if (o instanceof org.opendope.questions.Questionnaire) {
             
View Full Code Here

TOP

Related Classes of org.docx4j.openpackaging.parts.opendope.XPathsPart

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.