Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IContentService

    Defines the ContentService, which is an easy access to operations involving IContent

    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IContentService : IContentServiceBase<IContent>, IContentServiceBase, IService

    Methods

    View Source

    AttemptMove(IContent, Int32, Int32)

    Attempts to move the IContent content to under the node with id parentId.

    Declaration
    virtual OperationResult AttemptMove(IContent content, int parentId, int userId = -1)
    Parameters
    Type Name Description
    IContent content

    The IContent that shall be moved.

    System.Int32 parentId

    The id of the new parent node.

    System.Int32 userId

    Id of the user attempting to move content.

    Returns
    Type Description
    OperationResult

    Success if moving succeeded, otherwise Failed.

    View Source

    Copy(IContent, Int32, Boolean, Boolean, Int32)

    Copies a document.

    Declaration
    IContent Copy(IContent content, int parentId, bool relateToOriginal, bool recursive, int userId = -1)
    Parameters
    Type Name Description
    IContent content
    System.Int32 parentId
    System.Boolean relateToOriginal
    System.Boolean recursive
    System.Int32 userId
    Returns
    Type Description
    IContent
    Remarks

    Optionally recursively copies all children.

    View Source

    Copy(IContent, Int32, Boolean, Int32)

    Copies a document.

    Declaration
    IContent Copy(IContent content, int parentId, bool relateToOriginal, int userId = -1)
    Parameters
    Type Name Description
    IContent content
    System.Int32 parentId
    System.Boolean relateToOriginal
    System.Int32 userId
    Returns
    Type Description
    IContent
    Remarks

    Recursively copies all children.

    View Source

    Count(String)

    Counts documents of a given document type.

    Declaration
    int Count(string documentTypeAlias = null)
    Parameters
    Type Name Description
    System.String documentTypeAlias
    Returns
    Type Description
    System.Int32
    View Source

    CountChildren(Int32, String)

    Counts child documents of a given parent, of a given document type.

    Declaration
    int CountChildren(int parentId, string documentTypeAlias = null)
    Parameters
    Type Name Description
    System.Int32 parentId
    System.String documentTypeAlias
    Returns
    Type Description
    System.Int32
    View Source

    CountDescendants(Int32, String)

    Counts descendant documents of a given parent, of a given document type.

    Declaration
    int CountDescendants(int parentId, string documentTypeAlias = null)
    Parameters
    Type Name Description
    System.Int32 parentId
    System.String documentTypeAlias
    Returns
    Type Description
    System.Int32
    View Source

    CountPublished(String)

    Counts published documents of a given document type.

    Declaration
    int CountPublished(string documentTypeAlias = null)
    Parameters
    Type Name Description
    System.String documentTypeAlias
    Returns
    Type Description
    System.Int32
    View Source

    Create(String, Guid, String, Int32)

    Creates a document.

    Declaration
    IContent Create(string name, Guid parentId, string documentTypeAlias, int userId = -1)
    Parameters
    Type Name Description
    System.String name
    Guid parentId
    System.String documentTypeAlias
    System.Int32 userId
    Returns
    Type Description
    IContent
    View Source

    Create(String, Int32, String, Int32)

    Creates a document.

    Declaration
    IContent Create(string name, int parentId, string documentTypeAlias, int userId = -1)
    Parameters
    Type Name Description
    System.String name
    System.Int32 parentId
    System.String documentTypeAlias
    System.Int32 userId
    Returns
    Type Description
    IContent
    View Source

    Create(String, Int32, IContentType, Int32)

    Creates a document

    Declaration
    IContent Create(string name, int parentId, IContentType contentType, int userId = -1)
    Parameters
    Type Name Description
    System.String name
    System.Int32 parentId
    IContentType contentType
    System.Int32 userId
    Returns
    Type Description
    IContent
    View Source

    Create(String, IContent, String, Int32)

    Creates a document.

    Declaration
    IContent Create(string name, IContent parent, string documentTypeAlias, int userId = -1)
    Parameters
    Type Name Description
    System.String name
    IContent parent
    System.String documentTypeAlias
    System.Int32 userId
    Returns
    Type Description
    IContent
    View Source

    CreateAndSave(String, Int32, String, Int32)

    Creates and saves a document.

    Declaration
    IContent CreateAndSave(string name, int parentId, string contentTypeAlias, int userId = -1)
    Parameters
    Type Name Description
    System.String name
    System.Int32 parentId
    System.String contentTypeAlias
    System.Int32 userId
    Returns
    Type Description
    IContent
    View Source

    CreateAndSave(String, IContent, String, Int32)

    Creates and saves a document.

    Declaration
    IContent CreateAndSave(string name, IContent parent, string contentTypeAlias, int userId = -1)
    Parameters
    Type Name Description
    System.String name
    IContent parent
    System.String contentTypeAlias
    System.Int32 userId
    Returns
    Type Description
    IContent
    View Source

    CreateContentFromBlueprint(IContent, String, Int32)

    Creates a new content item from a blueprint.

    Declaration
    IContent CreateContentFromBlueprint(IContent blueprint, string name, int userId = -1)
    Parameters
    Type Name Description
    IContent blueprint
    System.String name
    System.Int32 userId
    Returns
    Type Description
    IContent
    View Source

    Delete(IContent, Int32)

    Deletes a document.

    Declaration
    OperationResult Delete(IContent content, int userId = -1)
    Parameters
    Type Name Description
    IContent content
    System.Int32 userId
    Returns
    Type Description
    OperationResult
    Remarks

    This method will also delete associated media files, child content and possibly associated domains.

    This method entirely clears the content from the database.

    View Source

    DeleteBlueprint(IContent, Int32)

    Deletes a blueprint.

    Declaration
    void DeleteBlueprint(IContent content, int userId = -1)
    Parameters
    Type Name Description
    IContent content
    System.Int32 userId
    View Source

    DeleteBlueprintsOfType(Int32, Int32)

    Deletes blueprints for a content type.

    Declaration
    void DeleteBlueprintsOfType(int contentTypeId, int userId = -1)
    Parameters
    Type Name Description
    System.Int32 contentTypeId
    System.Int32 userId
    View Source

    DeleteBlueprintsOfTypes(IEnumerable<Int32>, Int32)

    Deletes blueprints for content types.

    Declaration
    void DeleteBlueprintsOfTypes(IEnumerable<int> contentTypeIds, int userId = -1)
    Parameters
    Type Name Description
    IEnumerable<System.Int32> contentTypeIds
    System.Int32 userId
    View Source

    DeleteOfType(Int32, Int32)

    Deletes all documents of a given document type.

    Declaration
    void DeleteOfType(int documentTypeId, int userId = -1)
    Parameters
    Type Name Description
    System.Int32 documentTypeId
    System.Int32 userId
    Remarks

    All non-deleted descendants of the deleted documents are moved to the recycle bin.

    This operation is potentially dangerous and expensive.

    View Source

    DeleteOfTypes(IEnumerable<Int32>, Int32)

    Deletes all documents of given document types.

    Declaration
    void DeleteOfTypes(IEnumerable<int> contentTypeIds, int userId = -1)
    Parameters
    Type Name Description
    IEnumerable<System.Int32> contentTypeIds
    System.Int32 userId
    Remarks

    All non-deleted descendants of the deleted documents are moved to the recycle bin.

    This operation is potentially dangerous and expensive.

    View Source

    DeleteVersion(Int32, Int32, Boolean, Int32)

    Deletes a version of a document.

    Declaration
    void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = -1)
    Parameters
    Type Name Description
    System.Int32 id
    System.Int32 versionId
    System.Boolean deletePriorVersions
    System.Int32 userId
    View Source

    DeleteVersions(Int32, DateTime, Int32)

    Deletes versions of a document prior to a given date.

    Declaration
    void DeleteVersions(int id, DateTime date, int userId = -1)
    Parameters
    Type Name Description
    System.Int32 id
    DateTime date
    System.Int32 userId
    View Source

    EmptyRecycleBin(Int32)

    Empties the Recycle Bin by deleting all IContent that resides in the bin

    Declaration
    OperationResult EmptyRecycleBin(int userId = -1)
    Parameters
    Type Name Description
    System.Int32 userId

    Optional Id of the User emptying the Recycle Bin

    Returns
    Type Description
    OperationResult
    View Source

    GetAncestors(Int32)

    Gets ancestor documents of a document.

    Declaration
    IEnumerable<IContent> GetAncestors(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    IEnumerable<IContent>
    View Source

    GetAncestors(IContent)

    Gets ancestor documents of a document.

    Declaration
    IEnumerable<IContent> GetAncestors(IContent content)
    Parameters
    Type Name Description
    IContent content
    Returns
    Type Description
    IEnumerable<IContent>
    View Source

    GetBlueprintById(Guid)

    Gets a blueprint.

    Declaration
    IContent GetBlueprintById(Guid id)
    Parameters
    Type Name Description
    Guid id
    Returns
    Type Description
    IContent
    View Source

    GetBlueprintById(Int32)

    Gets a blueprint.

    Declaration
    IContent GetBlueprintById(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    IContent
    View Source

    GetBlueprintsForContentTypes(Int32[])

    Gets blueprints for a content type.

    Declaration
    IEnumerable<IContent> GetBlueprintsForContentTypes(params int[] documentTypeId)
    Parameters
    Type Name Description
    System.Int32[] documentTypeId
    Returns
    Type Description
    IEnumerable<IContent>
    View Source

    GetById(Guid)

    Gets a document.

    Declaration
    IContent GetById(Guid key)
    Parameters
    Type Name Description
    Guid key
    Returns
    Type Description
    IContent
    View Source

    GetById(Int32)

    Gets a document.

    Declaration
    IContent GetById(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    IContent
    View Source

    GetByIds(IEnumerable<Guid>)

    Gets documents.

    Declaration
    IEnumerable<IContent> GetByIds(IEnumerable<Guid> ids)
    Parameters
    Type Name Description
    IEnumerable<Guid> ids
    Returns
    Type Description
    IEnumerable<IContent>
    View Source

    GetByIds(IEnumerable<Int32>)

    Gets documents.

    Declaration
    IEnumerable<IContent> GetByIds(IEnumerable<int> ids)
    Parameters
    Type Name Description
    IEnumerable<System.Int32> ids
    Returns
    Type Description
    IEnumerable<IContent>
    View Source

    GetByLevel(Int32)

    Gets documents at a given level.

    Declaration
    IEnumerable<IContent> GetByLevel(int level)
    Parameters
    Type Name Description
    System.Int32 level
    Returns
    Type Description
    IEnumerable<IContent>
    View Source

    GetContentForExpiration(DateTime)

    Gets documents having an expiration date before (lower than, or equal to) a specified date.

    Declaration
    IEnumerable<IContent> GetContentForExpiration(DateTime date)
    Parameters
    Type Name Description
    DateTime date
    Returns
    Type Description
    IEnumerable<IContent>

    An Enumerable list of IContent objects

    Remarks

    The content returned from this method may be culture variant, in which case you can use GetStatus(IContent, ContentScheduleCollection, String) to get the status for a specific culture.

    View Source

    GetContentForRelease(DateTime)

    Gets documents having a release date before (lower than, or equal to) a specified date.

    Declaration
    IEnumerable<IContent> GetContentForRelease(DateTime date)
    Parameters
    Type Name Description
    DateTime date
    Returns
    Type Description
    IEnumerable<IContent>

    An Enumerable list of IContent objects

    Remarks

    The content returned from this method may be culture variant, in which case you can use GetStatus(IContent, ContentScheduleCollection, String) to get the status for a specific culture.

    View Source

    GetContentScheduleByContentId(Int32)

    Gets publish/unpublish schedule for a content node.

    Declaration
    ContentScheduleCollection GetContentScheduleByContentId(int contentId)
    Parameters
    Type Name Description
    System.Int32 contentId

    Id of the Content to load schedule for

    Returns
    Type Description
    ContentScheduleCollection ContentScheduleCollection
    View Source

    GetPagedChildren(Int32, Int64, Int32, out Int64, IQuery<IContent>, Ordering)

    Gets child documents of a parent.

    Declaration
    IEnumerable<IContent> GetPagedChildren(int id, long pageIndex, int pageSize, out long totalRecords, IQuery<IContent> filter = null, Ordering ordering = null)
    Parameters
    Type Name Description
    System.Int32 id

    The parent identifier.

    System.Int64 pageIndex

    The page number.

    System.Int32 pageSize

    The page size.

    System.Int64 totalRecords

    Total number of documents.

    IQuery<IContent> filter

    Query filter.

    Ordering ordering

    Ordering infos.

    Returns
    Type Description
    IEnumerable<IContent>
    View Source

    GetPagedContentInRecycleBin(Int64, Int32, out Int64, IQuery<IContent>, Ordering)

    Gets documents in the recycle bin.

    Declaration
    IEnumerable<IContent> GetPagedContentInRecycleBin(long pageIndex, int pageSize, out long totalRecords, IQuery<IContent> filter = null, Ordering ordering = null)
    Parameters
    Type Name Description
    System.Int64 pageIndex
    System.Int32 pageSize
    System.Int64 totalRecords
    IQuery<IContent> filter
    Ordering ordering
    Returns
    Type Description
    IEnumerable<IContent>
    View Source

    GetPagedDescendants(Int32, Int64, Int32, out Int64, IQuery<IContent>, Ordering)

    Gets descendant documents of a given parent.

    Declaration
    IEnumerable<IContent> GetPagedDescendants(int id, long pageIndex, int pageSize, out long totalRecords, IQuery<IContent> filter = null, Ordering ordering = null)
    Parameters
    Type Name Description
    System.Int32 id

    The parent identifier.

    System.Int64 pageIndex

    The page number.

    System.Int32 pageSize

    The page size.

    System.Int64 totalRecords

    Total number of documents.

    IQuery<IContent> filter

    Query filter.

    Ordering ordering

    Ordering infos.

    Returns
    Type Description
    IEnumerable<IContent>
    View Source

    GetPagedOfType(Int32, Int64, Int32, out Int64, IQuery<IContent>, Ordering)

    Gets paged documents of a content

    Declaration
    IEnumerable<IContent> GetPagedOfType(int contentTypeId, long pageIndex, int pageSize, out long totalRecords, IQuery<IContent> filter, Ordering ordering = null)
    Parameters
    Type Name Description
    System.Int32 contentTypeId

    The page number.

    System.Int64 pageIndex

    The page number.

    System.Int32 pageSize

    The page size.

    System.Int64 totalRecords

    Total number of documents.

    IQuery<IContent> filter

    Search text filter.

    Ordering ordering

    Ordering infos.

    Returns
    Type Description
    IEnumerable<IContent>
    View Source

    GetPagedOfTypes(Int32[], Int64, Int32, out Int64, IQuery<IContent>, Ordering)

    Gets paged documents for specified content types

    Declaration
    IEnumerable<IContent> GetPagedOfTypes(int[] contentTypeIds, long pageIndex, int pageSize, out long totalRecords, IQuery<IContent> filter, Ordering ordering = null)
    Parameters
    Type Name Description
    System.Int32[] contentTypeIds

    The page number.

    System.Int64 pageIndex

    The page number.

    System.Int32 pageSize

    The page size.

    System.Int64 totalRecords

    Total number of documents.

    IQuery<IContent> filter

    Search text filter.

    Ordering ordering

    Ordering infos.

    Returns
    Type Description
    IEnumerable<IContent>
    View Source

    GetParent(Int32)

    Gets the parent of a document.

    Declaration
    IContent GetParent(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    IContent
    View Source

    GetParent(IContent)

    Gets the parent of a document.

    Declaration
    IContent GetParent(IContent content)
    Parameters
    Type Name Description
    IContent content
    Returns
    Type Description
    IContent
    View Source

    GetPermissions(IContent)

    Gets permissions assigned to a document.

    Declaration
    EntityPermissionCollection GetPermissions(IContent content)
    Parameters
    Type Name Description
    IContent content
    Returns
    Type Description
    EntityPermissionCollection
    View Source

    GetRootContent()

    Gets root-level documents.

    Declaration
    IEnumerable<IContent> GetRootContent()
    Returns
    Type Description
    IEnumerable<IContent>
    View Source

    GetVersion(Int32)

    Gets a version of a document.

    Declaration
    IContent GetVersion(int versionId)
    Parameters
    Type Name Description
    System.Int32 versionId
    Returns
    Type Description
    IContent
    View Source

    GetVersionIds(Int32, Int32)

    Gets top versions of a document.

    Declaration
    IEnumerable<int> GetVersionIds(int id, int topRows)
    Parameters
    Type Name Description
    System.Int32 id
    System.Int32 topRows
    Returns
    Type Description
    IEnumerable<System.Int32>
    Remarks

    Versions are ordered with current first, then most recent first.

    View Source

    GetVersions(Int32)

    Gets all versions of a document.

    Declaration
    IEnumerable<IContent> GetVersions(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    IEnumerable<IContent>
    Remarks

    Versions are ordered with current first, then most recent first.

    View Source

    GetVersionsSlim(Int32, Int32, Int32)

    Gets all versions of a document.

    Declaration
    IEnumerable<IContent> GetVersionsSlim(int id, int skip, int take)
    Parameters
    Type Name Description
    System.Int32 id
    System.Int32 skip
    System.Int32 take
    Returns
    Type Description
    IEnumerable<IContent>
    Remarks

    Versions are ordered with current first, then most recent first.

    View Source

    HasChildren(Int32)

    Gets a value indicating whether a document has children.

    Declaration
    bool HasChildren(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    System.Boolean
    View Source

    IsPathPublishable(IContent)

    Gets a value indicating whether a document is path-publishable.

    Declaration
    bool IsPathPublishable(IContent content)
    Parameters
    Type Name Description
    IContent content
    Returns
    Type Description
    System.Boolean
    Remarks

    A document is path-publishable when all its ancestors are published.

    View Source

    IsPathPublished(IContent)

    Gets a value indicating whether a document is path-published.

    Declaration
    bool IsPathPublished(IContent content)
    Parameters
    Type Name Description
    IContent content
    Returns
    Type Description
    System.Boolean
    Remarks

    A document is path-published when all its ancestors, and the document itself, are published.

    View Source

    Move(IContent, Int32, Int32)

    Moves a document under a new parent.

    Declaration
    void Move(IContent content, int parentId, int userId = -1)
    Parameters
    Type Name Description
    IContent content
    System.Int32 parentId
    System.Int32 userId
    View Source

    MoveToRecycleBin(IContent, Int32)

    Moves a document to the recycle bin.

    Declaration
    OperationResult MoveToRecycleBin(IContent content, int userId = -1)
    Parameters
    Type Name Description
    IContent content
    System.Int32 userId
    Returns
    Type Description
    OperationResult
    View Source

    PerformScheduledPublish(DateTime)

    Publishes and unpublishes scheduled documents.

    Declaration
    IEnumerable<PublishResult> PerformScheduledPublish(DateTime date)
    Parameters
    Type Name Description
    DateTime date
    Returns
    Type Description
    IEnumerable<PublishResult>
    View Source

    PersistContentSchedule(IContent, ContentScheduleCollection)

    Persists publish/unpublish schedule for a content node.

    Declaration
    void PersistContentSchedule(IContent content, ContentScheduleCollection contentSchedule)
    Parameters
    Type Name Description
    IContent content
    ContentScheduleCollection contentSchedule
    View Source

    RecycleBinSmells()

    Returns true if there is any content in the recycle bin

    Declaration
    bool RecycleBinSmells()
    Returns
    Type Description
    System.Boolean
    View Source

    Rollback(Int32, Int32, String, Int32)

    Rolls back the content to a specific version.

    Declaration
    OperationResult Rollback(int id, int versionId, string culture = "*", int userId = -1)
    Parameters
    Type Name Description
    System.Int32 id

    The id of the content node.

    System.Int32 versionId

    The version id to roll back to.

    System.String culture

    An optional culture to roll back.

    System.Int32 userId

    The identifier of the user who is performing the roll back.

    Returns
    Type Description
    OperationResult
    Remarks

    When no culture is specified, all cultures are rolled back.

    View Source

    Save(IEnumerable<IContent>, Int32)

    Saves documents.

    Declaration
    OperationResult Save(IEnumerable<IContent> contents, int userId = -1)
    Parameters
    Type Name Description
    IEnumerable<IContent> contents
    System.Int32 userId
    Returns
    Type Description
    OperationResult
    View Source

    Save(IContent, Nullable<Int32>, ContentScheduleCollection)

    Saves a document.

    Declaration
    OperationResult Save(IContent content, int? userId = null, ContentScheduleCollection contentSchedule = null)
    Parameters
    Type Name Description
    IContent content
    System.Nullable<System.Int32> userId
    ContentScheduleCollection contentSchedule
    Returns
    Type Description
    OperationResult
    View Source

    SaveAndPublish(IContent, String, Int32)

    Saves and publishes a document.

    Declaration
    PublishResult SaveAndPublish(IContent content, string culture = "*", int userId = -1)
    Parameters
    Type Name Description
    IContent content

    The document to publish.

    System.String culture

    The culture to publish.

    System.Int32 userId

    The identifier of the user performing the action.

    Returns
    Type Description
    PublishResult
    Remarks

    By default, publishes all variations of the document, but it is possible to specify a culture to be published.

    When a culture is being published, it includes all varying values along with all invariant values.

    The document is always saved, even when publishing fails.

    If the content type is variant, then culture can be either '' or an actual culture, but neither 'null' nor 'empty'. If the content type is invariant, then culture can be either '' or null or empty.

    View Source

    SaveAndPublish(IContent, String[], Int32)

    Saves and publishes a document.

    Declaration
    PublishResult SaveAndPublish(IContent content, string[] cultures, int userId = -1)
    Parameters
    Type Name Description
    IContent content

    The document to publish.

    System.String[] cultures

    The cultures to publish.

    System.Int32 userId

    The identifier of the user performing the action.

    Returns
    Type Description
    PublishResult
    Remarks

    By default, publishes all variations of the document, but it is possible to specify a culture to be published.

    When a culture is being published, it includes all varying values along with all invariant values.

    The document is always saved, even when publishing fails.

    View Source

    SaveAndPublishBranch(IContent, Boolean, String, Int32)

    Saves and publishes a document branch.

    Declaration
    IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string culture = "*", int userId = -1)
    Parameters
    Type Name Description
    IContent content

    The root document.

    System.Boolean force

    A value indicating whether to force-publish documents that are not already published.

    System.String culture

    A culture, or "*" for all cultures.

    System.Int32 userId

    The identifier of the user performing the operation.

    Returns
    Type Description
    IEnumerable<PublishResult>
    Remarks

    Unless specified, all cultures are re-published. Otherwise, one culture can be specified. To act on more than one culture, see the other overloads of this method.

    The force parameter determines which documents are published. When false, only those documents that are already published, are republished. When true, all documents are published. The root of the branch is always published, regardless of force.

    View Source

    SaveAndPublishBranch(IContent, Boolean, String[], Int32)

    Saves and publishes a document branch.

    Declaration
    IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string[] cultures, int userId = -1)
    Parameters
    Type Name Description
    IContent content

    The root document.

    System.Boolean force

    A value indicating whether to force-publish documents that are not already published.

    System.String[] cultures

    The cultures to publish.

    System.Int32 userId

    The identifier of the user performing the operation.

    Returns
    Type Description
    IEnumerable<PublishResult>
    Remarks

    The force parameter determines which documents are published. When false, only those documents that are already published, are republished. When true, all documents are published. The root of the branch is always published, regardless of force.

    View Source

    SaveAndPublishBranch(IContent, PublishBranchFilter, String, Int32)

    Saves and publishes a document branch.

    Declaration
    virtual IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, PublishBranchFilter publishBranchFilter, string culture = "*", int userId = -1)
    Parameters
    Type Name Description
    IContent content

    The root document.

    PublishBranchFilter publishBranchFilter

    A value indicating options for force publishing unpublished or re-publishing unchanged content.

    System.String culture

    A culture, or "*" for all cultures.

    System.Int32 userId

    The identifier of the user performing the operation.

    Returns
    Type Description
    IEnumerable<PublishResult>
    Remarks

    Unless specified, all cultures are re-published. Otherwise, one culture can be specified. To act on more than one culture, see the other overloads of this method.

    The root of the branch is always published, regardless of publishBranchFilter.

    View Source

    SaveAndPublishBranch(IContent, PublishBranchFilter, String[], Int32)

    Saves and publishes a document branch.

    Declaration
    virtual IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, PublishBranchFilter publishBranchFilter, string[] cultures, int userId = -1)
    Parameters
    Type Name Description
    IContent content

    The root document.

    PublishBranchFilter publishBranchFilter

    A value indicating options for force publishing unpublished or re-publishing unchanged content.

    System.String[] cultures

    The cultures to publish.

    System.Int32 userId

    The identifier of the user performing the operation.

    Returns
    Type Description
    IEnumerable<PublishResult>
    Remarks

    The root of the branch is always published, regardless of publishBranchFilter.

    View Source

    SaveBlueprint(IContent, Int32)

    Saves a blueprint.

    Declaration
    void SaveBlueprint(IContent content, int userId = -1)
    Parameters
    Type Name Description
    IContent content
    System.Int32 userId
    View Source

    SendToPublication(IContent, Int32)

    Saves a document and raises the "sent to publication" events.

    Declaration
    bool SendToPublication(IContent content, int userId = -1)
    Parameters
    Type Name Description
    IContent content
    System.Int32 userId
    Returns
    Type Description
    System.Boolean
    View Source

    SetPermission(IContent, Char, IEnumerable<Int32>)

    Assigns a permission to a document.

    Declaration
    void SetPermission(IContent entity, char permission, IEnumerable<int> groupIds)
    Parameters
    Type Name Description
    IContent entity
    System.Char permission
    IEnumerable<System.Int32> groupIds
    Remarks

    Adds the permission to existing permissions.

    View Source

    SetPermissions(EntityPermissionSet)

    Sets the permission of a document.

    Declaration
    void SetPermissions(EntityPermissionSet permissionSet)
    Parameters
    Type Name Description
    EntityPermissionSet permissionSet
    Remarks

    Replaces all permissions with the new set of permissions.

    View Source

    Sort(IEnumerable<IContent>, Int32)

    Sorts documents.

    Declaration
    OperationResult Sort(IEnumerable<IContent> items, int userId = -1)
    Parameters
    Type Name Description
    IEnumerable<IContent> items
    System.Int32 userId
    Returns
    Type Description
    OperationResult
    View Source

    Sort(Nullable<IEnumerable<Int32>>, Int32)

    Sorts documents.

    Declaration
    OperationResult Sort(IEnumerable<int>? ids, int userId = -1)
    Parameters
    Type Name Description
    System.Nullable<IEnumerable<System.Int32>> ids
    System.Int32 userId
    Returns
    Type Description
    OperationResult
    View Source

    Unpublish(IContent, String, Int32)

    Unpublishes a document.

    Declaration
    PublishResult Unpublish(IContent content, string culture = "*", int userId = -1)
    Parameters
    Type Name Description
    IContent content
    System.String culture
    System.Int32 userId
    Returns
    Type Description
    PublishResult
    Remarks

    By default, unpublishes the document as a whole, but it is possible to specify a culture to be unpublished. Depending on whether that culture is mandatory, and other cultures remain published, the document as a whole may or may not remain published.

    If the content type is variant, then culture can be either '' or an actual culture, but neither null nor empty. If the content type is invariant, then culture can be either '' or null or empty.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • AttemptMove(IContent, Int32, Int32)
      • Copy(IContent, Int32, Boolean, Boolean, Int32)
      • Copy(IContent, Int32, Boolean, Int32)
      • Count(String)
      • CountChildren(Int32, String)
      • CountDescendants(Int32, String)
      • CountPublished(String)
      • Create(String, Guid, String, Int32)
      • Create(String, Int32, String, Int32)
      • Create(String, Int32, IContentType, Int32)
      • Create(String, IContent, String, Int32)
      • CreateAndSave(String, Int32, String, Int32)
      • CreateAndSave(String, IContent, String, Int32)
      • CreateContentFromBlueprint(IContent, String, Int32)
      • Delete(IContent, Int32)
      • DeleteBlueprint(IContent, Int32)
      • DeleteBlueprintsOfType(Int32, Int32)
      • DeleteBlueprintsOfTypes(IEnumerable<Int32>, Int32)
      • DeleteOfType(Int32, Int32)
      • DeleteOfTypes(IEnumerable<Int32>, Int32)
      • DeleteVersion(Int32, Int32, Boolean, Int32)
      • DeleteVersions(Int32, DateTime, Int32)
      • EmptyRecycleBin(Int32)
      • GetAncestors(Int32)
      • GetAncestors(IContent)
      • GetBlueprintById(Guid)
      • GetBlueprintById(Int32)
      • GetBlueprintsForContentTypes(Int32[])
      • GetById(Guid)
      • GetById(Int32)
      • GetByIds(IEnumerable<Guid>)
      • GetByIds(IEnumerable<Int32>)
      • GetByLevel(Int32)
      • GetContentForExpiration(DateTime)
      • GetContentForRelease(DateTime)
      • GetContentScheduleByContentId(Int32)
      • GetPagedChildren(Int32, Int64, Int32, out Int64, IQuery<IContent>, Ordering)
      • GetPagedContentInRecycleBin(Int64, Int32, out Int64, IQuery<IContent>, Ordering)
      • GetPagedDescendants(Int32, Int64, Int32, out Int64, IQuery<IContent>, Ordering)
      • GetPagedOfType(Int32, Int64, Int32, out Int64, IQuery<IContent>, Ordering)
      • GetPagedOfTypes(Int32[], Int64, Int32, out Int64, IQuery<IContent>, Ordering)
      • GetParent(Int32)
      • GetParent(IContent)
      • GetPermissions(IContent)
      • GetRootContent()
      • GetVersion(Int32)
      • GetVersionIds(Int32, Int32)
      • GetVersions(Int32)
      • GetVersionsSlim(Int32, Int32, Int32)
      • HasChildren(Int32)
      • IsPathPublishable(IContent)
      • IsPathPublished(IContent)
      • Move(IContent, Int32, Int32)
      • MoveToRecycleBin(IContent, Int32)
      • PerformScheduledPublish(DateTime)
      • PersistContentSchedule(IContent, ContentScheduleCollection)
      • RecycleBinSmells()
      • Rollback(Int32, Int32, String, Int32)
      • Save(IEnumerable<IContent>, Int32)
      • Save(IContent, Nullable<Int32>, ContentScheduleCollection)
      • SaveAndPublish(IContent, String, Int32)
      • SaveAndPublish(IContent, String[], Int32)
      • SaveAndPublishBranch(IContent, Boolean, String, Int32)
      • SaveAndPublishBranch(IContent, Boolean, String[], Int32)
      • SaveAndPublishBranch(IContent, PublishBranchFilter, String, Int32)
      • SaveAndPublishBranch(IContent, PublishBranchFilter, String[], Int32)
      • SaveBlueprint(IContent, Int32)
      • SendToPublication(IContent, Int32)
      • SetPermission(IContent, Char, IEnumerable<Int32>)
      • SetPermissions(EntityPermissionSet)
      • Sort(IEnumerable<IContent>, Int32)
      • Sort(Nullable<IEnumerable<Int32>>, Int32)
      • Unpublish(IContent, String, Int32)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX