OpenOffice::OODoc::Document 2.027 review

Download
by rbytes.net on

OpenOffice::OODoc::Document is a top level component for content and layout processing. SYNOPSIS # get an OOo file hand

License: Perl Artistic License
File size: 211K
Developer: Jean-Marie Gouarne
0 stars award from rbytes.net

OpenOffice::OODoc::Document is a top level component for content and layout processing.

SYNOPSIS

# get an OOo file handler
my $oofile = ooFile("myfile.odt");
# connect a content-focused document interface
my $content = ooDocument
(
file => $oofile,
member => 'content'
);
# connect a style-focused document interface
my $styles = ooDocument
(
file => $oofile,
member => 'styles'
);
# process any content and style element
$content->appendParagraph
(
text => "An additional paragraph",
style => "BlueStyle"
);
$styles->createStyle
(
"BlueStyle",
parent => 'Text body',
family => 'paragraph',
properties =>
{
area => 'text',
'fo:color' => rgb2oo('blue')
}
);
# commit the changes using the file handler
$oofile->save;

This module defines the top level Document class, which is a connector allowing any kind of content and presentation processing. It inherits from OODoc::XPath, OODoc::Text, OODoc::Styles and OODoc::Image.

The most usual instruction to get access to any member of a document, with the exception if the metadata (meta.xml) should be something like:

my $doc = ooDocument([options]);

This constructor, if successful, returns an object that can be used (according to its "member" option) to process styles, images and text.

This module is designed simply to create objects which include all the functionality of OODoc::Text, OODoc::Image, OODoc::Styles and OODoc::XPath (which should not be called directly by applications).

For example

my $styles = ooDocument(file => "source.odt", member => "styles");

is generally better than

my styles = ooStyles(file => "source.odt");

While OODoc::Document inherits all the methods and properties of these classes, its detailed documentation in essentially provided in the following manual pages:

OpenOffice::OODoc::Text -> text content
OpenOffice::OODoc::Styles -> style & layout
OpenOffice::OODoc::Image -> graphic objects
OpenOffice::OODoc::XPath -> common features & low-level API

For example, the appendParagraph() and createStyle() methods used in the synopsis above are respectively described in OpenOffice::OODoc::Text and OpenOffice::OODoc::Styles.
The present manual page only describes those methods (there are very few) which combine layout and content processing.

Requirements:
Perl

OpenOffice::OODoc::Document 2.027 keywords