Post to secundaryObjectTypeIds using CMIS http

cancel
Showing results for 
Search instead for 
Did you mean: 
JayQueue
Customer

Post to secundaryObjectTypeIds using CMIS http

Jump to solution

Hello,

I'm trying to upload documents with Talend. I can set the ObjectTypeIds with a POST but I have no clue how to access the cmis:secondaryObjectTypeIds. I keep getting

{
    "exception": "invalidArgument",
    "message": "magda:customerFirstName is unknown!",
}

This is what I post as a test

image.pngThese are the properties in CMIS Workbench

image.png

 

Any ideas how to populate them?

 

TIA

Jonathan

1 Solution

Accepted Solutions
angelborroy
Alfresco Employee

Re: Post to secundaryObjectTypeIds using CMIS http

Jump to solution

Aspects are represented as arrays.

Try this approach:

 

Hyland Developer Evangelist

View solution in original post

6 Replies
angelborroy
Alfresco Employee

Re: Post to secundaryObjectTypeIds using CMIS http

Jump to solution

Before adding a value for a property in a secondary type (called aspect in Alfresco), you need to add the secondary type itself.

The property cmis:secondaryObjectTypeIds includes a list with all the supported secondary types, so I guess that you need to get the original list and then add the value you need (magda:recipientEmail) to the list for the property in the POST request.

Hyland Developer Evangelist
JayQueue
Customer

Re: Post to secundaryObjectTypeIds using CMIS http

Jump to solution

Hello @angelborroy (Was just using your postman file after reading your blog)

This is what I see in CMIS Workbench

image.png

 

I see that the Object Type ID is also D:magda:invoice which I use when I upload.

I tried this in Postman

image.pngBut still ObjectNotFound

angelborroy
Alfresco Employee

Re: Post to secundaryObjectTypeIds using CMIS http

Jump to solution

Try using "P:magda:recipientEmail" instead of "magda:recipientEmail" in the property value.

Hyland Developer Evangelist
JayQueue
Customer

Re: Post to secundaryObjectTypeIds using CMIS http

Jump to solution

"Worked" since I'm getting a different error message now.

 

"message": "Constraint violation: 09180164 Found 4 integrity violations:
Mandatory aspect not set: 
Node: workspace://SpacesStore/7949ebf7-3bd9-4618-8703-b3394ba54e2b
Type: {http://www.domain.be/model/content/magda/1.0}invoice   
Aspect: {http://www.domain.be/model/content/magda/1.0}customer
Mandatory aspect not set:
Node: workspace://SpacesStore/7949ebf7-3bd9-4618-8703-b3394ba54e2b
Type: {http://www.domain.be/model/content/magda/1.0}invoice
Aspect: {http://www.domain.be/model/content/magda/1.0}recipient
Mandatory aspect not set: Node: workspace://SpacesStore/7949ebf7-3bd9-4618-8703-b3394ba54e2b Type: {http://www.domain.be/model/content/magda/1.0}invoice Aspect: {http://www.domain.be/model/content/magda/1.0}payment Mandatory aspect not set: Node: workspace://SpacesStore/7949ebf7-3bd9-4618-8703-b3394ba54e2b Type: {http://www.domain.be/model/content/magda/1.0}invoice Aspect: {http://www.domain.be/model/content/magda/1.0}delivery",

 

 

I tried to add the aspects with no luck

image.png

Then I tried like this

image.png

But then I get

exception": "invalidArgument",
    "message": "magda:customerFirstName is unknown!",

How do I add multiple aspects?

 

Edit: Reading about this on https://docs.alfresco.com/content-services/6.1/develop/reference/cmis-ref/#browserbinding

angelborroy
Alfresco Employee

Re: Post to secundaryObjectTypeIds using CMIS http

Jump to solution

Aspects are represented as arrays.

Try this approach:

 

Hyland Developer Evangelist

View solution in original post

JayQueue
Customer

Re: Post to secundaryObjectTypeIds using CMIS http

Jump to solution

Success! 

I tried that as well but was using the postman-echo.com Smiley Frustrated

Thank you! :-)