Search Results for

    Show / Hide Table of Contents
    View Source

    Class ElementService

    Inheritance
    object
    RepositoryService
    PublishableContentServiceBase<IElement>
    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public class ElementService : PublishableContentServiceBase<IElement>, IElementService, IPublishableContentService<IElement>, IContentServiceBase<IElement>, IContentServiceBase, IService

    Constructors

    View Source

    ElementService(ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory, IAuditService, IContentTypeRepository, IElementRepository, ILanguageRepository, Lazy<IPropertyValidationService>, ICultureImpactFactory, IUserIdKeyResolver, PropertyEditorCollection, IIdKeyMap, IShortStringHelper)

    Declaration
    public ElementService(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, IAuditService auditService, IContentTypeRepository contentTypeRepository, IElementRepository elementRepository, ILanguageRepository languageRepository, Lazy<IPropertyValidationService> propertyValidationService, ICultureImpactFactory cultureImpactFactory, IUserIdKeyResolver userIdKeyResolver, PropertyEditorCollection propertyEditorCollection, IIdKeyMap idKeyMap, IShortStringHelper shortStringHelper)
    Parameters
    Type Name Description
    ICoreScopeProvider provider
    ILoggerFactory loggerFactory
    IEventMessagesFactory eventMessagesFactory
    IAuditService auditService
    IContentTypeRepository contentTypeRepository
    IElementRepository elementRepository
    ILanguageRepository languageRepository
    Lazy<IPropertyValidationService> propertyValidationService
    ICultureImpactFactory cultureImpactFactory
    IUserIdKeyResolver userIdKeyResolver
    PropertyEditorCollection propertyEditorCollection
    IIdKeyMap idKeyMap
    IShortStringHelper shortStringHelper

    Properties

    View Source

    ContentObjectType

    Declaration
    protected override UmbracoObjectTypes ContentObjectType { get; }
    Property Value
    Type Description
    UmbracoObjectTypes
    View Source

    Logger

    Declaration
    protected override ILogger<ElementService> Logger { get; }
    Property Value
    Type Description
    ILogger<ElementService>
    View Source

    ReadLockIds

    Declaration
    protected override int[] ReadLockIds { get; }
    Property Value
    Type Description
    int[]
    View Source

    SupportsBranchPublishing

    Declaration
    protected override bool SupportsBranchPublishing { get; }
    Property Value
    Type Description
    bool
    View Source

    WriteLockIds

    Declaration
    protected override int[] WriteLockIds { get; }
    Property Value
    Type Description
    int[]

    Methods

    View Source

    CheckDataIntegrity(ContentDataIntegrityReportOptions)

    Checks the data integrity of the content tree and optionally fixes issues.

    Declaration
    public override ContentDataIntegrityReport CheckDataIntegrity(ContentDataIntegrityReportOptions options)
    Parameters
    Type Name Description
    ContentDataIntegrityReportOptions options

    The options for the data integrity check.

    Returns
    Type Description
    ContentDataIntegrityReport

    A ContentDataIntegrityReport containing the results of the integrity check.

    View Source

    DeleteLocked(ICoreScope, IElement, EventMessages)

    Declaration
    protected override void DeleteLocked(ICoreScope scope, IElement content, EventMessages evtMsgs)
    Parameters
    Type Name Description
    ICoreScope scope
    IElement content
    EventMessages evtMsgs
    View Source

    DeleteOfTypes(IEnumerable<int>, int)

    Deletes all content of given types.

    Declaration
    public override void DeleteOfTypes(IEnumerable<int> contentTypeIds, int userId = -1)
    Parameters
    Type Name Description
    IEnumerable<int> contentTypeIds

    The content type identifiers.

    int userId

    The identifier of the user performing the action.

    Remarks

    All non-deleted descendants of the deleted content is moved to the recycle bin.

    This operation is potentially dangerous and expensive.

    View Source

    DeletingNotification(IElement, EventMessages)

    Declaration
    protected override DeletingNotification<IElement> DeletingNotification(IElement content, EventMessages eventMessages)
    Parameters
    Type Name Description
    IElement content
    EventMessages eventMessages
    Returns
    Type Description
    DeletingNotification<IElement>
    View Source

    PublishedNotification(IEnumerable<IElement>, EventMessages)

    Declaration
    protected override IStatefulNotification PublishedNotification(IEnumerable<IElement> content, EventMessages eventMessages)
    Parameters
    Type Name Description
    IEnumerable<IElement> content
    EventMessages eventMessages
    Returns
    Type Description
    IStatefulNotification
    View Source

    PublishedNotification(IElement, EventMessages)

    Declaration
    protected override IStatefulNotification PublishedNotification(IElement content, EventMessages eventMessages)
    Parameters
    Type Name Description
    IElement content
    EventMessages eventMessages
    Returns
    Type Description
    IStatefulNotification
    View Source

    PublishedNotification(IElement, EventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>?, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>?)

    Creates the "published" notification for a single item, carrying the cultures that were published and unpublished by the operation.

    Declaration
    protected override IStatefulNotification PublishedNotification(IElement content, EventMessages eventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? publishedCultures, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? unpublishedCultures)
    Parameters
    Type Name Description
    IElement content

    The item that was published.

    EventMessages eventMessages

    The event messages collection.

    IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> publishedCultures

    The cultures that were published, keyed by item key, or null if not tracked.

    IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> unpublishedCultures

    The cultures that were unpublished as part of the publish, keyed by item key, or null if not applicable.

    Returns
    Type Description
    IStatefulNotification

    The notification to publish.

    Remarks

    Defaults to the culture-agnostic PublishedNotification(TContent, EventMessages) overload so external subclasses keep working; ContentService and ElementService override this to carry the maps on the concrete notification. Unpublishing an individual culture is performed as a publish, so the unpublished cultures are reported here rather than on the "unpublished" notification.

    View Source

    PublishingNotification(IElement, EventMessages)

    Declaration
    protected override CancelableEnumerableObjectNotification<IElement> PublishingNotification(IElement content, EventMessages eventMessages)
    Parameters
    Type Name Description
    IElement content
    EventMessages eventMessages
    Returns
    Type Description
    CancelableEnumerableObjectNotification<IElement>
    View Source

    RolledBackNotification(IElement, EventMessages)

    Declaration
    protected override RolledBackNotification<IElement> RolledBackNotification(IElement target, EventMessages messages)
    Parameters
    Type Name Description
    IElement target
    EventMessages messages
    Returns
    Type Description
    RolledBackNotification<IElement>
    View Source

    RollingBackNotification(IElement, EventMessages)

    Declaration
    protected override RollingBackNotification<IElement> RollingBackNotification(IElement target, EventMessages messages)
    Parameters
    Type Name Description
    IElement target
    EventMessages messages
    Returns
    Type Description
    RollingBackNotification<IElement>
    View Source

    SavedNotification(IEnumerable<IElement>, EventMessages)

    Declaration
    protected override SavedNotification<IElement> SavedNotification(IEnumerable<IElement> content, EventMessages eventMessages)
    Parameters
    Type Name Description
    IEnumerable<IElement> content
    EventMessages eventMessages
    Returns
    Type Description
    SavedNotification<IElement>
    View Source

    SavedNotification(IEnumerable<IElement>, EventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>?)

    Creates the "saved" notification for multiple items, carrying the cultures that were saved per item.

    Declaration
    protected override SavedNotification<IElement> SavedNotification(IEnumerable<IElement> content, EventMessages eventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? savedCultures)
    Parameters
    Type Name Description
    IEnumerable<IElement> content

    The items that were saved.

    EventMessages eventMessages

    The event messages collection.

    IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> savedCultures

    The cultures that were saved, keyed by item key.

    Returns
    Type Description
    SavedNotification<IElement>

    The notification to publish.

    Remarks

    Defaults to the culture-agnostic SavedNotification(IEnumerable<TContent>, EventMessages) overload so external subclasses keep working; ContentService and ElementService override this to carry the map on the concrete notification.

    View Source

    SavedNotification(IElement, EventMessages)

    Declaration
    protected override SavedNotification<IElement> SavedNotification(IElement content, EventMessages eventMessages)
    Parameters
    Type Name Description
    IElement content
    EventMessages eventMessages
    Returns
    Type Description
    SavedNotification<IElement>
    View Source

    SavedNotification(IElement, EventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>?)

    Creates the "saved" notification for a single item, carrying the cultures that were saved.

    Declaration
    protected override SavedNotification<IElement> SavedNotification(IElement content, EventMessages eventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? savedCultures)
    Parameters
    Type Name Description
    IElement content

    The item that was saved.

    EventMessages eventMessages

    The event messages collection.

    IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> savedCultures

    The cultures that were saved, keyed by item key, or null if not tracked.

    Returns
    Type Description
    SavedNotification<IElement>

    The notification to publish.

    Remarks

    Defaults to the culture-agnostic SavedNotification(TContent, EventMessages) overload so external subclasses keep working; ContentService and ElementService override this to carry the map on the concrete notification. See BuildCultureMap(TContent, IEnumerable<string>?) for why the cultures are captured at raise-time.

    View Source

    SavingNotification(IEnumerable<IElement>, EventMessages)

    Declaration
    protected override SavingNotification<IElement> SavingNotification(IEnumerable<IElement> content, EventMessages eventMessages)
    Parameters
    Type Name Description
    IEnumerable<IElement> content
    EventMessages eventMessages
    Returns
    Type Description
    SavingNotification<IElement>
    View Source

    SavingNotification(IElement, EventMessages)

    Declaration
    protected override SavingNotification<IElement> SavingNotification(IElement content, EventMessages eventMessages)
    Parameters
    Type Name Description
    IElement content
    EventMessages eventMessages
    Returns
    Type Description
    SavingNotification<IElement>
    View Source

    TreeChangeNotification(IEnumerable<IElement>, TreeChangeTypes, EventMessages)

    Declaration
    protected override TreeChangeNotification<IElement> TreeChangeNotification(IEnumerable<IElement> content, TreeChangeTypes changeTypes, EventMessages eventMessages)
    Parameters
    Type Name Description
    IEnumerable<IElement> content
    TreeChangeTypes changeTypes
    EventMessages eventMessages
    Returns
    Type Description
    TreeChangeNotification<IElement>
    View Source

    TreeChangeNotification(IElement, TreeChangeTypes, IEnumerable<string>?, IEnumerable<string>?, EventMessages)

    Declaration
    protected override TreeChangeNotification<IElement> TreeChangeNotification(IElement content, TreeChangeTypes changeTypes, IEnumerable<string>? publishedCultures, IEnumerable<string>? unpublishedCultures, EventMessages eventMessages)
    Parameters
    Type Name Description
    IElement content
    TreeChangeTypes changeTypes
    IEnumerable<string> publishedCultures
    IEnumerable<string> unpublishedCultures
    EventMessages eventMessages
    Returns
    Type Description
    TreeChangeNotification<IElement>
    View Source

    TreeChangeNotification(IElement, TreeChangeTypes, EventMessages)

    Declaration
    protected override TreeChangeNotification<IElement> TreeChangeNotification(IElement content, TreeChangeTypes changeTypes, EventMessages eventMessages)
    Parameters
    Type Name Description
    IElement content
    TreeChangeTypes changeTypes
    EventMessages eventMessages
    Returns
    Type Description
    TreeChangeNotification<IElement>
    View Source

    UnpublishedNotification(IElement, EventMessages)

    Declaration
    protected override IStatefulNotification UnpublishedNotification(IElement content, EventMessages eventMessages)
    Parameters
    Type Name Description
    IElement content
    EventMessages eventMessages
    Returns
    Type Description
    IStatefulNotification
    View Source

    UnpublishedNotification(IElement, EventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>?)

    Creates the "unpublished" notification for a single item, carrying the cultures that were unpublished.

    Declaration
    protected override IStatefulNotification UnpublishedNotification(IElement content, EventMessages eventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? unpublishedCultures)
    Parameters
    Type Name Description
    IElement content

    The item that was unpublished.

    EventMessages eventMessages

    The event messages collection.

    IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> unpublishedCultures

    The cultures that were unpublished, keyed by item key, or null if not tracked.

    Returns
    Type Description
    IStatefulNotification

    The notification to publish.

    Remarks

    Defaults to the culture-agnostic UnpublishedNotification(TContent, EventMessages) overload so external subclasses keep working; ContentService and ElementService override this to carry the map on the concrete notification. This is only raised when the item is unpublished as a whole.

    View Source

    UnpublishingNotification(IElement, EventMessages)

    Declaration
    protected override CancelableEnumerableObjectNotification<IElement> UnpublishingNotification(IElement content, EventMessages eventMessages)
    Parameters
    Type Name Description
    IElement content
    EventMessages eventMessages
    Returns
    Type Description
    CancelableEnumerableObjectNotification<IElement>
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX