Skip to main content
Notice removed Draw attention by user3760419
Bounty Ended with Bjørn van Dommelen's answer chosen by user3760419
added 30 characters in body
Source Link
user3760419
  • 1.1k
  • 6
  • 11

I would like to use OData service to get component presentations based on conditions, but I am running into some problems. I am aware that Tridion OData service is "limited" OData, so I was wondering is something like this possible through Tridion OData (in a single query):

Get all component presentations where CT has id 40 and Component contains keyword A and keyword B.

I have tried filtering on custom metas and expanding on Component/ComponentPresentations but this is not returning only items that I need I can not filter further on the expanded set...

Is this possible with OData or should I "play it safe" and just use broker api ?

Adding additional information:

Slightly simplifying scenario to better explain what I am trying to do:

Get all CP's from publication 1 based on custom meta

...odata.svc/CustomMetas?$filter=KeyName eq 'Rank' and StringValue eq 'A' and PublicationId eq 1 &$expand=Component/ComponentPresentations

Get all CP's based on CT ID

...odata.svc/ComponentPresentations?$filter=PublicationId eq 1 and TemplateId eq 4040&$expand=Component/CustomMetas

How do I combine these two conditions and get all CP's which are rendered with CT 40 and have keyword Rank with value A in just a single call to odata ?

I would like to use OData service to get component presentations based on conditions, but I am running into some problems. I am aware that Tridion OData service is "limited" OData, so I was wondering is something like this possible through Tridion OData (in a single query):

Get all component presentations where CT has id 40 and Component contains keyword A and keyword B.

I have tried filtering on custom metas and expanding on Component/ComponentPresentations but this is not returning only items that I need I can not filter further on the expanded set...

Is this possible with OData or should I "play it safe" and just use broker api ?

Adding additional information:

Slightly simplifying scenario to better explain what I am trying to do:

Get all CP's from publication 1 based on custom meta

...odata.svc/CustomMetas?$filter=KeyName eq 'Rank' and StringValue eq 'A' and PublicationId eq 1 &$expand=Component/ComponentPresentations

Get all CP's based on CT ID

...odata.svc/ComponentPresentations?$filter=PublicationId eq 1 and TemplateId eq 40

How do I combine these two conditions and get all CP's which are rendered with CT 40 and have keyword Rank with value A in just a single call to odata ?

I would like to use OData service to get component presentations based on conditions, but I am running into some problems. I am aware that Tridion OData service is "limited" OData, so I was wondering is something like this possible through Tridion OData (in a single query):

Get all component presentations where CT has id 40 and Component contains keyword A and keyword B.

I have tried filtering on custom metas and expanding on Component/ComponentPresentations but this is not returning only items that I need I can not filter further on the expanded set...

Is this possible with OData or should I "play it safe" and just use broker api ?

Adding additional information:

Slightly simplifying scenario to better explain what I am trying to do:

Get all CP's from publication 1 based on custom meta

...odata.svc/CustomMetas?$filter=KeyName eq 'Rank' and StringValue eq 'A' and PublicationId eq 1 &$expand=Component/ComponentPresentations

Get all CP's based on CT ID

...odata.svc/ComponentPresentations?$filter=PublicationId eq 1 and TemplateId eq 40&$expand=Component/CustomMetas

How do I combine these two conditions and get all CP's which are rendered with CT 40 and have keyword Rank with value A in just a single call to odata ?

Notice added Draw attention by user3760419
Bounty Started worth 100 reputation by user3760419
added 591 characters in body
Source Link
user3760419
  • 1.1k
  • 6
  • 11

I would like to use OData service to get component presentations based on conditions, but I am running into some problems. I am aware that Tridion OData service is "limited" OData, so I was wondering is something like this possible through Tridion OData (in a single query):

Get all component presentations where CT has id 40 and Component contains keyword A and keyword B.

I have tried filtering on custom metas and expanding on Component/ComponentPresentations but this is not returning only items that I need I can not filter further on the expanded set...

Is this possible with OData or should I "play it safe" and just use broker api ?

Adding additional information:

Slightly simplifying scenario to better explain what I am trying to do:

Get all CP's from publication 1 based on custom meta

...odata.svc/CustomMetas?$filter=KeyName eq 'Rank' and StringValue eq 'A' and PublicationId eq 1 &$expand=Component/ComponentPresentations

Get all CP's based on CT ID

...odata.svc/ComponentPresentations?$filter=PublicationId eq 1 and TemplateId eq 40

How do I combine these two conditions and get all CP's which are rendered with CT 40 and have keyword Rank with value A in just a single call to odata ?

I would like to use OData service to get component presentations based on conditions, but I am running into some problems. I am aware that Tridion OData service is "limited" OData, so I was wondering is something like this possible through Tridion OData (in a single query):

Get all component presentations where CT has id 40 and Component contains keyword A and keyword B.

I have tried filtering on custom metas and expanding on Component/ComponentPresentations but this is not returning only items that I need I can not filter further on the expanded set...

Is this possible with OData or should I "play it safe" and just use broker api ?

I would like to use OData service to get component presentations based on conditions, but I am running into some problems. I am aware that Tridion OData service is "limited" OData, so I was wondering is something like this possible through Tridion OData (in a single query):

Get all component presentations where CT has id 40 and Component contains keyword A and keyword B.

I have tried filtering on custom metas and expanding on Component/ComponentPresentations but this is not returning only items that I need I can not filter further on the expanded set...

Is this possible with OData or should I "play it safe" and just use broker api ?

Adding additional information:

Slightly simplifying scenario to better explain what I am trying to do:

Get all CP's from publication 1 based on custom meta

...odata.svc/CustomMetas?$filter=KeyName eq 'Rank' and StringValue eq 'A' and PublicationId eq 1 &$expand=Component/ComponentPresentations

Get all CP's based on CT ID

...odata.svc/ComponentPresentations?$filter=PublicationId eq 1 and TemplateId eq 40

How do I combine these two conditions and get all CP's which are rendered with CT 40 and have keyword Rank with value A in just a single call to odata ?

Tweeted twitter.com/#!/StackTridion/status/534115455389020160
edited title
Link

Can you get all component presentations where CT has id 40 and Component contains keyword A and keyword B through Tridion OData service query

Source Link
user3760419
  • 1.1k
  • 6
  • 11
Loading