cancel
Showing results for 
Search instead for 
Did you mean: 

Help - How to use custom metadata (not developing in Java)

ritesh
Champ in-the-making
Champ in-the-making
Hi friends, I´m new to Alfresco and have a doubt. I´m adding a new custom model for folders and documents. I´m not developing the application in Java but a different programming language. Once the custom model is uploaded, how can I set these custom properties? Thank you in advance.
9 REPLIES 9

rjohnson
Star Contributor
Star Contributor
They are in the properties array of any document.

Bob Johnson

ritesh
Champ in-the-making
Champ in-the-making
Hi rjohnson, I´ve tried to insert these new properties in the propertyString array (when creating the document) but I can´t get it done:

      <soap:Fault>
         <faultcode>soapSmiley Frustratederver</faultcode>
         <faultstring>Property xxx:yyy not found for type cmis:document in CMIS Dictionary</faultstring>
         <detail>
            <cmisFault xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:ns3="http://www.alfresco.org">
               <type>invalidArgument</type>
              
400

               <message>Property xxx:yyy not found for type cmis:document in CMIS Dictionary</message>
            </cmisFault>
         </detail>
      </soap:Fault>

Can anyone help please? How can make sure I´m inserting the new defined properties properly?

rjohnson
Star Contributor
Star Contributor
Are you trying to inteact with Alfresco via CMIS? If you do this, then there are defined ways of creating a document and updating its metadata.

What language are you using.

Have you set the document type correctly?

Bob Johnson

ritesh
Champ in-the-making
Champ in-the-making
Hi, thanks for your reply. I´ve edited the previous message but I think I can still answer. I´m developing in Ensemble's ObjectScript and interacting via CMIS. I think I´ve set the document type correctly because when I don´t use the custom model metadata everything works fine. This is part of the request:

<soapenv:Body>
<ns:createDocument>
<ns:repositoryId>xxxxxxxxxxxxxxxxxxxxxxxx</ns:repositoryId>
<nsSmiley Tongueroperties>
<ns1Smiley TongueropertyId propertyDefinitionId="cmisSmiley SurprisedbjectTypeId">
<ns1:value>cmis:document</ns1:value></ns1Smiley TongueropertyId>
<ns1Smiley TongueropertyString propertyDefinitionId="cmis:name">
<ns1:value>name12345.txt</ns1:value></ns1Smiley TongueropertyString>

<!– THIS IS THE CUSTOM METADATA I´M TRYING TO INSERT –>
<ns1Smiley TongueropertyString propertyDefinitionId="xxx:yyy">
<ns1:value>asdf</ns1:value>
</ns1Smiley TongueropertyString>
<!– ———————————————— –>

</nsSmiley Tongueroperties>
<ns:folderId>workspace://SpacesStore/1234567890</ns:folderId>
<ns:contentStream>
<ns:mimeType>application/text</ns:mimeType>
<ns:filename>name12345.txt</ns:filename>
<ns:stream>SGVsbG8gV29ybGQ=</ns:stream>
</ns:contentStream>
</ns:createDocument>
</soapenv:Body>

Thanks,
Ritesh

rjohnson
Star Contributor
Star Contributor
I don't think you are setting your document type correctly. I have no background in objectscript but it looks to me as if you are setting cmisSmiley SurprisedbjectTypeId to cmis:document and theirin lies the problem. cmis:document is equivalent to cm:content and your custome model will extent cm:content and call it something else (unless you have modified the base model which is very unwise). So, I'm guessing you have defined a type like xxx:mydoctype. You therefore would set cmisSmiley SurprisedbjectTypeId to D:xxx:mydoctype. With this done, you should then be able to set your custom metadats.

Good luck

Bob Johnson

ritesh
Champ in-the-making
Champ in-the-making
Thanks a lot Bob! With this change it works perfect! Just a last question… why the prefix "D:" (without this it wouldn´t work and I didn´t understand what this prefix stands for). Anything to do with the dictionary?

Thanks for your help Smiley Happy

kaynezhang
World-Class Innovator
World-Class Innovator
😧 means subtype of Document
F: means subtype of Folder
R: means subtype of relationship
P: means subtype of policy

ritesh
Champ in-the-making
Champ in-the-making
Thanks kaynezhang!

kaynezhang
World-Class Innovator
World-Class Innovator
you are weblcome,good luck.