Try our conversational search powered by Generative AI!

Class SubscriptionJob

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Job that handles subscriptions, scheduled automatically by EPiServer Scheduler and should not be called in code.

Inheritance
System.Object
SubscriptionJob
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Personalization
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
[ScheduledPlugIn(GUID = "E2D25A3B-09F2-4209-9760-77CCBB5097E0", DisplayName = "Subscription", LanguagePath = "/admin/databasejob/subscription", HelpFile = "subscriptionjob")]
[Obsolete("The subscription feature was obsoleted in CMS 7.5 and is being phased out")]
public class SubscriptionJob

Constructors

SubscriptionJob()

Initializes a new instance of the SubscriptionJob class.

Declaration
public SubscriptionJob()

SubscriptionJob(IContentRepository, LocalizationService, SubscriptionDB, ISiteDefinitionResolver, ILanguageBranchRepository)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes a new instance of the SubscriptionJob class.

Declaration
public SubscriptionJob(IContentRepository contentRepository, LocalizationService localizationService, SubscriptionDB subscriptionDataAccess, ISiteDefinitionResolver siteDefinitionResolver, ILanguageBranchRepository languageBranchRepository)
Parameters
Type Name Description
IContentRepository contentRepository
LocalizationService localizationService
SubscriptionDB subscriptionDataAccess
ISiteDefinitionResolver siteDefinitionResolver
ILanguageBranchRepository languageBranchRepository

SubscriptionJob(IContentRepository, LocalizationService, SubscriptionDB, SiteDefinitionResolver)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes a new instance of the SubscriptionJob class.

Declaration
[Obsolete("Use alternative constructor")]
public SubscriptionJob(IContentRepository contentRepository, LocalizationService localizationService, SubscriptionDB subscriptionDataAccess, SiteDefinitionResolver siteDefinitionResolver)
Parameters
Type Name Description
IContentRepository contentRepository
LocalizationService localizationService
SubscriptionDB subscriptionDataAccess
SiteDefinitionResolver siteDefinitionResolver

Methods

CanSendSubscription(EPiServerProfile, PageData, PageDataCollection)

Controls if a user can be notified about page changes. Called for each subscription being processed.

Declaration
protected virtual bool CanSendSubscription(EPiServerProfile profile, PageData rootPage, PageDataCollection changedPages)
Parameters
Type Name Description
EPiServerProfile profile

User's profile

PageData rootPage

The root page for the suscription

PageDataCollection changedPages

The pages that has changed

Returns
Type Description
System.Boolean

True if the subscription notification can be sent. Returning false cancels the notification for this user.

Execute()

Service entrypoint

Declaration
public static string Execute()
Returns
Type Description
System.String

GetChangedPages(EPiServerProfile, String, SubscriptionDescriptor, IPrincipal)

Gets the changed pages under one subscription root for a specific user.

Declaration
protected PageDataCollection GetChangedPages(EPiServerProfile profile, string language, SubscriptionDescriptor subscribedPage, IPrincipal principal)
Parameters
Type Name Description
EPiServerProfile profile

The profile for a user.

System.String language

The requested language.

SubscriptionDescriptor subscribedPage

The subscribed subscription root.

System.Security.Principal.IPrincipal principal

The principal for the user.

Returns
Type Description
PageDataCollection

A collection of pages that have been changed and are children of the subscribedPage.

GetPage(Int32, IList<String>, String, IPrincipal)

Gets the page. Will be filtered on access rights, start publish and if the page is explicitly excluded.

Declaration
[Obsolete("You must explicitly say if pages should be filtered or not to avoid bugs")]
protected PageData GetPage(int pageID, IList<string> pageLanguages, string language, IPrincipal principal)
Parameters
Type Name Description
System.Int32 pageID

The ID of the page.

System.Collections.Generic.IList<System.String> pageLanguages

The page languages. [Obsolete parameter]

System.String language

The language you want the page in.

System.Security.Principal.IPrincipal principal

The principal for the user. Used to check access rights on the page.

Returns
Type Description
PageData

A PageData if one matching the criterias exists, otherwise null.

GetPage(Int32, String, IPrincipal, Boolean)

Gets the page. Will be filtered on access rights, start publish and if the page is explicitly excluded.

Declaration
protected PageData GetPage(int pageID, string language, IPrincipal principal, bool filterSubscribeExclude)
Parameters
Type Name Description
System.Int32 pageID

The ID of the page.

System.String language

The language you want the page in.

System.Security.Principal.IPrincipal principal

The principal for the user. Used to check access rights on the page.

System.Boolean filterSubscribeExclude

Filter based on EPSUBSCRIBE-EXCLUDE

Returns
Type Description
PageData

A PageData if one matching the criterias exists, otherwise null.

InternalExecute()

Execute subscription job

Declaration
protected virtual string InternalExecute()
Returns
Type Description
System.String

IsPageExcluded(PageData)

Determines whether the specified page should be excluded from the subscription.

Declaration
protected bool IsPageExcluded(PageData page)
Parameters
Type Name Description
PageData page

The page that may be excluded.

Returns
Type Description
System.Boolean

true if the page should be excluded; otherwise, false.

SendSubscriptions(EPiServerProfile)

Process subscriptions and send notification about changes to subscribers.

Declaration
protected virtual int SendSubscriptions(EPiServerProfile profile)
Parameters
Type Name Description
EPiServerProfile profile

The profile for the subscriber

Returns
Type Description
System.Int32

Actual number of subscription notification messages sent.

SendToHandler(EPiServerProfile, PageData, PageDataCollection)

Send subscription data to handler

Declaration
protected virtual void SendToHandler(EPiServerProfile profile, PageData rootPage, PageDataCollection changedPages)
Parameters
Type Name Description
EPiServerProfile profile

The profile for a subscriber

PageData rootPage

Root for subscription

PageDataCollection changedPages

The pages that has changed

Extension Methods