Class ContentService
Implements the content service.
Namespace: Umbraco.Cms.Core.Services.Implement
Assembly: cs.temp.dll.dll
Syntax
public class ContentService : RepositoryService
Constructors
ContentService(IScopeProvider, ILoggerFactory, IEventMessagesFactory, IDocumentRepository, IEntityRepository, IAuditRepository, IContentTypeRepository, IDocumentBlueprintRepository, ILanguageRepository, Lazy<IPropertyValidationService>, IShortStringHelper)
Declaration
public ContentService(IScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, IDocumentRepository documentRepository, IEntityRepository entityRepository, IAuditRepository auditRepository, IContentTypeRepository contentTypeRepository, IDocumentBlueprintRepository documentBlueprintRepository, ILanguageRepository languageRepository, Lazy<IPropertyValidationService> propertyValidationService, IShortStringHelper shortStringHelper)
Parameters
| Type | Name | Description |
|---|---|---|
| IScopeProvider | provider | |
| ILoggerFactory | loggerFactory | |
| IEventMessagesFactory | eventMessagesFactory | |
| IDocumentRepository | documentRepository | |
| IEntityRepository | entityRepository | |
| IAuditRepository | auditRepository | |
| IContentTypeRepository | contentTypeRepository | |
| IDocumentBlueprintRepository | documentBlueprintRepository | |
| ILanguageRepository | languageRepository | |
| System.Lazy<IPropertyValidationService> | propertyValidationService | |
| IShortStringHelper | shortStringHelper |
Methods
CheckDataIntegrity(ContentDataIntegrityReportOptions)
Declaration
public ContentDataIntegrityReport CheckDataIntegrity(ContentDataIntegrityReportOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentDataIntegrityReportOptions | options |
Returns
| Type | Description |
|---|---|
| ContentDataIntegrityReport |
Copy(IContent, Int32, Boolean, Boolean, Int32)
Copies an
Declaration
public IContent Copy(IContent content, int parentId, bool relateToOriginal, bool recursive, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | The |
| System.Int32 | parentId | Id of the Content's new Parent |
| System.Boolean | relateToOriginal | Boolean indicating whether the copy should be related to the original |
| System.Boolean | recursive | A value indicating whether to recursively copy children. |
| System.Int32 | userId | Optional Id of the User copying the Content |
Returns
| Type | Description |
|---|---|
| IContent | The newly created |
Copy(IContent, Int32, Boolean, Int32)
Copies an
Declaration
public IContent Copy(IContent content, int parentId, bool relateToOriginal, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | The |
| System.Int32 | parentId | Id of the Content's new Parent |
| System.Boolean | relateToOriginal | Boolean indicating whether the copy should be related to the original |
| System.Int32 | userId | Optional Id of the User copying the Content |
Returns
| Type | Description |
|---|---|
| IContent | The newly created |
Count(String)
Declaration
public int Count(string contentTypeAlias = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | contentTypeAlias |
Returns
| Type | Description |
|---|---|
| System.Int32 |
CountChildren(Int32, String)
Declaration
public int CountChildren(int parentId, string contentTypeAlias = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | parentId | |
| System.String | contentTypeAlias |
Returns
| Type | Description |
|---|---|
| System.Int32 |
CountDescendants(Int32, String)
Declaration
public int CountDescendants(int parentId, string contentTypeAlias = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | parentId | |
| System.String | contentTypeAlias |
Returns
| Type | Description |
|---|---|
| System.Int32 |
CountPublished(String)
Declaration
public int CountPublished(string contentTypeAlias = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | contentTypeAlias |
Returns
| Type | Description |
|---|---|
| System.Int32 |
Create(String, IContent, String, Int32)
Creates an
Declaration
public IContent Create(string name, IContent parent, string contentTypeAlias, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the content object. |
| IContent | parent | The parent content object. |
| System.String | contentTypeAlias | The alias of the content type. |
| System.Int32 | userId | The optional id of the user creating the content. |
Returns
| Type | Description |
|---|---|
| IContent | The content object. |
Remarks
This method simply returns a new, non-persisted, IContent without any identity. It is intended as a shortcut to creating new content objects that does not invoke a save operation against the database.
Create(String, Guid, String, Int32)
Creates an
Declaration
public IContent Create(string name, Guid parentId, string contentTypeAlias, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Name of the Content object |
| System.Guid | parentId | Id of Parent for the new Content |
| System.String | contentTypeAlias | Alias of the |
| System.Int32 | userId | Optional id of the user creating the content |
Returns
| Type | Description |
|---|---|
| IContent |
Remarks
Note that using this method will simply return a new IContent without any identity as it has not yet been persisted. It is intended as a shortcut to creating new content objects that does not invoke a save operation against the database.
Create(String, Int32, IContentType, Int32)
Creates an
Declaration
public IContent Create(string name, int parentId, IContentType contentType, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the content object. |
| System.Int32 | parentId | The identifier of the parent, or -1. |
| IContentType | contentType | The content type of the content |
| System.Int32 | userId | The optional id of the user creating the content. |
Returns
| Type | Description |
|---|---|
| IContent | The content object. |
Remarks
This method simply returns a new, non-persisted, IContent without any identity. It is intended as a shortcut to creating new content objects that does not invoke a save operation against the database.
Create(String, Int32, String, Int32)
Creates an
Declaration
public IContent Create(string name, int parentId, string contentTypeAlias, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the content object. |
| System.Int32 | parentId | The identifier of the parent, or -1. |
| System.String | contentTypeAlias | The alias of the content type. |
| System.Int32 | userId | The optional id of the user creating the content. |
Returns
| Type | Description |
|---|---|
| IContent | The content object. |
Remarks
This method simply returns a new, non-persisted, IContent without any identity. It is intended as a shortcut to creating new content objects that does not invoke a save operation against the database.
CreateAndSave(String, IContent, String, Int32)
Creates an
Declaration
public IContent CreateAndSave(string name, IContent parent, string contentTypeAlias, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the content object. |
| IContent | parent | The parent content object. |
| System.String | contentTypeAlias | The alias of the content type. |
| System.Int32 | userId | The optional id of the user creating the content. |
Returns
| Type | Description |
|---|---|
| IContent | The content object. |
Remarks
This method returns a new, persisted, IContent with an identity.
CreateAndSave(String, Int32, String, Int32)
Creates an
Declaration
public IContent CreateAndSave(string name, int parentId, string contentTypeAlias, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the content object. |
| System.Int32 | parentId | The identifier of the parent, or -1. |
| System.String | contentTypeAlias | The alias of the content type. |
| System.Int32 | userId | The optional id of the user creating the content. |
Returns
| Type | Description |
|---|---|
| IContent | The content object. |
Remarks
This method returns a new, persisted, IContent with an identity.
CreateContentFromBlueprint(IContent, String, Int32)
Declaration
public IContent CreateContentFromBlueprint(IContent blueprint, string name, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | blueprint | |
| System.String | name | |
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| IContent |
Delete(IContent, Int32)
Declaration
public OperationResult Delete(IContent content, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | |
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| OperationResult |
DeleteBlueprint(IContent, Int32)
Declaration
public void DeleteBlueprint(IContent content, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | |
| System.Int32 | userId |
DeleteBlueprintsOfType(Int32, Int32)
Declaration
public void DeleteBlueprintsOfType(int contentTypeId, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | contentTypeId | |
| System.Int32 | userId |
DeleteBlueprintsOfTypes(IEnumerable<Int32>, Int32)
Declaration
public void DeleteBlueprintsOfTypes(IEnumerable<int> contentTypeIds, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.Int32> | contentTypeIds | |
| System.Int32 | userId |
DeleteOfType(Int32, Int32)
Deletes all content items of specified type. All children of deleted content item is moved to Recycle Bin.
Declaration
public void DeleteOfType(int contentTypeId, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | contentTypeId | Id of the |
| System.Int32 | userId | Optional id of the user deleting the media |
Remarks
This needs extra care and attention as its potentially a dangerous and extensive operation
DeleteOfTypes(IEnumerable<Int32>, Int32)
Deletes all content of specified type. All children of deleted content is moved to Recycle Bin.
Declaration
public void DeleteOfTypes(IEnumerable<int> contentTypeIds, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.Int32> | contentTypeIds | Id of the |
| System.Int32 | userId | Optional Id of the user issuing the delete operation |
Remarks
This needs extra care and attention as its potentially a dangerous and extensive operation.
Deletes content items of the specified type, and only that type. Does not handle content types inheritance and compositions, which need to be managed outside of this method.
DeleteVersion(Int32, Int32, Boolean, Int32)
Permanently deletes specific version(s) from an
Declaration
public void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | Id of the |
| System.Int32 | versionId | Id of the version to delete |
| System.Boolean | deletePriorVersions | Boolean indicating whether to delete versions prior to the versionId |
| System.Int32 | userId | Optional Id of the User deleting versions of a Content object |
DeleteVersions(Int32, DateTime, Int32)
Permanently deletes versions from an
Declaration
public void DeleteVersions(int id, DateTime versionDate, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | Id of the |
| System.DateTime | versionDate | Latest version date |
| System.Int32 | userId | Optional Id of the User deleting versions of a Content object |
EmptyRecycleBin(Int32)
Empties the Recycle Bin by deleting all
Declaration
public OperationResult EmptyRecycleBin(int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| OperationResult |
GetAncestors(IContent)
Gets a collection of
Declaration
public IEnumerable<IContent> GetAncestors(IContent content)
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> | An Enumerable list of |
GetAncestors(Int32)
Gets a collection of
Declaration
public IEnumerable<IContent> GetAncestors(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | Id of the |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> | An Enumerable list of |
GetBlueprintById(Guid)
Declaration
public IContent GetBlueprintById(Guid id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | id |
Returns
| Type | Description |
|---|---|
| IContent |
GetBlueprintById(Int32)
Declaration
public IContent GetBlueprintById(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id |
Returns
| Type | Description |
|---|---|
| IContent |
GetBlueprintsForContentTypes(Int32[])
Declaration
public IEnumerable<IContent> GetBlueprintsForContentTypes(params int[] contentTypeId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32[] | contentTypeId |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> |
GetById(Guid)
Gets an
Declaration
public IContent GetById(Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Guid | key | Guid key of the Content to retrieve |
Returns
| Type | Description |
|---|---|
| IContent |
GetById(Int32)
Gets an
Declaration
public IContent GetById(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | Id of the Content to retrieve |
Returns
| Type | Description |
|---|---|
| IContent |
GetByIds(IEnumerable<Guid>)
Gets
Declaration
public IEnumerable<IContent> GetByIds(IEnumerable<Guid> ids)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.Guid> | ids | Ids of the Content to retrieve |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> |
GetByIds(IEnumerable<Int32>)
Gets an
Declaration
public IEnumerable<IContent> GetByIds(IEnumerable<int> ids)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.Int32> | ids | Ids of the Content to retrieve |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> |
GetByLevel(Int32)
Gets a collection of
Declaration
public IEnumerable<IContent> GetByLevel(int level)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | level | The level to retrieve Content from |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> | An Enumerable list of |
Remarks
Contrary to most methods, this method filters out trashed content items.
GetContentForExpiration(DateTime)
Declaration
public IEnumerable<IContent> GetContentForExpiration(DateTime date)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTime | date |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> |
GetContentForRelease(DateTime)
Declaration
public IEnumerable<IContent> GetContentForRelease(DateTime date)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTime | date |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> |
GetPagedChildren(Int32, Int64, Int32, out Int64, IQuery<IContent>, Ordering)
Declaration
public IEnumerable<IContent> GetPagedChildren(int id, long pageIndex, int pageSize, out long totalChildren, IQuery<IContent> filter = null, Ordering ordering = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | |
| System.Int64 | pageIndex | |
| System.Int32 | pageSize | |
| System.Int64 | totalChildren | |
| IQuery<IContent> | filter | |
| Ordering | ordering |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> |
GetPagedContentInRecycleBin(Int64, Int32, out Int64, IQuery<IContent>, Ordering)
Gets a collection of an
Declaration
public 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 |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> | An Enumerable list of |
GetPagedDescendants(Int32, Int64, Int32, out Int64, IQuery<IContent>, Ordering)
Declaration
public IEnumerable<IContent> GetPagedDescendants(int id, long pageIndex, int pageSize, out long totalChildren, IQuery<IContent> filter = null, Ordering ordering = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | |
| System.Int64 | pageIndex | |
| System.Int32 | pageSize | |
| System.Int64 | totalChildren | |
| IQuery<IContent> | filter | |
| Ordering | ordering |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> |
GetPagedOfType(Int32, Int64, Int32, out Int64, IQuery<IContent>, Ordering)
Declaration
public IEnumerable<IContent> GetPagedOfType(int contentTypeId, long pageIndex, int pageSize, out long totalRecords, IQuery<IContent> filter = null, Ordering ordering = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | contentTypeId | |
| System.Int64 | pageIndex | |
| System.Int32 | pageSize | |
| System.Int64 | totalRecords | |
| IQuery<IContent> | filter | |
| Ordering | ordering |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> |
GetPagedOfTypes(Int32[], Int64, Int32, out Int64, IQuery<IContent>, Ordering)
Declaration
public 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 | |
| System.Int64 | pageIndex | |
| System.Int32 | pageSize | |
| System.Int64 | totalRecords | |
| IQuery<IContent> | filter | |
| Ordering | ordering |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> |
GetParent(IContent)
Gets the parent of the current content as an
Declaration
public IContent GetParent(IContent content)
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content |
Returns
| Type | Description |
|---|---|
| IContent | Parent |
GetParent(Int32)
Gets the parent of the current content as an
Declaration
public IContent GetParent(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | Id of the |
Returns
| Type | Description |
|---|---|
| IContent | Parent |
GetPermissions(IContent)
Returns implicit/inherited permissions assigned to the content item for all user groups
Declaration
public EntityPermissionCollection GetPermissions(IContent content)
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content |
Returns
| Type | Description |
|---|---|
| EntityPermissionCollection |
GetPublishedChildren(Int32)
Gets a collection of published
Declaration
public IEnumerable<IContent> GetPublishedChildren(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | Id of the Parent to retrieve Children from |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> | An Enumerable list of published |
GetRootContent()
Gets a collection of
Declaration
public IEnumerable<IContent> GetRootContent()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> | An Enumerable list of |
GetVersion(Int32)
Gets a specific version of an
Declaration
public IContent GetVersion(int versionId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | versionId | Id of the version to retrieve |
Returns
| Type | Description |
|---|---|
| IContent | An |
GetVersionIds(Int32, Int32)
Gets a list of all version Ids for the given content item ordered so latest is first
Declaration
public IEnumerable<int> GetVersionIds(int id, int maxRows)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | |
| System.Int32 | maxRows | The maximum number of rows to return |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<System.Int32> |
GetVersions(Int32)
Gets a collection of an
Declaration
public IEnumerable<IContent> GetVersions(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> | An Enumerable list of |
GetVersionsSlim(Int32, Int32, Int32)
Gets a collection of an
Declaration
public 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 |
|---|---|
| System.Collections.Generic.IEnumerable<IContent> | An Enumerable list of |
HasChildren(Int32)
Checks whether an
Declaration
public bool HasChildren(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | Id of the |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the content has any children otherwise False |
IsPathPublishable(IContent)
Checks if the passed in
Declaration
public bool IsPathPublishable(IContent content)
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the Content can be published, otherwise False |
IsPathPublished(IContent)
Declaration
public bool IsPathPublished(IContent content)
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Move(IContent, Int32, Int32)
Moves an
Declaration
public void Move(IContent content, int parentId, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | The |
| System.Int32 | parentId | Id of the Content's new Parent |
| System.Int32 | userId | Optional Id of the User moving the Content |
Remarks
If the
MoveToRecycleBin(IContent, Int32)
Declaration
public OperationResult MoveToRecycleBin(IContent content, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | |
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| OperationResult |
PerformScheduledPublish(DateTime)
Declaration
public IEnumerable<PublishResult> PerformScheduledPublish(DateTime date)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTime | date |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<PublishResult> |
RecycleBinSmells()
Declaration
public bool RecycleBinSmells()
Returns
| Type | Description |
|---|---|
| System.Boolean |
Rollback(Int32, Int32, String, Int32)
Declaration
public OperationResult Rollback(int id, int versionId, string culture = "*", int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | |
| System.Int32 | versionId | |
| System.String | culture | |
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| OperationResult |
Save(IContent, Int32)
Declaration
public OperationResult Save(IContent content, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | |
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| OperationResult |
Save(IEnumerable<IContent>, Int32)
Declaration
public OperationResult Save(IEnumerable<IContent> contents, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<IContent> | contents | |
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| OperationResult |
SaveAndPublish(IContent, String, Int32)
Declaration
public PublishResult SaveAndPublish(IContent content, string culture = "*", int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | |
| System.String | culture | |
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| PublishResult |
SaveAndPublish(IContent, String[], Int32)
Declaration
public PublishResult SaveAndPublish(IContent content, string[] cultures, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | |
| System.String[] | cultures | |
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| PublishResult |
SaveAndPublishBranch(IContent, Boolean, String, Int32)
Declaration
public IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string culture = "*", int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | |
| System.Boolean | force | |
| System.String | culture | |
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<PublishResult> |
SaveAndPublishBranch(IContent, Boolean, String[], Int32)
Declaration
public IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string[] cultures, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | |
| System.Boolean | force | |
| System.String[] | cultures | |
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<PublishResult> |
SaveBlueprint(IContent, Int32)
Declaration
public void SaveBlueprint(IContent content, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | |
| System.Int32 | userId |
SendToPublication(IContent, Int32)
Sends an
Declaration
public bool SendToPublication(IContent content, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | The |
| System.Int32 | userId | Optional Id of the User issuing the send to publication |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if sending publication was successful otherwise false |
SetPermission(IContent, Char, IEnumerable<Int32>)
Assigns a single permission to the current content item for the specified group ids
Declaration
public void SetPermission(IContent entity, char permission, IEnumerable<int> groupIds)
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | entity | |
| System.Char | permission | |
| System.Collections.Generic.IEnumerable<System.Int32> | groupIds |
SetPermissions(EntityPermissionSet)
Declaration
public void SetPermissions(EntityPermissionSet permissionSet)
Parameters
| Type | Name | Description |
|---|---|---|
| EntityPermissionSet | permissionSet |
Sort(IEnumerable<IContent>, Int32)
Sorts a collection of items.
Declaration
public OperationResult Sort(IEnumerable<IContent> items, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<IContent> | items | |
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| OperationResult | Result indicating what action was taken when handling the command. |
Remarks
Using this method will ensure that the Published-state is maintained upon sorting so the cache is updated accordingly - as needed.
Sort(IEnumerable<Int32>, Int32)
Sorts a collection of ids.
Declaration
public OperationResult Sort(IEnumerable<int> ids, int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.Int32> | ids | |
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| OperationResult | Result indicating what action was taken when handling the command. |
Remarks
Using this method will ensure that the Published-state is maintained upon sorting so the cache is updated accordingly - as needed.
Unpublish(IContent, String, Int32)
Declaration
public PublishResult Unpublish(IContent content, string culture = "*", int userId = default(int))
Parameters
| Type | Name | Description |
|---|---|---|
| IContent | content | |
| System.String | culture | |
| System.Int32 | userId |
Returns
| Type | Description |
|---|---|
| PublishResult |