cancel
Showing results for 
Search instead for 
Did you mean: 

Word properties, custom mapping, categorization

shikarishambu
Champ in-the-making
Champ in-the-making
Hi,
I am trying to get some custom properties that are associated to my Word document into Alfresco,keep it as part of the metadata and categorize the document in Alfresco based on the Word document properties.

I have been able to get the default mapping to work -i.e. author=cm:author, title=cm:title, subject=cm:description etc…

I tried modifying custom-metadata-etractors-context.xml, as shown below to try map comment=cm:description and category=cm:category. I find that the description field in Alfresco still shows information from subject and the document is not categorized per category=cm:category.

My questions are -
a) Is there a way to over-ride the default mapping i.e. change subject=cm:description to comments=cm:description without creating custom content model
b) Is there a way to extend the default content model to have additional attributes cm:myattribute etc…If yes, how would I do it?
c) Is there a way to categorize the document in Alfresco based on the metadata by directly mapping the attribute to the category in Alfresco? Or, do I have to rely on Content rules?

TIA


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

<!–
       This sample show how to modify the mappings properties of the new V2.1 Metadata Extractors.
       In this example, in addition to the default mappings, the field 'user1' is mapped to
       'cm:description'.  The available source properties is described on the Javadocs of the
       extracter class.
–>
<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">cm:description</prop>
            </props>
        </property>
    </bean>

<bean id="extracter.OfficeDocument" class="org.alfresco.repo.content.metadata.OfficeMetadataExtracter" 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="Comments">cm:description</prop>
      <prop key="Category">cm:category</prop>
            </props>
        </property>
    </bean>

</beans>
1 REPLY 1

shikarishambu
Champ in-the-making
Champ in-the-making
I ended up creating a custom content model