05-26-2020 07:53 AM
Hello, i would like to ask, how can i use WHERE in Alfresco API
GET /nodes/{nodeId}/secondary-children
using WHERE and more than one assocType, for example like
where=(assocType='my:type1') or (assocType='my:type2')
If i use AND or OR in WHERE param, result is the same. I't there some possibility how to get two different associations using WHERE? Thanks
05-27-2020 02:58 AM
I don't know if I get you.
AFAIK a secondary child can be only from assoc type cm:contains and primary=false.
Did you define custom secondary associations?
05-27-2020 06:02 AM
Thank you for the answer but it's not true. I have custom association in content model like
<child-association name="my:type1"> <title>My Type</title> <source> <mandatory>true</mandatory> <many>true</many> </source> <target> <class>cm:content</class> <mandatory>false</mandatory> <many>true</many> </target> </child-association>
I need to get results for two associations, my:type1 or my:type2 in one request using where condition.
05-27-2020 06:16 AM
Those are not secondary associations. They are source and target associations.
You need to use these other REST API calls:
GET /nodes/{nodeId}/sources GET /nodes/{nodeId}/targets
05-27-2020 06:59 AM
Are you sure? And what about this https://api-explorer.alfresco.com/api-explorer/#!/nodes/listSecondaryChildren
05-27-2020 07:29 AM
As I said before that REST API invocation handles the cm:contains secondary associations.
But if you are not sure, let's wait for someone else that may have deeper knowledge of the API than me.
Explore our Alfresco products with the links below. Use labels to filter content by product module.