cancel
Showing results for 
Search instead for 
Did you mean: 

how to define a new model in 1.2

pmarreddy
Champ in-the-making
Champ in-the-making
hi,

in 1.2 extention-context.xml is removed, now wher do we specify new models.


adv thanks prasanth.
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
The example and custom models are now placed in the correct place in the bundles which is /jboss/server/default/conf/alfresco/extension for JBoss and /tomcat/shared/classes/alfresco/extension for Tomcat.

To include either model remove the .sample extension from the file in the location above.

The Repository Configuration page on the wiki outlines how you include custom config files in Alfresco from 1.2 onwards it's probably also worth reading this page.

cmeinck
Champ in-the-making
Champ in-the-making
When I try to add my custom Data Model under 1.2RC2, I get the following error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [C:\Tomcat 5.5\shared\classes\alfresco\extension\extension-context.xml]: Initialization of bean failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: Could not find bootstrap model classpath:alfresco\extension\customModel.xml
org.alfresco.service.cmr.dictionary.DictionaryException: Could not find bootstrap model classpath:alfresco\extension\customModel.xml

My extension context file looks like this:

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

<beans>
   
   <!– Registration of new models –>
   
    <bean id="extension.dictionaryBootstrap" class="org.alfresco.repo.dictionary.DictionaryBootstrap" init-method="bootstrap" depends-on="dictionaryBootstrap">
        <property name="dictionaryDAO"><ref bean="dictionaryDAO"/></property>
        <property name="models">
            <list>
                <value>classpath:alfresco\extension\customModel.xml</value>
            </list>
        </property>
    </bean>
     
</beans>

Both are located in the config path: C:\Tomcat 5.5\shared\classes\alfresco\extension.

gavinc
Champ in-the-making
Champ in-the-making
The XML in your extension-context.xml looks slightly wrong, did you copy this from RC1?

You can either replace it with the following:

  
<bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/customModel.xml</value>
            </list>
        </property>
    </bean>

or find custom-model-context.xml.sample in C:\Tomcat 5.5\shared\classes\alfresco\extension and rename it to custom-model-context.xml (and of course delete your extenstion-context.xml)

cmeinck
Champ in-the-making
Champ in-the-making
Thanks, that did the trick. I was indeed using the old style extension-context file.