2013-02-05 06:31:13 -01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
2013-04-03 11:19:10 -02:00
|
|
|
|
using System.Xml.XPath;
|
2013-02-05 06:31:13 -01:00
|
|
|
|
using Umbraco.Core.CodeAnnotations;
|
|
|
|
|
|
using Umbraco.Core.Models;
|
|
|
|
|
|
using Umbraco.Core.Xml;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.PublishedCache
|
|
|
|
|
|
{
|
2013-03-19 17:51:55 -01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Provides access to cached contents.
|
2016-03-23 10:58:06 +01:00
|
|
|
|
/// </summary>
|
2013-01-24 08:51:27 -01:00
|
|
|
|
public interface IPublishedCache
|
2013-02-05 06:31:13 -01:00
|
|
|
|
{
|
2013-04-03 11:19:10 -02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets a content identified by its unique identifier.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="umbracoContext">The context.</param>
|
2013-03-31 18:47:25 -02:00
|
|
|
|
/// <param name="preview">A value indicating whether to consider unpublished content.</param>
|
2013-04-03 11:19:10 -02:00
|
|
|
|
/// <param name="contentId">The content unique identifier.</param>
|
|
|
|
|
|
/// <returns>The content, or null.</returns>
|
2013-03-31 18:47:25 -02:00
|
|
|
|
/// <remarks>The value of <paramref name="preview"/> overrides the context.</remarks>
|
|
|
|
|
|
IPublishedContent GetById(UmbracoContext umbracoContext, bool preview, int contentId);
|
2013-02-05 06:31:13 -01:00
|
|
|
|
|
2013-03-19 17:51:55 -01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets contents at root.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="umbracoContext">The context.</param>
|
2013-03-31 18:47:25 -02:00
|
|
|
|
/// <param name="preview">A value indicating whether to consider unpublished content.</param>
|
2013-03-19 17:51:55 -01:00
|
|
|
|
/// <returns>The contents.</returns>
|
2013-03-31 18:47:25 -02:00
|
|
|
|
/// <remarks>The value of <paramref name="preview"/> overrides the context.</remarks>
|
|
|
|
|
|
IEnumerable<IPublishedContent> GetAtRoot(UmbracoContext umbracoContext, bool preview);
|
2013-02-05 06:31:13 -01:00
|
|
|
|
|
2013-03-19 17:51:55 -01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets a content resulting from an XPath query.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="umbracoContext">The context.</param>
|
2013-03-31 18:47:25 -02:00
|
|
|
|
/// <param name="preview">A value indicating whether to consider unpublished content.</param>
|
2013-03-19 17:51:55 -01:00
|
|
|
|
/// <param name="xpath">The XPath query.</param>
|
|
|
|
|
|
/// <param name="vars">Optional XPath variables.</param>
|
|
|
|
|
|
/// <returns>The content, or null.</returns>
|
2013-03-31 18:47:25 -02:00
|
|
|
|
/// <remarks>The value of <paramref name="preview"/> overrides the context.</remarks>
|
|
|
|
|
|
IPublishedContent GetSingleByXPath(UmbracoContext umbracoContext, bool preview, string xpath, XPathVariable[] vars);
|
2013-03-19 17:51:55 -01:00
|
|
|
|
|
2013-04-10 12:49:45 -02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets a content resulting from an XPath query.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="umbracoContext">The context.</param>
|
|
|
|
|
|
/// <param name="preview">A value indicating whether to consider unpublished content.</param>
|
|
|
|
|
|
/// <param name="xpath">The XPath query.</param>
|
|
|
|
|
|
/// <param name="vars">Optional XPath variables.</param>
|
|
|
|
|
|
/// <returns>The content, or null.</returns>
|
|
|
|
|
|
/// <remarks>The value of <paramref name="preview"/> overrides the context.</remarks>
|
|
|
|
|
|
IPublishedContent GetSingleByXPath(UmbracoContext umbracoContext, bool preview, XPathExpression xpath, XPathVariable[] vars);
|
|
|
|
|
|
|
2013-03-19 17:51:55 -01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets contents resulting from an XPath query.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="umbracoContext">The context.</param>
|
2013-03-31 18:47:25 -02:00
|
|
|
|
/// <param name="preview">A value indicating whether to consider unpublished content.</param>
|
2013-03-19 17:51:55 -01:00
|
|
|
|
/// <param name="xpath">The XPath query.</param>
|
|
|
|
|
|
/// <param name="vars">Optional XPath variables.</param>
|
|
|
|
|
|
/// <returns>The contents.</returns>
|
2013-03-31 18:47:25 -02:00
|
|
|
|
/// <remarks>The value of <paramref name="preview"/> overrides the context.</remarks>
|
|
|
|
|
|
IEnumerable<IPublishedContent> GetByXPath(UmbracoContext umbracoContext, bool preview, string xpath, XPathVariable[] vars);
|
2013-03-19 17:51:55 -01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets contents resulting from an XPath query.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="umbracoContext">The context.</param>
|
2013-04-10 12:49:45 -02:00
|
|
|
|
/// <param name="preview">A value indicating whether to consider unpublished content.</param>
|
2013-03-19 17:51:55 -01:00
|
|
|
|
/// <param name="xpath">The XPath query.</param>
|
|
|
|
|
|
/// <param name="vars">Optional XPath variables.</param>
|
|
|
|
|
|
/// <returns>The contents.</returns>
|
2013-04-10 12:49:45 -02:00
|
|
|
|
/// <remarks>The value of <paramref name="preview"/> overrides the context.</remarks>
|
|
|
|
|
|
IEnumerable<IPublishedContent> GetByXPath(UmbracoContext umbracoContext, bool preview, XPathExpression xpath, XPathVariable[] vars);
|
2013-02-05 06:31:13 -01:00
|
|
|
|
|
2013-04-03 11:19:10 -02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets an XPath navigator that can be used to navigate contents.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="umbracoContext">The context.</param>
|
2013-03-31 18:47:25 -02:00
|
|
|
|
/// <param name="preview">A value indicating whether to consider unpublished content.</param>
|
2013-04-03 11:19:10 -02:00
|
|
|
|
/// <returns>The XPath navigator.</returns>
|
2013-03-31 18:47:25 -02:00
|
|
|
|
/// <remarks>The value of <paramref name="preview"/> overrides the context.</remarks>
|
|
|
|
|
|
XPathNavigator GetXPathNavigator(UmbracoContext umbracoContext, bool preview);
|
2013-04-03 11:19:10 -02:00
|
|
|
|
|
2013-06-11 09:52:41 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets a value indicating whether <c>GetXPathNavigator</c> returns an <c>XPathNavigator</c>
|
|
|
|
|
|
/// and that navigator is a <c>NavigableNavigator</c>.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
bool XPathNavigatorIsNavigable { get; }
|
|
|
|
|
|
|
2013-03-20 16:01:49 -01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets a value indicating whether the cache contains published content.
|
|
|
|
|
|
/// </summary>
|
2013-03-31 18:47:25 -02:00
|
|
|
|
/// <param name="umbracoContext">The context.</param>
|
|
|
|
|
|
/// <param name="preview">A value indicating whether to consider unpublished content.</param>
|
2013-03-20 16:01:49 -01:00
|
|
|
|
/// <returns>A value indicating whether the cache contains published content.</returns>
|
2013-03-31 18:47:25 -02:00
|
|
|
|
/// <remarks>The value of <paramref name="preview"/> overrides the context.</remarks>
|
|
|
|
|
|
bool HasContent(UmbracoContext umbracoContext, bool preview);
|
|
|
|
|
|
|
|
|
|
|
|
//TODO: SD: We should make this happen! This will allow us to natively do a GetByDocumentType query
|
2013-02-05 06:31:13 -01:00
|
|
|
|
// on the UmbracoHelper (or an internal DataContext that it uses, etc...)
|
|
|
|
|
|
// One issue is that we need to make media work as fast as we can and need to create a ConvertFromMediaObject
|
|
|
|
|
|
// method in the DefaultPublishedMediaStore, there's already a TODO noting this but in order to do that we'll
|
|
|
|
|
|
// have to also use Examine as much as we can so we don't have to make db calls for looking up things like the
|
|
|
|
|
|
// node type alias, etc... in order to populate the created IPublishedContent object.
|
|
|
|
|
|
//IEnumerable<IPublishedContent> GetDocumentsByType(string docTypeAlias);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|