Retrieving related Page metadata
The PageMetaFactory has a method to retrieve Page Metadata directly based on a number of Keywords without having to first call the TaxonomyRelationManager.
The API operation is similar to the one in the TaxonomyRelationManager and ComponentPresentationFactory, only the return type is PageMeta[].
The following code demonstrates how to retrieve Page Metadata directly using the PageMetaFactory:
String[] selectedKeywordURIs = new String[] { "tcm:12-800-1024", "tcm:12-801-1024", "tcm:12-856-1024" };
Keyword[] selectedKeywords = new Keyword[selectedKeywordURIs.Length];
TaxonomyFactory taxonomyFactory = new TaxonomyFactory();
for (int i = 0; i < selectedKeywordURIs.Length; i++) {
selectedKeywords[i] = taxonomyFactory.GetTaxonomyKeyword(selectedKeywordURIs[i]);
}
PageMetaFactory pageFactory = new PageMetaFactory(12);
PageMeta[] pageMetas = pageFactory.GetTaxonomyPages(selectedKeywords, true);