NAME
OpenOffice::OODoc::Manifest - Access to document file descriptor
DESCRIPTION
The OpenOffice::OODoc::manifest class is a specialist derivative of OpenOffice::OODoc::XPath allowing access to the content descriptor of an OpenDocument or OpenOffice.org file.
For ordinary content processing applications, it's not absolutely necessary to control the manifest. Member imports or deletions (ex: createImageElement() in OpenOffice::OODoc::Image, raw_delete() in OpenOffice::OODoc::File) may make the real content inconsistent with the manifest. Up to now, the OpenOffice.org desktop suite don't worry about that. However, OpenOffice::OODoc::Manifest provides a few number of easy to use methods to get or set any entry in the manifest. In addition, it allows the users (at their own risks) to create or update any kind of special entry or mime type, without control. There is no automatic consistency check between the manifest and the real content (but this check and others could be easily developed with the combination of this module and the other ones).
The manifest (i.e. the "META-INF/manifest.xml") is a special member of a regular OpenOffice.org file. It describes the MIME types and the full internal paths of the other members.
Methods
Constructor : OpenOffice::OODoc::Manifest->new(<parameters>)
Short Form: ooManifest(<parameters>)
See OpenOffice::OODoc::XPath->new
The XML member loaded by default is 'META-INF/manifest.xml'.
Example:
$my manifest = OpenOffice::OODoc::Manifest>new
(
file => 'document.odt'
);
returns a new object which represents the member list of an
OpenOffice.org "document.odt" file.
getEntry($entry)
Returns the element (if any) corresponding to the given member.
Example:
my $element = $manifest->getEntry("content.xml");
Returns the element describing the "content.xml" member of the
file, if this element is defined.
getMainType()
Returns the main MIME type of the OpenOffice.org document.
For example, this type is 'application/vnd.sun.xml.writer' for
a text document, or 'application/vnd.sun.xml.impress' for a
presentation.
getType($entry)
Returns the media (mime) type of the given member.
removeEntry($entry)
Deletes the named entry.
setEntry($entry, $type)
Sets the mime type of an entry element. If the element was not
previously existing, it's created.
Returns the new element in case of success, undef otherwise.
Example:
my $element = $manifest->setEntry
("content.xml", "text/xml");
This instruction first creates (if needed) an entry for the member
"content.xml" and sets its media type to "text/xml".
setMainEntry($type)
Sets the main MIME type of the OpenOffice.org document.
Risky; not for ordinary use. But nobody prevents you from giving
a presentation or spreadsheet MIME type to a Writer document !
Properties
As for OpenOffice::OODoc::XPath
Exported functions
None
NOTES
See OpenOffice::OODoc::Notes(3) for the footnote citations ([n]) included in this page.
AUTHOR/COPYRIGHT
Copyright 2004-2006 by Genicorp, S.A. (http://www.genicorp.com)
Initial developer: Jean-Marie Gouarne (http://jean.marie.gouarne.online.fr)
Initial English version of the reference manual by Graeme A. Hunter (graeme.hunter@zen.co.uk)
License:
- Genicorp General Public Licence v1.0
- GNU Lesser General Public License v2.1
Contact: jmgdoc@cpan.org