Package org.docx4j.openpackaging.parts

Examples of org.docx4j.openpackaging.parts.CustomXmlPart


        } else if (storeItemId.toUpperCase().equals(EXTENDED_PROPERTIES_STOREITEMID) ) {
         
          return pkg.getDocPropsExtendedPart().xpathGetString(xpath, prefixMappings);
        }
       
        CustomXmlPart part  = customXmlDataStorageParts.get(storeItemId.toLowerCase());
          // Also handles cover page properties (since we've allocated it a store item id)
          // Note that Word does not create that part until the user provides one or more prop values
       
        if (part==null) {
          throw new InputIntegrityException("Couldn't locate part by storeItemId " + storeItemId);
//          log.error("Couldn't locate part by storeItemId " + storeItemId);
//          return null;
        }
       
        String r = part.xpathGetString(xpath, prefixMappings);
        if (r==null) {
          // never expect null, since an empty result set is converted to an empty string
          log.error(xpath + " unexpectedly null!");
          return r;
        } else if (r.equals("")) {
View Full Code Here


      String storeItemId, String xpath, String prefixMappings,
      String sdtParent,
      String contentChild,
      NodeIterator dateNodeIt) {
   
    CustomXmlPart part = customXmlDataStorageParts.get(storeItemId.toLowerCase());
   
   
    if (part==null) {
      log.error("Couldn't locate part by storeItemId " + storeItemId);
      return null;
    }
   
    try {
      String r= part.xpathGetString(xpath, prefixMappings);       
      log.debug(xpath + " yielded result " + r);
      if (r==null) return nullResultParagraph(sdtParent, "[missing!]");
     
      CTSdtDate sdtDate = null;
      Node dateNode = dateNodeIt.nextNode();
View Full Code Here

  private List<Node> xpathGetNodes(
      Map<String, CustomXmlPart> customXmlDataStorageParts,
      String storeItemId, String xpath, String prefixMappings) {

    CustomXmlPart part = customXmlDataStorageParts
        .get(storeItemId.toLowerCase());
    if (part == null) {
      log.error("Couldn't locate part by storeItemId " + storeItemId);
      return null;
    }
    try {
      return part.xpathGetNodes(xpath, prefixMappings);
    } catch (Docx4JException e) {
      log.error(e.getMessage(), e);
      return null;
    }
  }
View Full Code Here

      // TODO: remove any images in package which are no longer used.
      // Needs to be done once after BindingHandler has been done
      // for all parts for which it is to be called (eg mdp, header parts etc).
     
      Map<String, CustomXmlPart> customXmlDataStorageParts = pkg.getCustomXmlDataStorageParts();
      CustomXmlPart part = customXmlDataStorageParts.get(dataBinding.getStoreItemID().toLowerCase());
      if (part==null) {
        log.error("Couldn't locate part by storeItemId " + dataBinding.getStoreItemID());
        return null;
      }
      try {
        String r = part.xpathGetString(dataBinding.getXpath(), dataBinding.getPrefixMappings());
        log.debug(dataBinding.getXpath() + " yielded result " + r);
       
        // Base64 decode it
        byte[] bytes = Base64.decodeBase64( r.getBytes("UTF8") );
       
View Full Code Here

TOP

Related Classes of org.docx4j.openpackaging.parts.CustomXmlPart

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.