.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "OODoc::Meta 3pm" .TH OODoc::Meta 3pm "2013-12-25" "perl v5.18.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" OpenOffice::OODoc::Meta \- Access to document metadata .SH "DESCRIPTION" .IX Header "DESCRIPTION" The OpenOffice::OODoc::Meta class is a specialist derivative of OpenOffice::OODoc::XPath for \s-1XML\s0 members which describe the metadata of \s-1ODF\s0 documents. .SS "Methods" .IX Subsection "Methods" \fIConstructor : OpenOffice::OODoc::Meta\->new()\fR .IX Subsection "Constructor : OpenOffice::OODoc::Meta->new()" .PP .Vb 1 \& Short Form: odfMeta() \& \& See OpenOffice::OODoc::XPath\->new (or odfXPath) \& \& Returns an OpenDocument connector allowing subsequent access to \& the metadata of a well\-formed, ODF\-compliant document. \& \& The XML member loaded by default is \*(Aqmeta.xml\*(Aq. \& \& Example: \& \& $my meta = odfMeta(file => \*(Aqdocument.odt\*(Aq); \& \& returns a new object which represents the metadata of the \& ODF document "document.odt". .Ve .PP \fIaddKeyword(text)\fR .IX Subsection "addKeyword(text)" .PP .Vb 2 \& Adds the given text to the list of document keywords if not already \& found. \& \& Example: \& \& $meta\->addKeyword("document management"); \& $meta\->addKeyword("office"); \& $meta\->addKeyword("tech watch"); .Ve .PP \fI\fIcreation_date()\fI\fR .IX Subsection "creation_date()" .PP .Vb 2 \& Without argument, returns the document\*(Aqs creation date in \& ISO\-8601 format (i.e. the ODF\-compliant date format). \& \& Example of returned value: \& \& 2008\-11\-12T08:22:50 \& \& The returned value can be converted in standard numeric time format \& with the ooTimelocal() function. \& \& With argument, inserts the given string (without checking) as the \& creation date. The argument, if any, must comply with the ODF \& (ISO\-8601) date format. The ooLocaltime() function can be used in \& order to convert a regular Perl time() value in ODF. \& \& A conventional editing software should never changes this value, but \& this method allows the user to read or write it. \& \& See also date(). .Ve .PP \fI\fIcreator()\fI\fR .IX Subsection "creator()" .PP .Vb 2 \& Without argument, returns the document creator\*(Aqs name. The creator \& is generally the author of the last update. See also initial_creator(). \& \& With argument, modifies the document author\*(Aqs name. .Ve .PP \fI\fIdate()\fI\fR .IX Subsection "date()" .PP .Vb 2 \& Without argument, returns the document\*(Aqs date of last modification, \& in ISO\-8601 format. \& \& With argument, inserts the given string (without checking) as the \& last modification date. The argument, if any, must comply with the \& ODF date format (ISO\-8601). The odfLocaltime() function can be used \& in order to convert a regular Perl time() value in ODF format. \& \& The returned value can be converted in standard numeric time format \& with the ooTimelocal() function. .Ve .PP \fI\fIdescription()\fI\fR .IX Subsection "description()" .PP .Vb 2 \& Without argument, returns the contents of the document properties \& "Description" field. \& \& With argument, inserts the given text in the "Description" field. .Ve .PP \fI\fIediting_cycles()\fI\fR .IX Subsection "editing_cycles()" .PP .Vb 3 \& Without argument, returns the number of edit sessions (i.e. saves, \& under an ODF\-compliant editing software). Or, technically, the number \& of versions. \& \& With argument, modifies this number without checking. \& \& See also increment_editing_cycles(). .Ve .PP \fI\fIediting_duration()\fI\fR .IX Subsection "editing_duration()" .PP .Vb 2 \& Without argument, returns the total editing time for the document, \& in ISO\-8601 date/time format. \& \& For example, the returned string can be: \& \& P2DT11H27M33S \& \& which in this case means that the document has been edited for 2 \& days, 11 hours, 27 minutes and 33 seconds. \& \& With argument, forces a new value into this property without \& checking. .Ve .PP \fI\fIgenerator()\fI\fR .IX Subsection "generator()" .PP .Vb 2 \& Without argument, returns a label representing the signature of the \& software which generated the document. Example of signature: \& \& "OpenOffice.org/3.1$Unix OpenOffice.org_project/310m11$Build\-9399" \& \& With argument, inserts any signature. .Ve .PP \fI\fIgetTemplate()\fI\fR .IX Subsection "getTemplate()" .PP .Vb 2 \& Returns information about the template that is linked to the current \& document, if any. \& \& In scalar context, the returned information is the location (URL) of \& the template, or undef if the document isn\*(Aqt linked to any template. \& \& In array context, the returned values are, in this order, the location \& of the template document, the date and time when the template was last \& modified prior to being used to create the current document, then the \& title of the template document. \& \& See also unlinkTemplate(). .Ve .PP \fIgetUserProperty(name)\fR .IX Subsection "getUserProperty(name)" .PP .Vb 2 \& Retrieves the content of the user\-defined property corresponding to the \& given name, if any. \& \& The argument may be an already retrieved user\-defined property element \& reference instead of a name. \& \& In scalar context, returns the value only. \& In array context, returns the data type (1st) and the value (2nd). \& \& Returns undef if the property is not defined. \& \& See also setUserProperty(). .Ve .PP \fIgetUserPropertyElement(name)\fR .IX Subsection "getUserPropertyElement(name)" .PP .Vb 4 \& Like getUserProperty(), but the return value is the user property \& element instead of its value and/or type. Returns undef if the given \& property is not defined (or if the given object is not a user\-defined \& property element). .Ve .PP \fI\fIgetUserPropertyElements()\fI\fR .IX Subsection "getUserPropertyElements()" .PP .Vb 1 \& Returns the list of all the existing user\-defined property elements. .Ve .PP \fI\fIincrement_editing_cycles()\fI\fR .IX Subsection "increment_editing_cycles()" .PP .Vb 3 \& Adds 1 to the editing cycle count that is stored in the document, and \& returns the new count. This count should be incremented each time \& the document is edited through an ODF\-compliant application. \& \& See also editing_cycles(). .Ve .PP \fI\fIinitial_creator()\fI\fR .IX Subsection "initial_creator()" .PP .Vb 3 \& Like creator(), but apply to the creator of the first version of the \& document. The OOo desktop software never updates this value, but this \& method allows the user to read or write it. .Ve .PP \fI\fIkeywords()\fI\fR .IX Subsection "keywords()" .PP .Vb 4 \& Without argument, returns a list of the document\*(Aqs keywords. In a \& list context, the result is a table where each element is a keyword. \& In a scalar context, the keywords are returned in a single character \& string, each of which is separated by a comma and a space. \& \& With arguments, adds a list of keywords to the existing one. The \& only checking carried out is to see if the keyword already exists, \& if so it is not added. .Ve .PP \fI\fIlanguage()\fI\fR .IX Subsection "language()" .PP .Vb 2 \& Without argument, returns the content of the language variable. \& Example: \& \& fr_FR \& \& With argument, changes the content of this variable without \& checking. .Ve .PP \fIremoveKeyword(keyword)\fR .IX Subsection "removeKeyword(keyword)" .PP .Vb 1 \& Removes the given keyword if it exists. .Ve .PP \fIremoveUserProperty(name)\fR .IX Subsection "removeUserProperty(name)" .PP .Vb 2 \& Deletes the user\-defined property corresponding to the given name (does \& nothing if the given property is not defined in the document). .Ve .PP \fI\fIremoveUserProperties()\fI\fR .IX Subsection "removeUserProperties()" .PP .Vb 3 \& Deletes all the existing user\-defined properties and returns the number \& or really deleted elements (does nothing and returns 0 if no user \& property is defined in the document). .Ve .PP \fIsetUserProperty(name, type => value_type, value => text)\fR .IX Subsection "setUserProperty(name, type => value_type, value => text)" .PP .Vb 2 \& Creates or updates a user\-defined property with the given data type and \& the given value. \& \& According to the ODF specification, the presently allowed data types in \& a meta property are float, date, time, boolean and string. \& However, the given type is not checked so the application can provide any \& abritrary type. \& \& While the consistency between the type and the value is not checked, the \& ODF compliance requires \*(Aqtrue\*(Aq or \*(Aqfalse\*(Aq for a boolean, and the ISO\-8601 \& format for a date (see odfLocaltime()). \& \& Example: \& \& $meta\->setUserProperty \& ( \& "Approved", \& type => \*(Aqboolean\*(Aq, value => \*(Aqfalse\*(Aq \& ); \& $meta\->setUserProperty \& ( \& "Circulation", \& type => \*(Aqstring\*(Aq, value => "Internal" \& ); \& $meta\->setUserProperty \& ( \& "Release date", \& type => \*(Aqdate\*(Aq, value => \*(Aq2010\-01\-01\*(Aq \& ); \& $meta\->setUserProperty \& ( \& "Release number", \& type => \*(Aqfloat\*(Aq, value => 5.4 \& ); \& \& The \*(Aqtype\*(Aq option allows one to change the data type of an existing user\- \& defined property. However, if a new property is created without \*(Aqtype\*(Aq \& option, the \*(Aqstring\*(Aq type is selected by default. \& \& The return value reflects the new status of the user defined item, \& in the same format as with getUserProperty(). .Ve .PP \fI\fIstatistic()\fI\fR .IX Subsection "statistic()" .PP .Vb 3 \& Without argument, returns a hash which represents the entire \& "statistics" section of the metadata. The content depends on the \& type of document. \& \& Text \& \& \*(Aqmeta:table\-count\*(Aq => number of tables \& \*(Aqmeta:image\-count\*(Aq => number of images \& \*(Aqmeta:object\-count\*(Aq => number of OLE objects \& \*(Aqmeta:page\-count\*(Aq => number of pages \& \*(Aqmeta:paragraph\-count\*(Aq => number of paragraphs \& \*(Aqmeta:word\-count\*(Aq => number of words \& \*(Aqmeta:character\-count\*(Aq => number of characters \& \& Spreadsheet \& \& \*(Aqmeta:table\-count\*(Aq => number of sheets \& \*(Aqmeta:cell\-count\*(Aq => number of non\-empty cells \& \*(Aqmeta:object\-count\*(Aq => number of objects (images, etc.) \& \& Example: \& \& my $meta = odfMeta\->new("invoice.ods"); \& my %stat = $meta\->statistic; \& print "This invoice contains " . \& "$stat{\*(Aqmeta:cell\-count\*(Aq} cells and " . \& "$stat{\*(Aqmeta:table\-count\*(Aq} pages\en"; \& \& With arguments, you can modify (or falsify ?!) all or some of the \& statistical data and even create attributes which are not created by \& the office software. Arguments are passed in pairs [key => value] and \& handled without checking. \& \& Example: \& \& $meta\->statistic \& (\*(Aqmeta:table\-count\*(Aq => \*(Aq4\*(Aq, \*(Aqstatus\*(Aq => \*(AqOK\*(Aq); \& \& This example forces the number of tables to 4 (whatever the reality) \& and adds an arbitrary attribute \*(Aqstatus\*(Aq with value \*(AqOK\*(Aq. \& \& Note : Such forced attributes do not upset the function of \& the office software which ignores them. They could therefore be useful \& in programs which handle documents out of reach of the end user. \& However, if such a document is then edited or updated by a typical \& end\-user desktop application, these "foreign" attributes could be lost \& and and replaced by what this application considers to be the "real" \& values to those attributes it manages. .Ve .PP \fI\fIsubject()\fI\fR .IX Subsection "subject()" .PP .Vb 1 \& Without argument, returns the document\*(Aqs subject. \& \& With argument, adds a new subject to the document. .Ve .PP \fI\fItitle()\fI\fR .IX Subsection "title()" .PP .Vb 1 \& Without argument, returns the document\*(Aqs title. \& \& With argument, adds a new title to the document. .Ve .PP \fI\fIunlinkTemplate()\fI\fR .IX Subsection "unlinkTemplate()" .PP .Vb 2 \& Removes the reference to a template document, if any, ensuring that \& the document no longer depends on any external template. .Ve .PP \fI\fIuser_defined()\fI\fR .IX Subsection "user_defined()" .PP .Vb 1 \& Returns the list of the user defined fields of the document. \& \& The list is returned in the form of a hash elements whose keys represent \& the field names and whose values represent their content. \& \& By supplying a similar hash of elements as an argument, this method \& deletes and replaces the existing content. However, if the number of \& provided items is less than the numbers of existing user defined \& properties, the exceding properties are left unchanged. \& \& Warning: this method is deprecated. Newer methods such as \& setUserProperty(), getUserProperty(), removeUserProperties(), \& getUserPropertyElements(), and getUserPropertyElements() should be \& preferred. .Ve .PP \fI\fIversion()\fI\fR .IX Subsection "version()" .PP .Vb 1 \& Synonym of editing_cycles(). .Ve .SS "Properties" .IX Subsection "Properties" .Vb 1 \& As for OpenOffice::OODoc::XPath .Ve .SH "AUTHOR/COPYRIGHT" .IX Header "AUTHOR/COPYRIGHT" Developer/Maintainer: Jean-Marie Gouarne .PP Contact: jmgdoc@cpan.org .PP Copyright 2004\-2010 by Genicorp, S.A. .PP Initial English version of the reference manual by Graeme A. Hunter (graeme.hunter@zen.co.uk). .PP License: \s-1GNU\s0 Lesser General Public License v2.1