Codota Logo
JaxbXmlPartAltChunkHost
Code IndexAdd Codota to your IDE (free)

How to use
JaxbXmlPartAltChunkHost
in
org.docx4j.openpackaging.parts

Best Java code snippets using org.docx4j.openpackaging.parts.JaxbXmlPartAltChunkHost (Showing top 12 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: plutext/docx4j

    throw new Docx4JException(this.getClass().getName() + " doesn't implement ContentAccessor");
PartName partName = this.getPartName();
WordprocessingMLPackage clonePkg = (WordprocessingMLPackage)this.getPackage().clone(); // consistent with MergeDocx approach
JaxbXmlPartAltChunkHost clonedPart = (JaxbXmlPartAltChunkHost)clonePkg.getParts().get(partName); 
    =  (AlternativeFormatInputPart)clonedPart.getRelationshipsPart().getPart(
        altChunk.getId() );
      results = xHTMLImporter.convert(toString(afip.getBuffer()), null);
      result = toString(afip.getBuffer());
    } catch (UnsupportedEncodingException e) {
      log.error(e.getMessage(), e);
    return clonePkg;
  } catch (ClassNotFoundException e) {
    extensionMissing(e);
    return clonePkg;
  } catch (IllegalArgumentException e) {
    return clonePkg;
  } catch (NoSuchMethodException e) {
    extensionMissing(e);
    return clonePkg;
  } catch (IllegalAccessException e) {
origin: plutext/docx4j

@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;
}
origin: com.haulmont.yarg/yarg

CTAltChunk altChunk = locatedChunk.getAltChunk();
AlternativeFormatInputPart part
    = (AlternativeFormatInputPart) mainDocumentPart.getRelationshipsPart().getPart(
    altChunk.getId());
if (part.getAltChunkType().equals(AltChunkType.Xhtml)) {
origin: cuba-platform/yarg

CTAltChunk altChunk = locatedChunk.getAltChunk();
AlternativeFormatInputPart part
    = (AlternativeFormatInputPart) mainDocumentPart.getRelationshipsPart().getPart(
    altChunk.getId());
if (part.getAltChunkType().equals(AltChunkType.Xhtml)) {
origin: org.docx4j/docx4j

    throw new Docx4JException(this.getClass().getName() + " doesn't implement ContentAccessor");
PartName partName = this.getPartName();
WordprocessingMLPackage clonePkg = (WordprocessingMLPackage)this.getPackage().clone(); // consistent with MergeDocx approach
JaxbXmlPartAltChunkHost clonedPart = (JaxbXmlPartAltChunkHost)clonePkg.getParts().get(partName); 
    =  (AlternativeFormatInputPart)clonedPart.getRelationshipsPart().getPart(
        altChunk.getId() );
      results = xHTMLImporter.convert(toString(afip.getBuffer()), null);
      result = toString(afip.getBuffer());
    } catch (UnsupportedEncodingException e) {
      log.error(e.getMessage(), e);
    return clonePkg;
  } catch (ClassNotFoundException e) {
    extensionMissing(e);
    return clonePkg;
  } catch (IllegalArgumentException e) {
    return clonePkg;
  } catch (NoSuchMethodException e) {
    extensionMissing(e);
    return clonePkg;
  } catch (IllegalAccessException e) {
origin: plutext/docx4j

@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;
}
origin: plutext/docx4j

@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;
}
origin: plutext/docx4j

@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;
}
origin: org.docx4j/docx4j

@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;
}
origin: org.docx4j/docx4j

@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;
}
origin: org.docx4j/docx4j

@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;
}
origin: org.docx4j/docx4j

@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;
}
org.docx4j.openpackaging.partsJaxbXmlPartAltChunkHost

Most used methods

  • getRelationshipsPart
  • addTargetPart
  • extensionMissing
  • getPackage
  • getPartName
  • toString

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Table (org.hibernate.mapping)
    A relational table
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now