2016-07-19 13:00:43 +02:00
using System ;
2015-02-18 17:14:55 +01:00
using System.Collections.Generic ;
using System.Xml.XPath ;
using Umbraco.Core.Models ;
using Umbraco.Core.Xml ;
namespace Umbraco.Web
{
/// <summary>
/// Query methods used for accessing strongly typed content in templates
/// </summary>
public interface ITypedPublishedContentQuery
{
2017-05-19 11:42:58 +10:00
/// <summary>
/// Gets a content item from the cache
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
2015-02-18 17:14:55 +01:00
IPublishedContent TypedContent ( int id ) ;
2017-05-19 11:42:58 +10:00
/// <summary>
/// Gets a content item from the cache
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
2016-07-19 13:00:43 +02:00
IPublishedContent TypedContent ( Guid id ) ;
2017-05-19 11:42:58 +10:00
2015-02-18 17:14:55 +01:00
IPublishedContent TypedContentSingleAtXPath ( string xpath , params XPathVariable [ ] vars ) ;
IEnumerable < IPublishedContent > TypedContent ( IEnumerable < int > ids ) ;
2016-07-19 13:00:43 +02:00
IEnumerable < IPublishedContent > TypedContent ( IEnumerable < Guid > ids ) ;
2015-02-18 17:14:55 +01:00
IEnumerable < IPublishedContent > TypedContentAtXPath ( string xpath , params XPathVariable [ ] vars ) ;
IEnumerable < IPublishedContent > TypedContentAtXPath ( XPathExpression xpath , params XPathVariable [ ] vars ) ;
IEnumerable < IPublishedContent > TypedContentAtRoot ( ) ;
2017-05-19 11:42:58 +10:00
// TODO: we CANNOT implement TypedMedia by Guid in v7 without break-changing IPublishedCache, since we don't support XPath navigation of the media tree.
// surely there is a way we can support this without XPath, it's needed so we can query properly by UDI
2016-07-19 13:00:43 +02:00
2015-02-18 17:14:55 +01:00
IPublishedContent TypedMedia ( int id ) ;
2016-07-19 13:00:43 +02:00
//IPublishedContent TypedMedia(Guid id);
2015-02-18 17:14:55 +01:00
IEnumerable < IPublishedContent > TypedMedia ( IEnumerable < int > ids ) ;
2016-07-19 13:00:43 +02:00
//IEnumerable<IPublishedContent> TypedMedia(IEnumerable<Guid> ids);
2015-02-18 17:14:55 +01:00
IEnumerable < IPublishedContent > TypedMediaAtRoot ( ) ;
/// <summary>
/// Searches content
/// </summary>
/// <param name="term"></param>
/// <param name="useWildCards"></param>
/// <param name="searchProvider"></param>
/// <returns></returns>
IEnumerable < IPublishedContent > TypedSearch ( string term , bool useWildCards = true , string searchProvider = null ) ;
2017-12-15 17:24:54 +11:00
/// <summary>
/// Searches content
/// </summary>
/// <param name="skip"></param>
/// <param name="take"></param>
/// <param name="totalRecords"></param>
/// <param name="term"></param>
/// <param name="useWildCards"></param>
/// <param name="searchProvider"></param>
/// <returns></returns>
IEnumerable < IPublishedContent > TypedSearch ( int skip , int take , out int totalRecords , string term , bool useWildCards = true , string searchProvider = null ) ;
2015-02-18 17:14:55 +01:00
/// <summary>
/// Searhes content
/// </summary>
/// <param name="criteria"></param>
/// <param name="searchProvider"></param>
/// <returns></returns>
IEnumerable < IPublishedContent > TypedSearch ( Examine . SearchCriteria . ISearchCriteria criteria , Examine . Providers . BaseSearchProvider searchProvider = null ) ;
2017-12-15 17:24:54 +11:00
/// <summary>
/// Searhes content
/// </summary>
/// <param name="totalrecords"></param>
/// <param name="criteria"></param>
/// <param name="searchProvider"></param>
/// <param name="skip"></param>
/// <param name="take"></param>
/// <returns></returns>
IEnumerable < IPublishedContent > TypedSearch ( int skip , int take , out int totalrecords , Examine . SearchCriteria . ISearchCriteria criteria , Examine . Providers . BaseSearchProvider searchProvider = null ) ;
2015-02-18 17:14:55 +01:00
}
}