Adding a Mime Type

From AlfrescoWiki

Jump to: navigation, search


Back to Server Configuration


[edit] Introduction

[edit] Adding

By default, there are two files that currently contain mimetype definitions:

  • mimetype-map.xml
  • mimetype-map-openoffice.xml

These are contained within the alfresco.war->repository.jar and should not be edited directly. Instead, override the mimetypeConfigService bean in an extension file, such as <extension>/alfresco/extension/custom-services-context.xml.

    <bean id="mimetypeConfigService" class="org.alfresco.config.xml.XMLConfigService" init-method="init">
        <constructor-arg>
            <bean class="org.alfresco.config.source.UrlConfigSource">
                <constructor-arg>
                    <list>
                        <value>classpath:alfresco/mimetype/mimetype-map.xml</value>
                        <value>classpath:alfresco/mimetype/mimetype-map-openoffice.xml</value>
                        <value>classpath:alfresco/mimetype/mimetype-custom-extensions.xml</value>
                    </list>
                </constructor-arg>
            </bean>
        </constructor-arg>
    </bean>

The UrlConfigService can load additional files such as:

  • classpath:alfresco/mimetype/mimetype-custom-extensions.xml - the file is in the app server's shared classpath location
  • file:/home/alfresco/conf/alfresco/mimetype/mimetype-custom-extensions.xml - the file is outside the server classpath locations

Any number of additional files can be added to the list.