cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the properties defined in custom content model?

debi
Champ in-the-making
Champ in-the-making
Hi,
I have registered my content model. But the problem I am facing is when I use the following piece of code I am unable to see the model which I have registered.

QName name = QName.createQName("demo.model","newModel");
System.out.println("Models "+registry.getDictionaryService().getAllModels());


What I am trying to do is to get the properties defined in my custom content model. I use the following code:

QName name = QName.createQName("demo.model","newModel");
Set<QName> set = (Set<QName>)registry.getDictionaryService().getProperties(name);

It throws an exception mentioning that the content model doesnot exist.
Am I missing something?
Plz help.
Thanks in advance,
Debi.
2 REPLIES 2

cbosdonnat
Champ in-the-making
Champ in-the-making
Hi debi,

Have you registered your model with the dictionary service using a configuration like the following ?

   <bean id="myModel" parent="dictionaryModelBootstrap">
        <property name="models">
            <list>
                <value>path/to/myModel.xml</value>
            </list>
        </property>
    </bean>

Could you provide more informations in order to get helped ?

debi
Champ in-the-making
Champ in-the-making
Hi,
this is how I have registered.

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

Any mistakes here??
Thanks in advance.