/** * Create an instance of {@link CTAltChunk } * */ public CTAltChunk createCTAltChunk() { return new CTAltChunk(); }
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, byte[] bytes) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(bytes); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); if (this instanceof ContentAccessor) { ((ContentAccessor)this).getContent().add(ac); } else { throw new Docx4JException(this.getClass().getName() + " doesn't implement ContentAccessor"); } return afiPart; }
/** * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. * * @param parent * The parent object in the object tree. * @param unmarshaller * The unmarshaller that generated the instance. */ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { setParent(parent); }
AlternativeFormatInputPart part = (AlternativeFormatInputPart) mainDocumentPart.getRelationshipsPart().getPart( altChunk.getId()); if (part.getAltChunkType().equals(AltChunkType.Xhtml)) { try { htmlImportProcessor.processHtml(toString(part.getBuffer())), null); locatedChunk.getContentList().remove(locatedChunk.getIndex()); Object chunkParent = locatedChunk.getAltChunk().getParent();
AlternativeFormatInputPart afip = (AlternativeFormatInputPart)clonedPart.getRelationshipsPart().getPart( altChunk.getId() );
AlternativeFormatInputPart part = (AlternativeFormatInputPart) mainDocumentPart.getRelationshipsPart().getPart( altChunk.getId()); if (part.getAltChunkType().equals(AltChunkType.Xhtml)) { try { htmlImportProcessor.processHtml(toString(part.getBuffer())), null); locatedChunk.getContentList().remove(locatedChunk.getIndex()); Object chunkParent = locatedChunk.getAltChunk().getParent();
AlternativeFormatInputPart afip = (AlternativeFormatInputPart)clonedPart.getRelationshipsPart().getPart( altChunk.getId() );
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, InputStream is) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(is); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); if (this instanceof ContentAccessor) { ((ContentAccessor)this).getContent().add(ac); } else { throw new Docx4JException(this.getClass().getName() + " doesn't implement ContentAccessor"); } return afiPart; }
/** * Create an instance of {@link CTAltChunk } * */ public CTAltChunk createCTAltChunk() { return new CTAltChunk(); }
/** * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. * * @param parent * The parent object in the object tree. * @param unmarshaller * The unmarshaller that generated the instance. */ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { setParent(parent); }
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, InputStream is, ContentAccessor attachmentPoint) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(is); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); attachmentPoint.getContent().add(ac); return afiPart; }
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, byte[] bytes, ContentAccessor attachmentPoint) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(bytes); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); attachmentPoint.getContent().add(ac); return afiPart; }
ac.setId(altChunkRel.getId());
CTAltChunk ac = Context.getWmlObjectFactory() .createCTAltChunk(); ac.setId(altChunkRel.getId());
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, InputStream is) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(is); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); if (this instanceof ContentAccessor) { ((ContentAccessor)this).getContent().add(ac); } else { throw new Docx4JException(this.getClass().getName() + " doesn't implement ContentAccessor"); } return afiPart; }
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, byte[] bytes) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(bytes); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); if (this instanceof ContentAccessor) { ((ContentAccessor)this).getContent().add(ac); } else { throw new Docx4JException(this.getClass().getName() + " doesn't implement ContentAccessor"); } return afiPart; }
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, InputStream is, ContentAccessor attachmentPoint) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(is); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); attachmentPoint.getContent().add(ac); return afiPart; }
@Override public AlternativeFormatInputPart addAltChunk(AltChunkType type, byte[] bytes, ContentAccessor attachmentPoint) throws Docx4JException { AlternativeFormatInputPart afiPart = new AlternativeFormatInputPart(type); Relationship altChunkRel = this.addTargetPart(afiPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // now that its attached to the package .. afiPart.registerInContentTypeManager(); afiPart.setBinaryData(bytes); // .. the bit in document body CTAltChunk ac = Context.getWmlObjectFactory().createCTAltChunk(); ac.setId(altChunkRel.getId() ); attachmentPoint.getContent().add(ac); return afiPart; }
ac.setId(altChunkRel.getId());
CTAltChunk ac = Context.getWmlObjectFactory() .createCTAltChunk(); ac.setId(altChunkRel.getId());