using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.XPath;
using Umbraco.Core.CodeAnnotations;
using Umbraco.Core.Models;
using Umbraco.Core.Xml;
namespace Umbraco.Web.PublishedCache
{
///
/// Provides access to cached contents.
///
[UmbracoExperimentalFeature("http://issues.umbraco.org/issue/U4-1153",
"We need to create something like the IPublishListener interface to have proper published content storage.")]
public interface IPublishedCache
{
///
/// Gets a content identified by its unique identifier.
///
/// The context.
/// The content unique identifier.
/// The content, or null.
IPublishedContent GetById(UmbracoContext umbracoContext, int contentId);
///
/// Gets contents at root.
///
/// The context.
/// The contents.
IEnumerable GetAtRoot(UmbracoContext umbracoContext);
///
/// Gets a content resulting from an XPath query.
///
/// The context.
/// The XPath query.
/// Optional XPath variables.
/// The content, or null.
IPublishedContent GetSingleByXPath(UmbracoContext umbracoContext, string xpath, XPathVariable[] vars);
///
/// Gets contents resulting from an XPath query.
///
/// The context.
/// The XPath query.
/// Optional XPath variables.
/// The contents.
IEnumerable GetByXPath(UmbracoContext umbracoContext, string xpath, XPathVariable[] vars);
///
/// Gets an XPath navigator that can be used to navigate contents.
///
/// The context.
/// The XPath navigator.
XPathNavigator GetXPathNavigator(UmbracoContext umbracoContext);
///
/// Gets a value indicating whether the cache contains published content.
///
/// A value indicating whether the cache contains published content.
bool HasContent();
//TODO: SD: We should make this happen! This will allow us to natively do a GetByDocumentType query
// 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 GetDocumentsByType(string docTypeAlias);
}
}