Package org.docx4j.openpackaging.contenttype

Examples of org.docx4j.openpackaging.contenttype.ContentType


 
  public void setAltChunkType(AltChunkType altChunkType) {
    this.altChunkType = altChunkType;

    // ContentType will vary - see spec 11.3.1
    this.setContentType(new ContentType(altChunkType.getContentType()));
  }
View Full Code Here


        AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(
            getNewPartName("/chunk", ".docx", srcPackage
                .getMainDocumentPart().getRelationshipsPart()));
        afiPart.setBinaryData(docxFetcher.getDocxFromIRI(iri));

        afiPart.setContentType(new ContentType(
            "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml")); // docx

        Relationship altChunkRel = srcPackage.getMainDocumentPart()
            .addTargetPart(afiPart);
        CTAltChunk ac = Context.getWmlObjectFactory()
View Full Code Here

    } catch (IllegalAccessException e) {
      throw new Docx4JException("IllegalAccessException duplicating package", e);
    }
   
//    contentType
    ret.setContentType(new ContentType(opcPackage.getContentType()));
//    partName
    ret.setPartName(opcPackage.getPartName());
//    relationships
    //is done in an another method
//    userData
View Full Code Here

      ret = part.getClass().getConstructor(PartName.class).newInstance(part.getPartName());
    } catch (Exception e) {
      throw new Docx4JException("Error cloning part of class " + part.getClass().getName(), e);
    }
    ret.setRelationshipType(part.getRelationshipType());
    ret.setContentType(new ContentType(part.getContentType()));
    if (targetPackage != null) {
      ret.setPackage(targetPackage);
    }
    if (deepCopy) {
      deepCopyContent(part, ret);
View Full Code Here

   *            of the part's data stream.
   */
  public Part(PartName partName,
      String contentType) throws InvalidFormatException {
    this(partName);
    this.contentType = new ContentType(contentType);
  }
View Full Code Here

          el = pkgPart.getXmlData().getAny();
        }
               
//         part = ctm.newPartForContentType(contentType, resolvedPartUri,rel);
         part = ctm.newPartForContentType(contentType, pkgPart.getName(), rel);
         part.setContentType( new ContentType(contentType) );
        
//         ctm.addOverrideContentType(new java.net.URI(resolvedPartUri),
         ctm.addOverrideContentType(new java.net.URI(pkgPart.getName()),
             contentType);
       
View Full Code Here

   * Constructor.  Also creates a new content type manager
   *
   */ 
  public WordprocessingMLPackage() {
    super();
    setContentType(new ContentType(ContentTypes.WORDPROCESSINGML_DOCUMENT));
  }
View Full Code Here

   * @param contentTypeManager
   *            The content type manager to use
   */
  public WordprocessingMLPackage(ContentTypeManager contentTypeManager) {
    super(contentTypeManager);
    setContentType(new ContentType(ContentTypes.WORDPROCESSINGML_DOCUMENT));
  }
View Full Code Here

      //in = partByteArrays.get(resolvedPartUri).getInputStream();
      part = new BinaryPart( new PartName("/" + resolvedPartUri));
     
      // Set content type
      part.setContentType(
          new ContentType(
              ctm.getContentType(new PartName("/" + resolvedPartUri)) ) );
     
      ((BinaryPart)part).setBinaryData(is);
      log.info("Stored as BinaryData" );
     
View Full Code Here

   * Constructor.  Also creates a new content type manager
   *
   */ 
  public SpreadsheetMLPackage() {
    super();
    setContentType(new ContentType(ContentTypes.PRESENTATIONML_MAIN));    
  }
View Full Code Here

TOP

Related Classes of org.docx4j.openpackaging.contenttype.ContentType

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.