AnsweredAssumed Answered

Extract OpenOffice metadata to custom property

Question asked by cedomir on Aug 10, 2008
Latest reply on Oct 9, 2010 by pilerou
Hi,

I'm trying to add custom property to document meta data and during the add content action to store the value from openoffice document custom property to it.  There is no errors but custom property remains empty. If I change custom property (my:refno) to standard one (cm:description) in extractor xml, everything works fine.

Any help will be appreciated.

Cedomir

My files are as follows

model-context.xml :
<beans>
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/mojmodel.xml</value>
            </list>
        </property>
    </bean>
</beans>

mojmodel.xml

<?xml version="1.0" encoding="UTF-8"?>

<model name="my:mynewmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>Primer modela</description>
   <author>Ceda</author>
   <version>1.0</version>

   <imports>
      <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <namespaces>
      <namespace uri="my.new.model" prefix="my"/>
   </namespaces>

   <types>
      <type name="my:predmet">
         <title>Predmet</title>
         <parent>cm:content</parent>
         <properties>
            <property name="my:refno">
               <type>d:text</type>
            </property>
         </properties>
      </type>
   </types>
</model>


custom-metadata-extractors-context.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
<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">my:refno</prop>
            </props>
        </property>
</bean>



Outcomes