public void registerInContentTypeManager() { ContentTypeManager ctm = this.getPackage().getContentTypeManager(); if (altChunkType != null) { ctm.addDefaultContentType(altChunkType.getExtension(), altChunkType.getContentType()); } } }
public AlternativeFormatInputPart(PartName partName) throws InvalidFormatException { super(partName); String extension = partName.getExtension().toLowerCase(); if (extension.equals("htm")) { setAltChunkType(AltChunkType.Html); } else { for(AltChunkType type: AltChunkType.values()) { if (extension.equals(type.getExtension())) { setAltChunkType(type); } } } if (altChunkType==null) { log.warn("Unrecognized type: " + extension); } init(); }
} else if (type.equals(AltChunkType.Xhtml) ) { } else if (type.equals(AltChunkType.Mht) ) { log.warn("Skipping altChunk of type MHT "); continue; } else if (type.equals(AltChunkType.Xml) ) { } else if (type.equals(AltChunkType.TextPlain) ) { } else if (type.equals(AltChunkType.WordprocessingML) || type.equals(AltChunkType.OfficeWordMacroEnabled) || type.equals(AltChunkType.OfficeWordTemplate) ||type.equals(AltChunkType.OfficeWordMacroEnabledTemplate) ) { encounteredDocxAltChunk = true; continue; } else if (type.equals(AltChunkType.Rtf) ) { log.warn("Skipping altChunk of type RTF "); continue; } else if (type.equals(AltChunkType.Html) ) { log.warn("Skipping altChunk of type HTML "); continue;
public void setAltChunkType(AltChunkType altChunkType) { this.altChunkType = altChunkType; // ContentType will vary - see spec 11.3.1 this.setContentType(new ContentType(altChunkType.getContentType())); } public AltChunkType getAltChunkType() {
private static String generatePartName(AltChunkType type) { return "/chunk." + type.getExtension(); }
} else if (type.equals(AltChunkType.Xhtml) ) { } else if (type.equals(AltChunkType.Mht) ) { log.warn("Skipping altChunk of type MHT "); continue; } else if (type.equals(AltChunkType.Xml) ) { } else if (type.equals(AltChunkType.TextPlain) ) { } else if (type.equals(AltChunkType.WordprocessingML) || type.equals(AltChunkType.OfficeWordMacroEnabled) || type.equals(AltChunkType.OfficeWordTemplate) ||type.equals(AltChunkType.OfficeWordMacroEnabledTemplate) ) { encounteredDocxAltChunk = true; continue; } else if (type.equals(AltChunkType.Rtf) ) { log.warn("Skipping altChunk of type RTF "); continue; } else if (type.equals(AltChunkType.Html) ) { log.warn("Skipping altChunk of type HTML "); continue;
public void setAltChunkType(AltChunkType altChunkType) { this.altChunkType = altChunkType; // ContentType will vary - see spec 11.3.1 this.setContentType(new ContentType(altChunkType.getContentType())); } public AltChunkType getAltChunkType() {
private static String generatePartName(AltChunkType type) { return "/chunk." + type.getExtension(); }
= (AlternativeFormatInputPart) mainDocumentPart.getRelationshipsPart().getPart( altChunk.getId()); if (part.getAltChunkType().equals(AltChunkType.Xhtml)) { try { XHTMLImporter xHTMLImporter = new XHTMLImporterImpl(wordprocessingMLPackage);
public void registerInContentTypeManager() { ContentTypeManager ctm = this.getPackage().getContentTypeManager(); if (altChunkType != null) { ctm.addDefaultContentType(altChunkType.getExtension(), altChunkType.getContentType()); } } }
public AlternativeFormatInputPart(PartName partName) throws InvalidFormatException { super(partName); String extension = partName.getExtension().toLowerCase(); if (extension.equals("htm")) { setAltChunkType(AltChunkType.Html); } else { for(AltChunkType type: AltChunkType.values()) { if (extension.equals(type.getExtension())) { setAltChunkType(type); } } } if (altChunkType==null) { log.warn("Unrecognized type: " + extension); } init(); }
= (AlternativeFormatInputPart) mainDocumentPart.getRelationshipsPart().getPart( altChunk.getId()); if (part.getAltChunkType().equals(AltChunkType.Xhtml)) { try { XHTMLImporter xHTMLImporter = new XHTMLImporterImpl(wordprocessingMLPackage);