View Source
Class ContentController
The API controller used for editing content
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Assembly: Umbraco.Web.BackOffice.dll
Syntax
[Authorize(Policy = "TreeAccessDocuments")]
public class ContentController : ContentControllerBase
Constructors
View Source
ContentController(ICultureDictionary, ILoggerFactory, IShortStringHelper, IEventMessagesFactory, ILocalizedTextService, PropertyEditorCollection, IContentService, IUserService, IBackOfficeSecurityAccessor, IContentTypeService, IUmbracoMapper, IPublishedUrlProvider, IDomainService, IDataTypeService, ILocalizationService, IFileService, INotificationService, ActionCollection, ISqlContext, IJsonSerializer, ICoreScopeProvider, IAuthorizationService, IContentVersionService, ICultureImpactFactory)
Declaration
public ContentController(ICultureDictionary cultureDictionary, ILoggerFactory loggerFactory, IShortStringHelper shortStringHelper, IEventMessagesFactory eventMessages, ILocalizedTextService localizedTextService, PropertyEditorCollection propertyEditors, IContentService contentService, IUserService userService, IBackOfficeSecurityAccessor backofficeSecurityAccessor, IContentTypeService contentTypeService, IUmbracoMapper umbracoMapper, IPublishedUrlProvider publishedUrlProvider, IDomainService domainService, IDataTypeService dataTypeService, ILocalizationService localizationService, IFileService fileService, INotificationService notificationService, ActionCollection actionCollection, ISqlContext sqlContext, IJsonSerializer serializer, ICoreScopeProvider scopeProvider, IAuthorizationService authorizationService, IContentVersionService contentVersionService, ICultureImpactFactory cultureImpactFactory)
Parameters
Type |
Name |
Description |
ICultureDictionary |
cultureDictionary |
|
Microsoft.Extensions.Logging.ILoggerFactory |
loggerFactory |
|
IShortStringHelper |
shortStringHelper |
|
IEventMessagesFactory |
eventMessages |
|
ILocalizedTextService |
localizedTextService |
|
PropertyEditorCollection |
propertyEditors |
|
IContentService |
contentService |
|
IUserService |
userService |
|
IBackOfficeSecurityAccessor |
backofficeSecurityAccessor |
|
IContentTypeService |
contentTypeService |
|
IUmbracoMapper |
umbracoMapper |
|
IPublishedUrlProvider |
publishedUrlProvider |
|
IDomainService |
domainService |
|
IDataTypeService |
dataTypeService |
|
ILocalizationService |
localizationService |
|
IFileService |
fileService |
|
INotificationService |
notificationService |
|
ActionCollection |
actionCollection |
|
ISqlContext |
sqlContext |
|
IJsonSerializer |
serializer |
|
ICoreScopeProvider |
scopeProvider |
|
Microsoft.AspNetCore.Authorization.IAuthorizationService |
authorizationService |
|
IContentVersionService |
contentVersionService |
|
ICultureImpactFactory |
cultureImpactFactory |
|
View Source
ContentController(ICultureDictionary, ILoggerFactory, IShortStringHelper, IEventMessagesFactory, ILocalizedTextService, PropertyEditorCollection, IContentService, IUserService, IBackOfficeSecurityAccessor, IContentTypeService, IUmbracoMapper, IPublishedUrlProvider, IDomainService, IDataTypeService, ILocalizationService, IFileService, INotificationService, ActionCollection, ISqlContext, IJsonSerializer, ICoreScopeProvider, IAuthorizationService, IContentVersionService, ICultureImpactFactory, IUserGroupService, IOptions<ContentSettings>)
Declaration
[ActivatorUtilitiesConstructor]
public ContentController(ICultureDictionary cultureDictionary, ILoggerFactory loggerFactory, IShortStringHelper shortStringHelper, IEventMessagesFactory eventMessages, ILocalizedTextService localizedTextService, PropertyEditorCollection propertyEditors, IContentService contentService, IUserService userService, IBackOfficeSecurityAccessor backofficeSecurityAccessor, IContentTypeService contentTypeService, IUmbracoMapper umbracoMapper, IPublishedUrlProvider publishedUrlProvider, IDomainService domainService, IDataTypeService dataTypeService, ILocalizationService localizationService, IFileService fileService, INotificationService notificationService, ActionCollection actionCollection, ISqlContext sqlContext, IJsonSerializer serializer, ICoreScopeProvider scopeProvider, IAuthorizationService authorizationService, IContentVersionService contentVersionService, ICultureImpactFactory cultureImpactFactory, IUserGroupService userGroupService, IOptions<ContentSettings> contentSettings)
Parameters
Type |
Name |
Description |
ICultureDictionary |
cultureDictionary |
|
Microsoft.Extensions.Logging.ILoggerFactory |
loggerFactory |
|
IShortStringHelper |
shortStringHelper |
|
IEventMessagesFactory |
eventMessages |
|
ILocalizedTextService |
localizedTextService |
|
PropertyEditorCollection |
propertyEditors |
|
IContentService |
contentService |
|
IUserService |
userService |
|
IBackOfficeSecurityAccessor |
backofficeSecurityAccessor |
|
IContentTypeService |
contentTypeService |
|
IUmbracoMapper |
umbracoMapper |
|
IPublishedUrlProvider |
publishedUrlProvider |
|
IDomainService |
domainService |
|
IDataTypeService |
dataTypeService |
|
ILocalizationService |
localizationService |
|
IFileService |
fileService |
|
INotificationService |
notificationService |
|
ActionCollection |
actionCollection |
|
ISqlContext |
sqlContext |
|
IJsonSerializer |
serializer |
|
ICoreScopeProvider |
scopeProvider |
|
Microsoft.AspNetCore.Authorization.IAuthorizationService |
authorizationService |
|
IContentVersionService |
contentVersionService |
|
ICultureImpactFactory |
cultureImpactFactory |
|
IUserGroupService |
userGroupService |
|
Microsoft.Extensions.Options.IOptions<ContentSettings> |
contentSettings |
|
Properties
View Source
Domains
Declaration
public object Domains { get; }
Property Value
Type |
Description |
System.Object |
|
Methods
View Source
CreateBlueprintFromContent(Int32, String)
Creates a blueprint from a content item
Declaration
[Authorize(Policy = "ContentPermissionCreateBlueprintFromId")]
[HttpPost]
public ActionResult<SimpleNotificationModel> CreateBlueprintFromContent([FromQuery] int contentId, [FromQuery] string name)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
The content id to copy
|
System.String |
name |
The name of the blueprint
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<SimpleNotificationModel> |
|
View Source
DeleteBlueprint(Int32)
Declaration
[Authorize(Policy = "TreeAccessDocumentTypes")]
[HttpDelete]
[HttpPost]
public IActionResult DeleteBlueprint(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
DeleteById(Int32)
Moves an item to the recycle bin, if it is already there then it will permanently delete it
Declaration
[Authorize(Policy = "ContentPermissionDeleteById")]
[HttpDelete]
[HttpPost]
public IActionResult DeleteById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
EmptyRecycleBin()
Declaration
[HttpDelete]
[HttpPost]
[Authorize(Policy = "ContentPermissionEmptyRecycleBin")]
public IActionResult EmptyRecycleBin()
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
GetBlueprintById(Int32)
Declaration
public ActionResult<ContentItemDisplay?> GetBlueprintById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<ContentItemDisplay>> |
|
View Source
GetById(Guid)
Gets the content json for the content guid
Declaration
[Authorize(Policy = "ContentPermissionBrowseById")]
public ActionResult<ContentItemDisplayWithSchedule?> GetById(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<ContentItemDisplayWithSchedule>> |
|
View Source
GetById(Int32)
Gets the content json for the content id
Declaration
[Authorize(Policy = "ContentPermissionBrowseById")]
public ActionResult<ContentItemDisplayWithSchedule?> GetById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<ContentItemDisplayWithSchedule>> |
|
View Source
GetById(Udi)
Gets the content json for the content udi
Declaration
[Authorize(Policy = "ContentPermissionBrowseById")]
public ActionResult<ContentItemDisplayWithSchedule?> GetById(Udi id)
Parameters
Type |
Name |
Description |
Udi |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<ContentItemDisplayWithSchedule>> |
|
View Source
GetByIds(Int32[])
Return content for the specified ids
Declaration
public IEnumerable<ContentItemDisplay> GetByIds([FromQuery] int[] ids)
Parameters
Type |
Name |
Description |
System.Int32[] |
ids |
|
Returns
Type |
Description |
IEnumerable<ContentItemDisplay> |
|
View Source
GetChildren(Int32, String, Int32, Int32, String, Direction, Boolean, String, String)
Gets the children for the content id passed in
Declaration
public PagedResult<ContentItemBasic<ContentPropertyBasic>> GetChildren(int id, string includeProperties, int pageNumber = 0, int pageSize = 0, string orderBy = "SortOrder", Direction orderDirection = null, bool orderBySystemField = true, string filter = "", string cultureName = "")
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.String |
includeProperties |
|
System.Int32 |
pageNumber |
|
System.Int32 |
pageSize |
|
System.String |
orderBy |
|
Direction |
orderDirection |
|
System.Boolean |
orderBySystemField |
|
System.String |
filter |
|
System.String |
cultureName |
|
Returns
Type |
Description |
PagedResult<ContentItemBasic<ContentPropertyBasic>> |
|
View Source
GetCultureAndDomains(Int32)
Declaration
public ContentDomainsAndCulture GetCultureAndDomains(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
ContentDomainsAndCulture |
|
View Source
GetDetailedPermissions(Int32)
Returns the user group permissions for user groups assigned to this node
Declaration
[Authorize(Policy = "ContentPermissionAdministrationById")]
public ActionResult<IEnumerable<AssignedUserGroupPermissions?>?> GetDetailedPermissions(int contentId)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<IEnumerable<System.Nullable<AssignedUserGroupPermissions>>>> |
|
View Source
GetEmpty(String, Int32)
Gets an empty content item for the document type.
Declaration
public ActionResult<ContentItemDisplay?> GetEmpty(string contentTypeAlias, int parentId)
Parameters
Type |
Name |
Description |
System.String |
contentTypeAlias |
|
System.Int32 |
parentId |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<ContentItemDisplay>> |
|
View Source
GetEmptyBlueprint(Int32, Int32)
Declaration
public ActionResult<ContentItemDisplay?> GetEmptyBlueprint(int blueprintId, int parentId)
Parameters
Type |
Name |
Description |
System.Int32 |
blueprintId |
|
System.Int32 |
parentId |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<ContentItemDisplay>> |
|
View Source
GetEmptyByAliases(ContentTypesByAliases)
Gets a dictionary containing empty content items for every alias specified in the contentTypeAliases array in the
body of the request.
Declaration
[HttpPost]
public ActionResult<IDictionary<string, ContentItemDisplay>> GetEmptyByAliases(ContentTypesByAliases contentTypesByAliases)
Parameters
Type |
Name |
Description |
ContentTypesByAliases |
contentTypesByAliases |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<IDictionary<System.String, ContentItemDisplay>> |
|
View Source
GetEmptyByKey(Guid, Int32)
Gets an empty content item for the document type.
Declaration
public ActionResult<ContentItemDisplay?> GetEmptyByKey(Guid contentTypeKey, int parentId)
Parameters
Type |
Name |
Description |
Guid |
contentTypeKey |
|
System.Int32 |
parentId |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<ContentItemDisplay>> |
|
View Source
GetEmptyByKeys(ContentTypesByKeys)
Gets a collection of empty content items for all document types.
Declaration
[HttpPost]
public ActionResult<IDictionary<Guid, ContentItemDisplay>> GetEmptyByKeys(ContentTypesByKeys contentTypeByKeys)
Parameters
Type |
Name |
Description |
ContentTypesByKeys |
contentTypeByKeys |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<IDictionary<Guid, ContentItemDisplay>> |
|
View Source
GetEmptyByKeys(Guid[], Int32)
Gets a collection of empty content items for all document types.
Declaration
public ActionResult<IDictionary<Guid, ContentItemDisplay>> GetEmptyByKeys([FromQuery] Guid[] contentTypeKeys, [FromQuery] int parentId)
Parameters
Type |
Name |
Description |
Guid[] |
contentTypeKeys |
|
System.Int32 |
parentId |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<IDictionary<Guid, ContentItemDisplay>> |
|
View Source
GetNiceUrl(Guid)
Gets the Url for a given node ID
Declaration
public IActionResult GetNiceUrl(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
GetNiceUrl(Int32)
Gets the Url for a given node ID
Declaration
public IActionResult GetNiceUrl(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
GetNiceUrl(Udi)
Gets the Url for a given node ID
Declaration
public IActionResult GetNiceUrl(Udi id)
Parameters
Type |
Name |
Description |
Udi |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
GetNotificationOptions(Int32)
Declaration
[Authorize(Policy = "ContentPermissionBrowseById")]
public ActionResult<IEnumerable<NotifySetting>> GetNotificationOptions(int contentId)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<IEnumerable<NotifySetting>> |
|
View Source
GetPagedContentVersions(Int32, Int32, Int32, String)
Declaration
[HttpGet]
[JsonCamelCaseFormatter]
public IActionResult GetPagedContentVersions(int contentId, int pageNumber = 1, int pageSize = 10, string culture = null)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
System.Int32 |
pageNumber |
|
System.Int32 |
pageSize |
|
System.String |
culture |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
GetRecycleBin()
Returns an item to be used to display the recycle bin for content
Declaration
public ActionResult<ContentItemDisplay> GetRecycleBin()
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<ContentItemDisplay> |
|
View Source
GetRollbackVersion(Int32, String)
Declaration
[HttpGet]
public ContentVariantDisplay? GetRollbackVersion(int versionId, string culture = null)
Parameters
Type |
Name |
Description |
System.Int32 |
versionId |
|
System.String |
culture |
|
Returns
Type |
Description |
System.Nullable<ContentVariantDisplay> |
|
View Source
GetRollbackVersions(Int32, String)
Declaration
[HttpGet]
public IEnumerable<RollbackVersion> GetRollbackVersions(int contentId, string culture = null)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
System.String |
culture |
|
Returns
Type |
Description |
IEnumerable<RollbackVersion> |
|
View Source
PostCopy(MoveOrCopy)
Copies a content item and places the copy as a child of a given parent Id
Declaration
public async Task<ActionResult<IContent>> PostCopy(MoveOrCopy copy)
Parameters
Type |
Name |
Description |
MoveOrCopy |
copy |
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.ActionResult<IContent>> |
|
View Source
PostMove(MoveOrCopy)
Change the sort order for media
Declaration
public async Task<IActionResult> PostMove(MoveOrCopy move)
Parameters
Type |
Name |
Description |
MoveOrCopy |
move |
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.IActionResult> |
|
View Source
PostNotificationOptions(Int32, String[])
Declaration
public IActionResult PostNotificationOptions(int contentId, [FromQuery(Name = "notifyOptions[]")] string[] notifyOptions)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
System.String[] |
notifyOptions |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostPublishById(Int32)
Publishes a document with a given ID
Declaration
[Authorize(Policy = "ContentPermissionPublishById")]
public IActionResult PostPublishById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostPublishByIdAndCulture(PublishContent)
Publishes a document with a given ID and cultures.
Declaration
[Authorize(Policy = "ContentPermissionPublishById")]
public IActionResult PostPublishByIdAndCulture(PublishContent model)
Parameters
Type |
Name |
Description |
PublishContent |
model |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
Remarks
View Source
PostRollbackContent(Int32, Int32, String)
Declaration
[Authorize(Policy = "ContentPermissionRollbackById")]
[HttpPost]
public IActionResult PostRollbackContent(int contentId, int versionId, string culture = null)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
System.Int32 |
versionId |
|
System.String |
culture |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostSave(ContentItemSave)
Declaration
[ContentSaveValidation(false)]
public async Task<ActionResult<ContentItemDisplay<ContentVariantScheduleDisplay>?>> PostSave([ModelBinder(typeof(ContentItemBinder))] ContentItemSave contentItem)
Parameters
Type |
Name |
Description |
ContentItemSave |
contentItem |
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<ContentItemDisplay<ContentVariantScheduleDisplay>>>> |
|
View Source
PostSaveBlueprint(ContentItemSave)
Declaration
[Authorize(Policy = "TreeAccessDocumentTypes")]
[ContentSaveValidation(true)]
public async Task<ActionResult<ContentItemDisplay<ContentVariantDisplay>?>> PostSaveBlueprint([ModelBinder(typeof(BlueprintItemBinder))] ContentItemSave contentItem)
Parameters
Type |
Name |
Description |
ContentItemSave |
contentItem |
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<ContentItemDisplay<ContentVariantDisplay>>>> |
|
View Source
PostSaveLanguageAndDomains(DomainSave)
Declaration
[HttpPost]
public ActionResult<DomainSave> PostSaveLanguageAndDomains(DomainSave model)
Parameters
Type |
Name |
Description |
DomainSave |
model |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<DomainSave> |
|
View Source
PostSaveUserGroupPermissions(UserGroupPermissionsSave)
Updates the permissions for a content item for a particular user group
Declaration
public async Task<ActionResult<IEnumerable<AssignedUserGroupPermissions?>?>> PostSaveUserGroupPermissions(UserGroupPermissionsSave saveModel)
Parameters
Type |
Name |
Description |
UserGroupPermissionsSave |
saveModel |
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<IEnumerable<System.Nullable<AssignedUserGroupPermissions>>>>> |
|
View Source
PostSetContentVersionPreventCleanup(Int32, Int32, Boolean)
Declaration
[HttpPost]
[Authorize(Policy = "ContentPermissionAdministrationById")]
public IActionResult PostSetContentVersionPreventCleanup(int contentId, int versionId, bool preventCleanup)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
System.Int32 |
versionId |
|
System.Boolean |
preventCleanup |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostSort(ContentSortOrder)
Change the sort order for content
Declaration
public async Task<IActionResult> PostSort(ContentSortOrder sorted)
Parameters
Type |
Name |
Description |
ContentSortOrder |
sorted |
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.IActionResult> |
|
View Source
PostUnpublish(UnpublishContent)
Unpublishes a node with a given Id and returns the unpublished entity
Declaration
public async Task<ActionResult<ContentItemDisplayWithSchedule?>> PostUnpublish(UnpublishContent model)
Parameters
Type |
Name |
Description |
UnpublishContent |
model |
The content and variants to unpublish
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<ContentItemDisplayWithSchedule>>> |
|