API - TcmExtensions/TcmCDService GitHub Wiki

Introduction

The Tridion Content Delivery Service API is available for re-usage through the TcmCDService.Remoting library.

Linking

Component Linking

/// <summary>
/// Resolves the component link
/// </summary>
/// <param name="sourcePageUri">Page uri</param>
/// <param name="targetComponentUri">Target component uri</param>
/// <param name="excludeTemplateUri">Excluded template uri</param>
/// <param name="showAnchor">If <c>true</c>, render the url anchor</param>
/// <returns>Resolved component url or null</returns>
String ComponentLink.Get(String sourcePageUri, String targetComponentUri, String excludeTemplateUri, Boolean showAnchor);

/// <summary>
/// Resolves the component link
/// </summary>
/// <param name="componentUri">Component uri</param>
/// <returns>Resolved component url or null</returns>		
public static String Get(String componentUri);

Binary Linking

/// <summary>
/// Resolves the binary link
/// </summary>
/// <param name="binaryUri">Binary component uri</param>
/// <param name="variantId">Binary variant id</param>
/// <param name="anchor">Link anchor</param>
/// <returns>Resolved binary url or null</returns>
String BinaryLink.Get(String binaryUri, String variantId, String anchor);

Page Linking

/// <summary>
/// Resolves the page link
/// </summary>
/// <param name="targetPageUri">Page uri</param>
/// <param name="anchor">Link anchor</param>
/// <param name="parameters">Link parameters</param>
/// <returns>Resolved page link or null</returns>		
String PageLink.Get(String targetPageUri, String anchor, String parameters);

/// <summary>
/// Resolves the page link
/// </summary>
/// <param name="targetPageUri">Page uri</param>
/// <returns>Resolved page link or null</returns>
String PageLink.Get(String targetPageUri);

Component Metadata

/// <summary>
/// Retrieves the <see cref="T:TcmCDService.Contracts.ComponentMeta" /> for a given component Uri
/// </summary>
/// <param name="componentUri">Component uri</param>
/// <returns>
///   <see cref="T:TcmCDService.Contracts.ComponentMeta" />
/// </returns>		
Contracts.ComponentMeta ComponentMeta.Get(String componentUri)

/// <summary>
/// Retrieves the <see cref="T:TcmCDService.Contracts.ComponentMeta" /> for a given component id
/// </summary>
/// <param name="publicationId">Publication id as <see cref="T:System.Int32" /></param>
/// <param name="componentId">Component id as <see cref="T:System.Int32" /></param>
/// <returns>
///   <see cref="T:TcmCDService.Contracts.ComponentMeta" /> or null
/// </returns>		
Contracts.ComponentMeta ComponentMeta.Get(int publicationId, int componentId)

Binary Data

/// <summary>
/// Retrieves the binary data for a given binary tcm uri
/// </summary>
/// <param name="binaryUri">Binary uri</param>
/// <returns>Binary data as <see cref="T:System.Byte" /> array</returns>		
Byte[] BinaryData.Get(String binaryUri);

/// <summary>
/// Retrieves the binary data for a given binary tcm uri and variant id
/// </summary>
/// <param name="binaryUri">Binary uri</param>
/// <param name="variantId">Binary variant id</param>
/// <returns>Binary data as <see cref="T:System.Byte" /> array</returns>
Byte[] BinaryData.Get(String binaryUri, String variantId);

/// <summary>
/// Retrieves the binary data for a given binary id variant id
/// </summary>
/// <param name="publicationId">Publication id as <see cref="T:System.Int32" /></param>
/// <param name="binaryId">Binary id as <see cref="T:System.Int32" /></param>
/// <returns>Binary data as <see cref="T:System.Byte" /> array</returns>		
Byte[] BinaryData.Get(int publicationId, int binaryId);

/// <summary>
/// Retrieves the binary data for a given binary id variant id
/// </summary>
/// <param name="publicationId">Publication id as <see cref="T:System.Int32" /></param>
/// <param name="binaryId">Binary id as <see cref="T:System.Int32" /></param>
/// <param name="variantId">Binary variant id</param>
/// <returns>Binary data as <see cref="T:System.Byte" /> array</returns>		
Byte[] BinaryData.Get(int publicationId, int binaryId, String variantId);

Component Presentation

