AnsweredAssumed Answered

Opendocument specific metadata in Alfresco

Question asked by pilerou on Oct 12, 2010
Hello everybody,

I would like to use specific metadata within an Open Office document :
- to see those properties in Alfresco
- to search documents with those criteria

So, i set new properties using OpenOffice :
[img]http://img839.imageshack.us/img839/1645/properties.jpg[/img]

I save my document. When I open it with Winzip (for example), I see a meta.xml file :
[img]http://img87.imageshack.us/img87/9426/zipview.jpg[/img]

The meta.xml file contains :


<?xml version="1.0" encoding="UTF-8"?>
<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:grddl="http://www.w3.org/2003/g/data-view#" office:version="1.2" grddl:transformation="http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl">
  <office:meta>
    <meta:initial-creator>my name</meta:initial-creator>
    <meta:creation-date>2010-10-12T17:53:36</meta:creation-date>
    <meta:editing-cycles>1</meta:editing-cycles>
    <meta:editing-duration>PT00H09M04S</meta:editing-duration>
    <meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="0" meta:word-count="0" meta:character-count="0"/>
    <dc:date>2010-10-12T18:02:26.39</dc:date>
    <dc:creator>my name</dc:creator>
    <meta:generator>OpenOffice.org/3.2$Win32 OpenOffice.org_project/320m18$Build-9502</meta:generator>
    <meta:user-defined meta:name="IdClient" meta:value-type="float">123456789</meta:user-defined>
    <meta:user-defined meta:name="IdContrat" meta:value-type="float">98765</meta:user-defined>
    <meta:user-defined meta:name="typedocument">contrat</meta:user-defined>
  </office:meta>
</office:document-meta>

At the end of the file we can see that specific metadata are stored using meta:user-defined tags.

I would like to deal with those data in Alfresco.

I saw the wiki link : http://wiki.alfresco.com/wiki/Metadata_Extraction

So i understood i have to create a custom-metadata-extrators-context.xml in order to extend the definition of the Opendocument extractor :
<bean id="extracter.OpenDocument"
          class="org.alfresco.repo.content.metadata.OpenDocumentMetadataExtracter"
          parent="baseMetadataExtracter" >
        <property name="inheritDefaultMapping">
            <value>true</value>
        </property>
        <property name="mappingProperties">
            <props>
                <prop key="namespace.prefix.cm">http://www.alfresco.org/model/content/1.0</prop>
                <prop key="user1">cm:description</prop>
            </props>
        </property>
    </bean>

This example doesn't explain how to get specific metadata stored in my OpenOffice document.
<meta:user-defined meta:name="IdClient" meta:value-type="float">123456789</meta:user-defined>
    <meta:user-defined meta:name="IdContrat" meta:value-type="float">98765</meta:user-defined>
    <meta:user-defined meta:name="typedocument">contrat</meta:user-defined>

Does anyone know how to configure custom-metadata-extrators-context.xml in order to get those data ?

Furthermore, do you know if i have to configure something in alfresco in order to :
- watch them in the file description
- index specific metadata for search

Thanks for your help.

Regards.

Pierre

Outcomes