Meta Data

Writing a book, Automating Document Production - Discuss your special needs here
Post Reply
multi-lingual_ooo
Posts: 6
Joined: Wed Feb 08, 2017 9:52 am

Meta Data

Post by multi-lingual_ooo »

All:

Can somebody point me to a way to automagically add roughly 50 metadata fields to roughly 2,500 documents?

Doing this on a document by document basis is way to error prone.

FWIW, I need to do this to Draw, Calc, Impress, and Write documents.

jonathon
LibO: Beta and Release Candidates;
AOo: most recent of Beta, Release Candidate, or Final;
User avatar
RoryOF
Moderator
Posts: 34611
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Meta Data

Post by RoryOF »

Do you wish to add the blank metadata fields to the documents, so they can be filled by future users of the documents, or will they be filled fields, where the content will be customised (how?) for the specific document.

As far as I know there is a metadata file within the OO archive that comprises a file. It may be possible to automate the unpacking of such archive(s), the appending of the new meta xml file to the existing metadata.xml (so that existing metadata is not destroyed) and the repacking of the archive. You could consider writing an external process in a suitable high level language to do this.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
multi-lingual_ooo
Posts: 6
Joined: Wed Feb 08, 2017 9:52 am

Re: Meta Data

Post by multi-lingual_ooo »

RoryOF wrote:Do you wish to add the blank metadata fields to the documents, so they can be filled by future users of the documents, or will they be filled fields, where the content will be customised (how?) for the specific document.
The meta data fields are to be filled. The initial run is "generic data". As the documents are edited, etc, the metadata fields will be updated/corrected.
As far as I know there is a metadata file within the OO archive that comprises a file.
That is the meta.xml file.

I guess what I need to know, is how to edit that specific file, then repackage everything, so that it doesn't generate a corrupt document error message, upon opening it.

jonathon
LibO: Beta and Release Candidates;
AOo: most recent of Beta, Release Candidate, or Final;
User avatar
RoryOF
Moderator
Posts: 34611
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Meta Data

Post by RoryOF »

To know how to edit it, I think you have to look into the internal form of the meta.xml file. Metadata fields should be defined in the Open Document definitions at
https://www.oasis-open.org/standards#opendocumentv1.2
and on the oasis-open.org site there is discussion of metadata and its application.

I have been able, on a document by document basis, to edit corrupt internal.xml files and resave the repaired file to the archive; I suspect not getting a "corrupt document" message is merely a case of the archiver used generating a correct checksum. In my cases the .xml file is edited and saved without extraction of the files from the archive, so that the archive is aware that the file has been changed and automatically rebuilds itself.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
RoryOF
Moderator
Posts: 34611
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Meta Data

Post by RoryOF »

I've just opened an .odt file, extracted all the files into a directory using linux's Archive Manager, edited meta.xml using XML copy Editor, then repacked all the files (again with Archive Manager). The modified .odt file opened correctly with OO 4.1.3 and the modification to the meta data showed up correctly when that field was invoked.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
RoryOF
Moderator
Posts: 34611
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Meta Data

Post by RoryOF »

For information: an internet search reveals many applications and discussions of reading or removal of metadata from OpenOffice files, but very few cases of applications for insertion of metadata. Any pointers to such cases would be appreciated, particularly those designed for adding general metadata (say table or .ini file driven).
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Meta Data

Post by Villeroy »

All you need is some xml parser and zip tool for your preferred programming language.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply