Content Delivery API – GetTaxonomyComponentPresentations Bug

From this months SDL Tridion SDL WCMS newletter there is the following note concerning a bug in the Content Delivery API.

A defect has been reported and validated in the SDL Tridion 2009 Content Delivery API – GetTaxonomyComponentPresentations’

The method ‘GetTaxonomyComponentPresentations’ is returning DCPs from multiple publications – the method is intended to return DCPs only from the same Publication the Taxonomy exists in. As a workaround, you may use a direct Broker Query to retrieve the components tagged with the keyword, then retrieve DCPs based on those components with ComponentPresentationFactory. A JSP sample is provided below.

Query   brokerQuery = new Query();

Criteria   Criteria1 = new Criteria(

new TaxonomyKeywordCriteria(taxonomyURI, firstkeywordURI),

new TaxonomyKeywordCriteria(taxonomyURI, secondKeywordURI),

new ItemTypeCriteria(16),

new PublicationCriteria(44)

);

brokerQuery.setCriteria(Criteria1);

String[]   foundItems = brokerQuery.executeQuery();

/*   Retrieve componentpresentations */

ComponentPresentationFactory   ……

It’s a shame they have just released Service Pack 1 for WCMS 2009 as this would have been a nice issue to have resolved.  I wonder if this will be resolved in Service Pack 2, or added to WCMS 2010.

As always interested to know if anyone has other workarounds than the one above.

This entry was posted in Tridion news and tagged by John Winter. Bookmark the permalink.

About John Winter

Over the last 15 years, John has lead over 50 SDL Tridion implementations for major clients including, Alliance Data, Viking Cruises, Lexus, Dunlop, Dexia Bank, Toyota and SKF. John manages the USA side of Content Bloom, undertaking a variety of tasks including consultancy, development, architecture and trainer.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>