Files
Umbraco-CMS/src/Umbraco.Web/IPublishedContentQuery.cs

79 lines
3.5 KiB
C#
Raw Normal View History

2017-07-20 11:21:28 +02:00
using System;
2016-06-30 18:35:43 +02:00
using System.Collections.Generic;
using System.Xml.XPath;
using Examine.Search;
2017-09-08 19:39:13 +02:00
using Umbraco.Core;
2016-06-30 18:35:43 +02:00
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Xml;
namespace Umbraco.Web
{
using Examine = global::Examine;
2016-06-30 18:35:43 +02:00
/// <summary>
/// Query methods used for accessing strongly typed content in templates
/// </summary>
public interface IPublishedContentQuery
{
IPublishedContent Content(int id);
IPublishedContent Content(Guid id);
2017-09-08 19:39:13 +02:00
IPublishedContent Content(Udi id);
2016-06-30 18:35:43 +02:00
IPublishedContent ContentSingleAtXPath(string xpath, params XPathVariable[] vars);
IEnumerable<IPublishedContent> Content(IEnumerable<int> ids);
IEnumerable<IPublishedContent> Content(IEnumerable<Guid> ids);
2016-06-30 18:35:43 +02:00
IEnumerable<IPublishedContent> ContentAtXPath(string xpath, params XPathVariable[] vars);
IEnumerable<IPublishedContent> ContentAtXPath(XPathExpression xpath, params XPathVariable[] vars);
IEnumerable<IPublishedContent> ContentAtRoot();
IPublishedContent Media(int id);
IPublishedContent Media(Guid id);
2017-09-08 19:39:13 +02:00
IPublishedContent Media(Udi id);
2016-06-30 18:35:43 +02:00
IEnumerable<IPublishedContent> Media(IEnumerable<int> ids);
IEnumerable<IPublishedContent> Media(IEnumerable<Guid> ids);
2016-06-30 18:35:43 +02:00
IEnumerable<IPublishedContent> MediaAtRoot();
/// <summary>
2018-03-27 10:04:07 +02:00
/// Searches content.
2016-06-30 18:35:43 +02:00
/// </summary>
2018-12-20 13:29:57 +01:00
/// <param name="term">Term to search.</param>
/// <param name="culture">Optional culture.</param>
/// <param name="indexName">Optional index name.</param>
/// <remarks>
/// <para>When the <paramref name="culture"/> is not specified, all cultures are searched.</para>
2019-01-11 08:26:53 +01:00
/// <para>While enumerating results, the ambient culture is changed to be the searched culture.</para>
2018-12-20 13:29:57 +01:00
/// </remarks>
IEnumerable<PublishedSearchResult> Search(string term, string culture = null, string indexName = null);
2016-06-30 18:35:43 +02:00
/// <summary>
2018-03-27 10:04:07 +02:00
/// Searches content.
/// </summary>
2018-12-20 13:29:57 +01:00
/// <param name="term">Term to search.</param>
/// <param name="skip">Numbers of items to skip.</param>
/// <param name="take">Numbers of items to return.</param>
/// <param name="totalRecords">Total number of matching items.</param>
/// <param name="culture">Optional culture.</param>
/// <param name="indexName">Optional index name.</param>
/// <remarks>
/// <para>When the <paramref name="culture"/> is not specified, all cultures are searched.</para>
2019-01-11 08:26:53 +01:00
/// <para>While enumerating results, the ambient culture is changed to be the searched culture.</para>
2018-12-20 13:29:57 +01:00
/// </remarks>
IEnumerable<PublishedSearchResult> Search(string term, int skip, int take, out long totalRecords, string culture = null, string indexName = null);
2018-03-27 10:04:07 +02:00
/// <summary>
/// Executes the query and converts the results to PublishedSearchResult.
2016-06-30 18:35:43 +02:00
/// </summary>
2019-01-11 08:26:53 +01:00
/// <remarks>
/// <para>While enumerating results, the ambient culture is changed to be the searched culture.</para>
/// </remarks>
IEnumerable<PublishedSearchResult> Search(IQueryExecutor query);
2018-03-27 10:04:07 +02:00
/// <summary>
/// Executes the query and converts the results to PublishedSearchResult.
2018-03-27 10:04:07 +02:00
/// </summary>
2019-01-11 08:26:53 +01:00
/// <remarks>
/// <para>While enumerating results, the ambient culture is changed to be the searched culture.</para>
/// </remarks>
IEnumerable<PublishedSearchResult> Search(IQueryExecutor query, int skip, int take, out long totalRecords);
2016-06-30 18:35:43 +02:00
}
2017-07-20 11:21:28 +02:00
}