/// <summary>
/// Gets the <see cref="T:TcmCDService.Contracts.ComponentPresentation" /> with highest priority.
/// </summary>
/// <param name="componentUri">Component uri</param>
/// <returns>
///   <see cref="T:TcmCDService.Contracts.ComponentPresentation" />
/// </returns>		
Contracts.ComponentPresentation ComponentPresentation.GetHighestPriority(String componentUri);

/// <summary>
/// Gets the <see cref="T:TcmCDService.Contracts.ComponentPresentation" /> with highest priority.
/// </summary>
/// <param name="publicationId">Publication id as <see cref="T:System.Int32" /></param>
/// <param name="componentId">Component id as <see cref="T:System.Int32" /></param>
/// <returns>
///   <see cref="T:TcmCDService.Contracts.ComponentPresentation" />
/// </returns>		
Contracts.ComponentPresentation ComponentPresentation.GetHighestPriority(int publicationId, int componentId);

/// <summary>
/// Gets the <see cref="T:TcmCDService.Contracts.ComponentPresentation" /> with the specified templateUri
/// </summary>
/// <param name="componentUri">Component uri</param>
/// <param name="templateUri">Component template uri</param>
/// <returns>
///   <see cref="T:TcmCDService.Contracts.ComponentPresentation" />
/// </returns>
Contracts.ComponentPresentation ComponentPresentation.Get(String componentUri, String templateUri);

/// <summary>
/// Gets the <see cref="T:TcmCDService.Contracts.ComponentPresentation" /> with the specified template id
/// </summary>
/// <param name="componentUri">Component uri</param>
/// <param name="templateId">Component template id as <see cref="T:System.Int32" /></param>
/// <returns>
///   <see cref="T:TcmCDService.Contracts.ComponentPresentation" />
/// </returns>		
Contracts.ComponentPresentation ComponentPresentation.Get(String componentUri, int templateId);

/// <summary>
/// Gets the <see cref="T:TcmCDService.Contracts.ComponentPresentation" /> with the specified templateUri
/// </summary>
/// <param name="publicationId">Publication id as <see cref="T:System.Int32" /></param>
/// <param name="componentId">Component id as <see cref="T:System.Int32" /></param>
/// <param name="templateId">Component template id as <see cref="T:System.Int32" /></param>
/// <returns>
///   <see cref="T:TcmCDService.Contracts.ComponentPresentation" /> or null
/// </returns>
Contracts.ComponentPresentation ComponentPresentation.Get(int publicationId, int componentId, int templateId);

Component Presentation Assembly

/// <summary>
/// Assembles the component presentation with the given componentUri and componentTemplateUri
/// </summary>
/// <param name="componentUri">Component uri</param>
/// <param name="componentTemplateUri">Component template uri</param>
/// <returns>Assembled component presentation content</returns>
/// <remarks>Note this only works for XML based dynamic component presentations</remarks>
String ComponentPresentationAssembly.Get(String componentUri, String componentTemplateUri);

Page Content

/// <summary>
/// Retrieves the page data for a given page tcm uri
/// </summary>
/// <param name="pageUri">Page uri</param>
/// <returns>Page data as <see cref="T:System.String" /></returns>		
String PageContent.Get(String pageUri);

/// <summary>
/// Retrieves the page data for a given page tcm uri
/// </summary>
/// <param name="publicationId">Publication id as <see cref="T:System.Int32" /></param>
/// <param name="pageId">Page id as <see cref="T:System.Int32" /></param>
/// <returns>Page data as <see cref="T:System.String" /> array</returns>
String PageContent.Get(int publicationId, int pageId);

Query

/// <summary>
/// Gets the <see cref="T:System.Collections.Generic.IEnumerable{System.String}" /> of matched component uris
/// </summary>
/// <param name="brokerQuery"><see cref="T:TcmCDService.Contracts.BrokerQuery" /></param>
/// <returns>
///   <see cref="T:System.Collections.Generic.IEnumerable{System.String}" />
/// </returns>		
IEnumerable<String> Query.Execute(Contracts.BrokerQuery brokerQuery);

