cancel
Showing results for 
Search instead for 
Did you mean: 

Using where to get more association types

MartinTichovsky
Champ in-the-making
Champ in-the-making

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 5

angelborroy
Community Manager Community Manager
Community Manager

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

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.

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

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