writer2latex.xmerge
public class OfficeDocument extends Object implements Document, OfficeConstants
Document
for
StarOffice documents.
Constructor Summary | |
---|---|
OfficeDocument(String name)
Default constructor.
| |
OfficeDocument(String name, boolean namespaceAware, boolean validating)
Constructor with arguments to set namespaceAware
and validating flags.
|
Method Summary | |
---|---|
void | addEmbeddedObject(EmbeddedObject embObj)
Adds a new embedded object to the document.
|
Document | getContentDOM()
Return a DOM Document object of the content.xml
file. |
protected String | getDocumentMimeType()
Method to return the MIME type of the document.
|
EmbeddedObject | getEmbeddedObject(String name)
Returns the embedded object corresponding to the name provided.
|
Iterator | getEmbeddedObjects()
Returns all the embedded objects (graphics, formulae, etc.) present in
this document.
|
protected String | getFileExtension()
Returns the file extension for this type of
Document .
|
String | getFileName()
Return the file name of the Document , possibly
with the standard extension.
|
Document | getMetaDOM()
Return a DOM Document object of the meta.xml
file. |
String | getName()
Return the name of the Document .
|
protected String | getOfficeClassAttribute()
Return the office:class attribute value.
|
Document | getSettingsDOM()
Return a DOM Document object of the settings.xml
file. |
Document | getStyleDOM()
Return a DOM Document object of the style.xml file.
|
void | initContentDOM()
Initializes a new DOM Document with the content
containing minimum OpenOffice XML tags.
|
void | initSettingsDOM()
Initializes a new DOM Document with the content
containing minimum OpenOffice XML tags.
|
void | initStyleDOM()
Initializes a new DOM Document with styles
containing minimum OpenOffice XML tags.
|
boolean | isPackageFormat() Package or flat format? |
void | read(InputStream is)
Read the Office Document from the given
InputStream .
|
void | read(InputStream is, boolean isZip)
Read the Office Document from the given
InputStream .
|
void | setContentDOM(Node newDom)
Sets the content tree of the document.
|
void | setMetaDOM(Node newDom)
Sets the meta tree of the document.
|
void | setSettingsDOM(Node newDom)
Sets the settings tree of the document.
|
void | setStyleDOM(Node newDom)
Sets the style tree of the document.
|
void | write(OutputStream os)
Write out Office ZIP file format.
|
void | write(OutputStream os, boolean isZip)
Write out Office ZIP file format.
|
Parameters: name Document
name.
namespaceAware
and validating
flags.
Parameters: name Document
name (may or may not
contain extension). namespaceAware Value for namespaceAware
flag. validating Value for validating
flag.
Parameters: embObj An instance of EmbeddedObject
.
Document
object of the content.xml
file. Note that a content DOM is not created when the constructor
is called. So, either the read
method or the
initContentDOM
method will need to be called ahead
on this object before calling this method.
Returns: DOM Document
object.
Returns: String The document's MIME type.
Parameters: name The name of the embedded object to retrieve.
Returns: An EmbeddedObject
instance representing the named
object.
Returns: An Iterator
of EmbeddedObject
objects.
Document
.
Returns: The file extension of Document
.
Document
, possibly
with the standard extension.
Returns: The file name of Document
.
Document
object of the meta.xml
file. Note that a content DOM is not created when the constructor
is called. So, either the read
method or the
initContentDOM
method will need to be called ahead
on this object before calling this method.
Returns: DOM Document
object.
Document
.
Returns: The name of Document
.
Returns: The attribute value.
Document
object of the settings.xml
file. Note that a content DOM is not created when the constructor
is called. So, either the read
method or the
initContentDOM
method will need to be called ahead
on this object before calling this method.
Returns: DOM Document
object.
Document
object of the style.xml file.
Note that this may return null if there is no style DOM.
Note that a style DOM is not created when the constructor
is called. Depending on the InputStream
, a
read
method may or may not build a style DOM. When
creating a new style DOM, call the initStyleDOM
method
first.
Returns: DOM Document
object.
Document
with the content
containing minimum OpenOffice XML tags.
Throws: IOException If any I/O error occurs.
Document
with the content
containing minimum OpenOffice XML tags.
Throws: IOException If any I/O error occurs.
Throws: IOException If any I/O error occurs.
Returns: true if the document is in package format, false if it's flat xml
Document
from the given
InputStream
.
FIX3 (HJ): Perform simple type detection to determine package or flat format
Parameters: is Office document InputStream
.
Throws: IOException If any I/O error occurs.
Document
from the given
InputStream
.
Parameters: is Office document InputStream
. isZip boolean
Identifies whether
a file is zipped or not
Throws: IOException If any I/O error occurs.
Parameters: newDom Node
containing the new content tree.
Parameters: newDom Node
containing the new meta tree.
Parameters: newDom Node
containing the new settings tree.
Parameters: newDom Node
containing the new style tree.
Parameters: os XML OutputStream
.
Throws: IOException If any I/O error occurs.
Parameters: os XML OutputStream
. isZip boolean
Throws: IOException If any I/O error occurs.