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.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[UmbracoExperimentalFeature("http://issues.umbraco.org/issue/U4-1153",
|
2013-02-05 06:31:13 -01:00
|
|
|
|
"We need to create something like the IPublishListener interface to have proper published content storage.")]
|
|
|
|
|
|
internal interface IPublishedCache
|
|
|
|
|
|
{
|
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
|
|
|
|
|
|
|
|
|
|
/// <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-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-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);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|