Interface IPublishedSnapshotService
Creates and manages IPublishedSnapshot instances.
Namespace: Umbraco.Web.PublishedCache
Assembly: Umbraco.Web.dll
Syntax
public interface IPublishedSnapshotService : IDisposable
Properties
View SourcePublishedSnapshotAccessor
Gets the published snapshot accessor.
Declaration
IPublishedSnapshotAccessor PublishedSnapshotAccessor { get; }
Property Value
Type | Description |
---|---|
IPublishedSnapshotAccessor |
Methods
View SourceCreatePublishedSnapshot(String)
Creates a published snapshot.
Declaration
IPublishedSnapshot CreatePublishedSnapshot(string previewToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | previewToken | A preview token, or |
Returns
Type | Description |
---|---|
IPublishedSnapshot | A published snapshot. |
Remarks
If previewToken
is null, the snapshot is not previewing, else it
is previewing, and what is or is not visible in preview depends on the content of the token,
which is not specified and depends on the actual published snapshot service implementation.
EnsureEnvironment(out IEnumerable<String>)
Ensures that the published snapshot has the proper environment to run.
Declaration
bool EnsureEnvironment(out IEnumerable<string> errors)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | errors | The errors, if any. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the published snapshot has the proper environment to run. |
EnterPreview(IUser, Int32)
Enters preview for specified user and content.
Declaration
string EnterPreview(IUser user, int contentId)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The user. |
System.Int32 | contentId | The content identifier. |
Returns
Type | Description |
---|---|
System.String | A preview token. |
Remarks
Tells the caches that they should prepare any data that they would be keeping in order to provide preview to a give user. In the Xml cache this means creating the Xml file, though other caches may do things differently.
Does not handle the preview token storage (cookie, etc) that must be handled separately.
ExitPreview(String)
Exits preview for a specified preview token.
Declaration
void ExitPreview(string previewToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | previewToken | The preview token. |
Remarks
Tells the caches that they can dispose of any data that they would be keeping in order to provide preview to a given user. In the Xml cache this means deleting the Xml file, though other caches may do things differently.
Does not handle the preview token storage (cookie, etc) that must be handled separately.
Notify(ContentCacheRefresher.JsonPayload[], out Boolean, out Boolean)
Notifies of content cache refresher changes.
Declaration
void Notify(ContentCacheRefresher.JsonPayload[] payloads, out bool draftChanged, out bool publishedChanged)
Parameters
Type | Name | Description |
---|---|---|
ContentCacheRefresher.JsonPayload[] | payloads | The changes. |
System.Boolean | draftChanged | A value indicating whether draft contents have been changed in the cache. |
System.Boolean | publishedChanged | A value indicating whether published contents have been changed in the cache. |
Notify(ContentTypeCacheRefresher.JsonPayload[])
Notifies of content type refresher changes.
Declaration
void Notify(ContentTypeCacheRefresher.JsonPayload[] payloads)
Parameters
Type | Name | Description |
---|---|---|
ContentTypeCacheRefresher.JsonPayload[] | payloads | The changes. |
Notify(DataTypeCacheRefresher.JsonPayload[])
Notifies of data type refresher changes.
Declaration
void Notify(DataTypeCacheRefresher.JsonPayload[] payloads)
Parameters
Type | Name | Description |
---|---|---|
DataTypeCacheRefresher.JsonPayload[] | payloads | The changes. |
Notify(DomainCacheRefresher.JsonPayload[])
Notifies of domain refresher changes.
Declaration
void Notify(DomainCacheRefresher.JsonPayload[] payloads)
Parameters
Type | Name | Description |
---|---|---|
DomainCacheRefresher.JsonPayload[] | payloads | The changes. |
Notify(MediaCacheRefresher.JsonPayload[], out Boolean)
Notifies of media cache refresher changes.
Declaration
void Notify(MediaCacheRefresher.JsonPayload[] payloads, out bool anythingChanged)
Parameters
Type | Name | Description |
---|---|---|
MediaCacheRefresher.JsonPayload[] | payloads | The changes. |
System.Boolean | anythingChanged | A value indicating whether medias have been changed in the cache. |
Rebuild()
Rebuilds internal caches (but does not reload).
Declaration
void Rebuild()
Remarks
Forces the snapshot service to rebuild its internal caches. For instance, some caches may rely on a database table to store pre-serialized version of documents.
This does not reload the caches. Caches need to be reloaded, for instance via DistributedCache RefreshAllPublishedSnapshot method.
RefreshPreview(String, Int32)
Refreshes preview for a specified content.
Declaration
void RefreshPreview(string previewToken, int contentId)
Parameters
Type | Name | Description |
---|---|---|
System.String | previewToken | The preview token. |
System.Int32 | contentId | The content identifier. |
Remarks
Tells the caches that they should update any data that they would be keeping in order to provide preview to a given user. In the Xml cache this means updating the Xml file, though other caches may do things differently.