AnsweredAssumed Answered

xml Extractor

Question asked by sebus on Nov 9, 2012
Hello,

I work on alfresco3.4.d with share.

I have a problem with xml extraction. After reading a lot on this subject, my configuration doesn't work. I give you my files :

xml :

<model>
   <author>author name</author>
   <title>title</title>
   <description>description</description>
</model>

metadat-extractor-context.xml

   <bean id="extracter.xml.sample.AlfrescoModelMetadataExtracter"
         class="org.alfresco.repo.content.metadata.xml.XPathMetadataExtracter"
         parent="baseMetadataExtracter"
         init-method="init" >
      <property name="mappingProperties">
         <!–
            The properties can also be specified using a properties file on the classpath, e.g.:
            <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
               <property name="location">
                  <value>classpath:alfresco/extension/xml-metadata/AlfrescoModel-xpath-mappings.properties</value>
               </property>
            </bean>
         –>
         <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
            <property name="properties">
               <props>
                  <prop key="namespace.prefix.cm">http://www.alfresco.org/model/content/1.0</prop>
                  <prop key="author">cm:author</prop>
                  <prop key="title">cm:title</prop>
                  <prop key="description">cm:description</prop>
               </props>
            </property>
         </bean>
      </property>
      <property name="xpathMappingProperties">
         <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
            <property name="properties">
               <props>
                  <prop key="namespace.prefix.fm">http://www.alfresco.org/model/forum/1.0</prop>
                  <prop key="author">/model/author/text()</prop>
                  <prop key="title">/model/title/text()</prop>
                  <prop key="description">/model/description/text()</prop>
               </props>
            </property>
         </bean>
      </property>
   </bean>

   <!–
      This selector examines the XML documents, executing the given XPath statements until a
      match is made.
   –>
   <bean
         id="extracter.xml.sample.selector.XPathSelector"
         class="org.alfresco.repo.content.selector.XPathContentWorkerSelector"
         init-method="init">
      <property name="workers">
         <map>
            <entry key="/model">
               <ref bean="extracter.xml.sample.AlfrescoModelMetadataExtracter" />
            </entry>
         </map>
      </property>
   </bean>

In a site in share, I have create a folder with a rule : extract common metadata.

But when i upload a document into this folder, nothing append !!

Thanks in advance for help,

Regards

Sebus

Outcomes