3

I have a requirement in one of my Tridion UI extension work to call the API methods getListComponentPresentations and getAllComponentPresentations.

I want to know whats is the differences between the above two methods, in terms of object they return, and in terms of performance which one is better?

5

getListComponentPresentations is the Tridion.ContentManager.Page method which returns the Tridion.ContentManager.ListComponentPresentations object, which is a collection of Tridion.ContentManager.ComponentPresentation.

This is the list of Page Component Presentations (Associated with a page. Those which you adding in CME page dialog)

--

getAllComponentPresentations is the Tridion.Web.UI.Editors.SiteEdit.Model.Page method, which returns a collection of Tridion.Web.UI.Editors.SiteEdit.Model.ComponentPresentation.

This is the list of Page Component Presentations which is collected from published Page.



For instance when CP is embedded on a page from page template, then it will be retrieved with getAllComponentPresentations but not in getListComponentPresentations.

The difference between Tridion.Web.UI.Editors.SiteEdit.Model.ComponentPresentation and Tridion.ContentManager.ComponentPresentation is that the Tridion.Web.UI.Editors.SiteEdit.Model.ComponentPresentation is more like the set of componentID + componentTemplateId properties, when Tridion.ContentManager.ComponentPresentation is an domain model object.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.