AnsweredAssumed Answered

Custom type and attributes

Question asked by nicolasb on Nov 28, 2005
Latest reply on Dec 7, 2005 by greglenain
Hi,

New to Alfresco I'm trying to create a custom type with some custom attributes.
I can create some custom documents using the UI and now I am trying to create some using the following code :


                ChildAssociationRef assocRef = nodeService.createNode(
                        noderefdmcl,
                        ContentModel.ASSOC_CHILDREN,
                        QName.createQName(NamespaceService.ALFRESCO_URI,
                                          QName.createValidLocalName(
                                                  filename)),
                        QName.createQName("{custom.model}ren_dmodule"),
                        nodeProperties);

It does work fine.
Unfortunately, I can't read or write custom properties :

nodeService.setProperty(assocRef.getChildRef(), QName.createQName("{custom.model}modelic"), "toto");
or
System.out.println(nodeService.getProperty(assocRef.getChildRef(), QName.createQName("{custom.model}modelic")));

CustomModel.xml :
   <namespaces>
      <namespace uri="custom.model" prefix="es"/>
   </namespaces>
<types>  
<type name="es:ren_dmodule">
<title>data module</title>
<parent>cm:content</parent>
<properties>
  <property name="es:modelic">
       <title>modelic</title>
       <type>d:text</type>
       <mandatory>false</mandatory>
       <index enabled="true">
     <atomic>true</atomic>
     <stored>false</stored>
     <tokenised>true</tokenised>
       </index>
  </property>



What is wrong ?


Regards,


Nicolas B.

Outcomes