public final class XSSFVMLDrawing extends POIXMLDocumentPart
In Excel 2007 VML drawings are used to describe properties of cell comments, although the spec says that VML is deprecated:
The VML format is a legacy format originally introduced with Office 2000 and is included and fully defined in this Standard for backwards compatibility reasons. The DrawingML format is a newer and richer format created with the goal of eventually replacing any uses of VML in the Office Open XML formats. VML should be considered a deprecated format included in Office Open XML for legacy reasons only and new applications that need a file format for drawings are strongly encouraged to use preferentially DrawingML
Warning - Excel is known to put invalid XML into these files! For example, >br< without being closed or escaped crops up.
See 6.4 VML - SpreadsheetML Drawing in Office Open XML Part 4 - Markup Language Reference.pdfPOIXMLDocumentPart.RelationPart
Modifier and Type | Field and Description |
---|---|
static javax.xml.namespace.QName |
QNAME_VMLDRAWING
to actually process the namespace-less vmldrawing, we've introduced a proxy namespace.
|
Modifier | Constructor and Description |
---|---|
protected |
XSSFVMLDrawing()
Create a new SpreadsheetML drawing
|
protected |
XSSFVMLDrawing(PackagePart part)
Construct a SpreadsheetML drawing from a package part
|
Modifier and Type | Method and Description |
---|---|
protected void |
commit()
Save the content in the underlying package part.
|
com.microsoft.schemas.vml.CTShape |
findCommentShape(int row,
int col)
Find a shape with ClientData of type "NOTE" and the specified row and column
|
org.apache.poi.schemas.vmldrawing.XmlDocument |
getDocument() |
protected java.util.List<org.apache.xmlbeans.XmlObject> |
getItems() |
protected com.microsoft.schemas.vml.CTShape |
newCommentShape() |
protected void |
read(java.io.InputStream is) |
protected boolean |
removeCommentShape(int row,
int col) |
protected void |
write(java.io.OutputStream out) |
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommitted, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommitted, toString
public static final javax.xml.namespace.QName QNAME_VMLDRAWING
protected XSSFVMLDrawing()
XSSFSheet.createDrawingPatriarch()
protected XSSFVMLDrawing(PackagePart part) throws java.io.IOException, org.apache.xmlbeans.XmlException
part
- the package part holding the drawing data,
the content type must be application/vnd.openxmlformats-officedocument.drawing+xml
java.io.IOException
org.apache.xmlbeans.XmlException
public org.apache.poi.schemas.vmldrawing.XmlDocument getDocument()
protected void read(java.io.InputStream is) throws java.io.IOException, org.apache.xmlbeans.XmlException
java.io.IOException
org.apache.xmlbeans.XmlException
protected java.util.List<org.apache.xmlbeans.XmlObject> getItems()
protected void write(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
protected void commit() throws java.io.IOException
POIXMLDocumentPart
Sub-classes should override and add logic to marshal the "model" into Ooxml4J.
For example, the code saving a generic XML entry may look as follows:
protected void commit() throws IOException { PackagePart part = getPackagePart(); OutputStream out = part.getOutputStream(); XmlObject bean = getXmlBean(); //the "model" which holds changes in memory bean.save(out, DEFAULT_XML_OPTIONS); out.close(); }
commit
in class POIXMLDocumentPart
java.io.IOException
- a subclass may throw an IOException if the changes can't be committedprotected com.microsoft.schemas.vml.CTShape newCommentShape()
public com.microsoft.schemas.vml.CTShape findCommentShape(int row, int col)
null
protected boolean removeCommentShape(int row, int col)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.