AnsweredAssumed Answered

Extracting metadata:  EXIF Tags into the alfresco tagging system

Question asked by mkramer on May 2, 2013
Dear forum,

My objective:
We have an extensive library of images which have been tagged dutifully by our photographers with Adobe Lightroom.
I would like to extract these tags from the files meta data and import them into alfresco.

My system:
I'm running Alfresco 4.2.c on Debian Wheezy.

Where I've looked:
I have found this in Jira: https://issues.alfresco.com/jira/browse/ALF-14965
and furthermore read into meta data extraction in alfresco.

My course of action:
Ray Gauss apparently solved the problem and kind of explained how. Unfortunately it does not work for me so far and I don't know if it's my fault or if I need the nightly of 4.2.d to have a chance of getting it to work.

I've created a [TOMCAT_HOME]/shared/classes/alfresco/extension/dev-context.xml and filled it as follows:

<blockcode>
<?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="extract-metadata" class="org.alfresco.repo.action.executer.ContentMetadataExtracter" parent="action-executer">
        <property name="nodeService">
            <ref bean="NodeService" />
        </property>
        <property name="contentService">
            <ref bean="ContentService" />
        </property>
        <property name="dictionaryService">
           <ref bean="dictionaryService" />
        </property>
        <property name="taggingService">
            <ref bean="TaggingService" />
        </property>
        <property name="metadataExtracterRegistry">
            <ref bean="metadataExtracterRegistry" />
        </property>
        <property name="applicableTypes">
            <list>
            <value>exif</value>
            <value>taggable</value>
            <value>{http://www.alfresco.org/model/content/1.0}content</value>
           </list>
        </property>
        <property name="carryAspectProperties">
            <value>true</value>
        </property>
        <property name="enableStringTagging">
            <value>true</value>
        </property>
    </bean>
</beans>

</blockcode>

QUESTION: What would be valid examples of values for <property name="applicableTypes">? I've chosen aspect names but it hasn't helped me so far.

Then I would need to modify an extractor to actually extract the keywords to the tags



To my understanding I will have to override the configuration of an existing meta-data-extractor, since image meta-data is already extracted.

I then created a [TOMCAT_HOME]/shared/classes/alfresco/extension/custom-metadata-extrators-context.xml

and edited it as follows:

<blockcode>
<?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.TikaAuto" class="org.alfresco.repo.content.metadata.TikaAutoMetadataExtracter" parent="baseMetadataExtracter">
        <constructor-arg><ref bean="tikaConfig"/></constructor-arg>
        <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="description">cm:taggable</prop>
            </props>
        </property>
    </bean>
</beans>
</blockcode>

Can you spot mistakes I made or problems with my configuration? I'm not really sure as to how to adress the correct meta-data fields within EXIF.

Outcomes