/// <summary>
/// Gets the <see cref="T:System.Collections.Generic.IEnumerable{System.String}" /> of matched component uris
/// </summary>
/// <param name="brokerQueries"><see cref="I:System.Collections.Generic.IEnumerable{TcmCDService.Contracts.BrokerQuery}" /></param>
/// <returns>
///   <see cref="T:System.Collections.Generic.IEnumerable{System.String}" />
/// </returns>		
IEnumerable<String> Query.Execute(IEnumerable<Contracts.BrokerQuery> brokerQueries);

/// <summary>
/// Gets the <see cref="T:System.Collections.Generic.IEnumerable{TcmCDService.Contracts.ComponentPresentation}" /> of matched components
/// </summary>
/// <param name="brokerQuery"><see cref="T:TcmCDService.Contracts.BrokerQuery" /></param>
/// <returns>
///   <see cref="T:System.Collections.Generic.IEnumerable{TcmCDService.Contracts.ComponentPresentation}" />
/// </returns>
IEnumerable<Contracts.ComponentPresentation> Query.ExecutePresentations(Contracts.BrokerQuery brokerQuery);

/// <summary>
/// Gets the <see cref="T:System.Collections.Generic.IEnumerable{TcmCDService.Contracts.ComponentPresentation}" /> of matched components
/// </summary>
/// <param name="brokerQueries"><see cref="I:System.Collections.Generic.IEnumerable{TcmCDService.Contracts.BrokerQuery}" /></param>
/// <returns>
///   <see cref="T:System.Collections.Generic.IEnumerable{TcmCDService.Contracts.ComponentPresentation}" />
/// </returns>
IEnumerable<Contracts.ComponentPresentation> Query.ExecutePresentations(IEnumerable<Contracts.BrokerQuery> brokerQueries);

Keyword

/// <summary>
/// Gets the <see cref="T:System.Collections.Generic.IEnumerable{System.String}" /> taxonomy uris for a <see cref="P:publicationUri" />
/// </summary>
/// <param name="publicationUri">Publication Uri</param>
/// <returns>
///   <see cref="T:System.Collections.Generic.IEnumerable{System.String}" />
/// </returns>
IEnumerable<String> Keyword.GetTaxonomies(String publicationUri);

/// <summary>
/// Gets the <see cref="T:TcmCDService.Contracts.Keyword" /> for a <see cref="P:keywordUri" />
/// </summary>
/// <param name="keywordUri">Keyword Uri</param>
/// <returns>
///   <see cref="T:TcmCDService.Contracts.Keyword" />
/// </returns>
Contracts.Keyword Keyword.Get(String keywordUri);

/// <summary>
/// Gets the root keyword for the given <see cref="P:taxonomyUri" />
/// </summary>
/// <param name="taxonomyUri">Taxonomy <see cref="T:TcmCDService.Tridion.TcmUri" /></param>
/// <returns>
///   <see cref="T:TcmCDService.Contracts.Keyword" />
/// </returns>
Contracts.Keyword Keyword.GetKeywords(String taxonomyUri);

/// <summary>
/// Gets the root keyword for the given <see cref="P:taxonomyUri" />
/// </summary>
/// <param name="taxonomyUri">Taxonomy <see cref="T:TcmCDService.Tridion.TcmUri" /></param>
/// <param name="taxonomyFilter"><see cref="T:TcmCDService.Contracts.TaxonomyFilter" /> to apply.</param>
/// <returns>
///   <see cref="T:TcmCDService.Contracts.Keyword" />
/// </returns>
Contracts.Keyword Keyword.GetKeywords(String taxonomyUri, Contracts.TaxonomyFilter taxonomyFilter);

/// <summary>
/// Gets the root keyword for the given <see cref="P:taxonomyUri" />
/// </summary>
/// <param name="taxonomyUri">Taxonomy <see cref="T:TcmCDService.Tridion.TcmUri" /></param>
/// <param name="taxonomyFilter"><see cref="T:TcmCDService.Contracts.TaxonomyFilter" /> to apply.</param>
/// <param name="taxonomyFormatter"><see cref="T:TcmCDService.Contracts.TaxonomyFormatter" /> to apply.</param>
/// <returns>
///   <see cref="T:TcmCDService.Contracts.Keyword" />
/// </returns>
Contracts.Keyword Keyword.GetKeywords(String taxonomyUri, Contracts.TaxonomyFilter taxonomyFilter, Contracts.TaxonomyFormatter taxonomyFormatter);
⚠️ **GitHub.com Fallback** ⚠️