Using where to get more association types

cancel
Showing results for 
Search instead for 
Did you mean: 
MartinTichovsky
Member II

Using where to get more association types

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

 

5 Replies
angelborroy
Alfresco Employee

Re: Using where to get more association types

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?

Hyland Developer Evangelist
MartinTichovsky
Member II

Re: Using where to get more association types

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.

angelborroy
Alfresco Employee

Re: Using where to get more association types

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
Hyland Developer Evangelist
MartinTichovsky
Member II

Re: Using where to get more association types

angelborroy
Alfresco Employee

Re: Using where to get more association types

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.

Hyland Developer Evangelist