Interface IPublishedCache
Provides access to cached contents.
Namespace: Umbraco.Cms.Core.PublishedCache
Assembly: Umbraco.Core.dll
Syntax
public interface IPublishedCache : IXPathNavigable
Methods
View SourceCreateNavigator(Boolean)
Creates an XPath navigator that can be used to navigate contents.
Declaration
XPathNavigator CreateNavigator(bool preview)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
Returns
Type | Description |
---|---|
System.Xml.XPath.XPathNavigator | The XPath navigator. |
Remarks
The value of preview
overrides the context.
The navigator is already a safe clone (no need to clone it again).
CreateNodeNavigator(Int32, Boolean)
Creates an XPath navigator that can be used to navigate one node.
Declaration
XPathNavigator CreateNodeNavigator(int id, bool preview)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The node identifier. |
System.Boolean | preview | A value indicating whether to consider unpublished content. |
Returns
Type | Description |
---|---|
System.Xml.XPath.XPathNavigator | The XPath navigator, or null. |
Remarks
The value of preview
overrides the context.
The navigator is already a safe clone (no need to clone it again).
Navigates over the node - and only the node, ie no children. Exists only for backward compatibility + transition reasons, we should obsolete that one as soon as possible.
If the node does not exist, returns null.
GetAtRoot(Boolean, String)
Gets contents at root.
Declaration
IEnumerable<IPublishedContent> GetAtRoot(bool preview, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.String | culture | A culture. |
Returns
Type | Description |
---|---|
IEnumerable<IPublishedContent> | The contents. |
Remarks
The value of preview
overrides defaults.
GetAtRoot(String)
Gets contents at root.
Declaration
IEnumerable<IPublishedContent> GetAtRoot(string culture = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | culture | A culture. |
Returns
Type | Description |
---|---|
IEnumerable<IPublishedContent> | The contents. |
Remarks
Considers published or unpublished content depending on defaults.
GetByContentType(IPublishedContentType)
Gets contents of a given content type.
Declaration
IEnumerable<IPublishedContent> GetByContentType(IPublishedContentType contentType)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContentType | contentType | The content type. |
Returns
Type | Description |
---|---|
IEnumerable<IPublishedContent> | The contents. |
GetById(Guid)
Gets a content identified by its unique identifier.
Declaration
IPublishedContent GetById(Guid contentId)
Parameters
Type | Name | Description |
---|---|---|
Guid | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
Considers published or unpublished content depending on defaults.
GetById(Boolean, Guid)
Gets a content identified by its unique identifier.
Declaration
IPublishedContent GetById(bool preview, Guid contentId)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
Guid | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
The value of preview
overrides defaults.
GetById(Boolean, Int32)
Gets a content identified by its unique identifier.
Declaration
IPublishedContent GetById(bool preview, int contentId)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.Int32 | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
The value of preview
overrides defaults.
GetById(Boolean, Udi)
Gets a content identified by its Udi identifier.
Declaration
IPublishedContent GetById(bool preview, Udi contentId)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
Udi | contentId | The content Udi identifier. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
The value of preview
overrides defaults.
GetById(Int32)
Gets a content identified by its unique identifier.
Declaration
IPublishedContent GetById(int contentId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
Considers published or unpublished content depending on defaults.
GetById(Udi)
Gets a content identified by its unique identifier.
Declaration
IPublishedContent GetById(Udi contentId)
Parameters
Type | Name | Description |
---|---|---|
Udi | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
Considers published or unpublished content depending on defaults.
GetByXPath(Boolean, String, XPathVariable[])
Gets contents resulting from an XPath query.
Declaration
IEnumerable<IPublishedContent> GetByXPath(bool preview, string xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.String | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
IEnumerable<IPublishedContent> | The contents. |
Remarks
The value of preview
overrides defaults.
GetByXPath(Boolean, XPathExpression, XPathVariable[])
Gets contents resulting from an XPath query.
Declaration
IEnumerable<IPublishedContent> GetByXPath(bool preview, XPathExpression xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.Xml.XPath.XPathExpression | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
IEnumerable<IPublishedContent> | The contents. |
Remarks
The value of preview
overrides defaults.
GetByXPath(String, XPathVariable[])
Gets contents resulting from an XPath query.
Declaration
IEnumerable<IPublishedContent> GetByXPath(string xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.String | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
IEnumerable<IPublishedContent> | The contents. |
Remarks
Considers published or unpublished content depending on defaults.
GetByXPath(XPathExpression, XPathVariable[])
Gets contents resulting from an XPath query.
Declaration
IEnumerable<IPublishedContent> GetByXPath(XPathExpression xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XPath.XPathExpression | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
IEnumerable<IPublishedContent> | The contents. |
Remarks
Considers published or unpublished content depending on defaults.
GetContentType(Guid)
Gets a content type identified by its alias.
Declaration
IPublishedContentType GetContentType(Guid key)
Parameters
Type | Name | Description |
---|---|---|
Guid | key | The content type key. |
Returns
Type | Description |
---|---|
IPublishedContentType | The content type, or null. |
GetContentType(Int32)
Gets a content type identified by its unique identifier.
Declaration
IPublishedContentType GetContentType(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The content type unique identifier. |
Returns
Type | Description |
---|---|
IPublishedContentType | The content type, or null. |
GetContentType(String)
Gets a content type identified by its alias.
Declaration
IPublishedContentType GetContentType(string alias)
Parameters
Type | Name | Description |
---|---|---|
System.String | alias | The content type alias. |
Returns
Type | Description |
---|---|
IPublishedContentType | The content type, or null. |
Remarks
The alias is case-insensitive.
GetSingleByXPath(Boolean, String, XPathVariable[])
Gets a content resulting from an XPath query.
Declaration
IPublishedContent GetSingleByXPath(bool preview, string xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.String | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
The value of preview
overrides defaults.
GetSingleByXPath(Boolean, XPathExpression, XPathVariable[])
Gets a content resulting from an XPath query.
Declaration
IPublishedContent GetSingleByXPath(bool preview, XPathExpression xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.Xml.XPath.XPathExpression | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
The value of preview
overrides defaults.
GetSingleByXPath(String, XPathVariable[])
Gets a content resulting from an XPath query.
Declaration
IPublishedContent GetSingleByXPath(string xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.String | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
Considers published or unpublished content depending on defaults.
GetSingleByXPath(XPathExpression, XPathVariable[])
Gets a content resulting from an XPath query.
Declaration
IPublishedContent GetSingleByXPath(XPathExpression xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XPath.XPathExpression | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
Considers published or unpublished content depending on defaults.
HasById(Boolean, Int32)
Gets a value indicating whether the cache contains a specified content.
Declaration
bool HasById(bool preview, int contentId)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.Int32 | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether to the cache contains the specified content. |
Remarks
The value of preview
overrides defaults.
HasById(Int32)
Gets a value indicating whether the cache contains a specified content.
Declaration
bool HasById(int contentId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether to the cache contains the specified content. |
Remarks
Considers published or unpublished content depending on defaults.
HasContent()
Gets a value indicating whether the cache contains published content.
Declaration
bool HasContent()
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the cache contains published content. |
Remarks
Considers published or unpublished content depending on defaults.
HasContent(Boolean)
Gets a value indicating whether the cache contains published content.
Declaration
bool HasContent(bool preview)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the cache contains published content. |
Remarks
The value of preview
overrides defaults.