View Source
Class ContentController
The API controller used for editing content
Inheritance
System.Object
Assembly: Umbraco.Web.dll
Syntax
[PluginController("UmbracoApi")]
public class ContentController : ContentControllerBase, IDiscoverable
Constructors
View Source
ContentController(PropertyEditorCollection, IGlobalSettings, IUmbracoContextAccessor, ISqlContext, ServiceContext, AppCaches, IProfilingLogger, IRuntimeState, UmbracoHelper, IScopeProvider)
Declaration
public ContentController(PropertyEditorCollection propertyEditors, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IScopeProvider scopeProvider)
Parameters
Properties
View Source
Domains
Declaration
public object Domains { get; }
Property Value
Type |
Description |
System.Object |
|
Methods
View Source
AllowsCultureVariation()
Returns true if any content types have culture variation enabled
Declaration
public bool AllowsCultureVariation()
Returns
Type |
Description |
System.Boolean |
|
View Source
CreateBlueprintFromContent(Int32, String)
Creates a blueprint from a content item
Declaration
public SimpleNotificationModel CreateBlueprintFromContent(int contentId, string name)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
The content id to copy
|
System.String |
name |
The name of the blueprint
|
Returns
View Source
DeleteBlueprint(Int32)
Declaration
public HttpResponseMessage DeleteBlueprint(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
DeleteById(Int32)
Moves an item to the recycle bin, if it is already there then it will permanently delete it
Declaration
public HttpResponseMessage DeleteById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
EmptyRecycleBin()
Declaration
public HttpResponseMessage EmptyRecycleBin()
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
GetBlueprintById(Int32)
Declaration
public ContentItemDisplay GetBlueprintById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
View Source
GetById(Guid)
Gets the content json for the content guid
Declaration
public ContentItemDisplay GetById(Guid id)
Parameters
Type |
Name |
Description |
System.Guid |
id |
|
Returns
View Source
GetById(Int32)
Gets the content json for the content id
Declaration
public ContentItemDisplay GetById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
View Source
GetById(Udi)
Gets the content json for the content udi
Declaration
public ContentItemDisplay GetById(Udi id)
Parameters
Type |
Name |
Description |
Udi |
id |
|
Returns
View Source
GetByIds(Int32[])
Return content for the specified ids
Declaration
public IEnumerable<ContentItemDisplay> GetByIds(int[] ids)
Parameters
Type |
Name |
Description |
System.Int32[] |
ids |
|
Returns
View Source
GetChildren(Int32, Int32, Int32, String, Direction, Boolean, String)
Gets the children for the content id passed in
Declaration
public PagedResult<ContentItemBasic<ContentPropertyBasic>> GetChildren(int id, int pageNumber = 0, int pageSize = 0, string orderBy = "SortOrder", Direction orderDirection = Direction.Ascending, bool orderBySystemField = true, string filter = "")
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.Int32 |
pageNumber |
|
System.Int32 |
pageSize |
|
System.String |
orderBy |
|
Direction |
orderDirection |
|
System.Boolean |
orderBySystemField |
|
System.String |
filter |
|
Returns
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 = Direction.Ascending, 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
View Source
GetCultureAndDomains(Int32)
Declaration
public ContentDomainsAndCulture GetCultureAndDomains(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
View Source
GetDetailedPermissions(Int32)
Returns the user group permissions for user groups assigned to this node
Declaration
public IEnumerable<AssignedUserGroupPermissions> GetDetailedPermissions(int contentId)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
Returns
View Source
GetEmpty(Int32, Int32)
Declaration
public ContentItemDisplay GetEmpty(int blueprintId, int parentId)
Parameters
Type |
Name |
Description |
System.Int32 |
blueprintId |
|
System.Int32 |
parentId |
|
Returns
View Source
GetEmpty(String, Int32)
Gets an empty content item for the document type.
Declaration
public ContentItemDisplay GetEmpty(string contentTypeAlias, int parentId)
Parameters
Type |
Name |
Description |
System.String |
contentTypeAlias |
|
System.Int32 |
parentId |
|
Returns
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
public IDictionary<string, ContentItemDisplay> GetEmptyByAliases(ContentTypesByAliases contentTypesByAliases)
Parameters
Returns
Type |
Description |
System.Collections.Generic.IDictionary<System.String, ContentItemDisplay> |
|
View Source
GetEmptyByKey(Guid, Int32)
Gets an empty content item for the document type.
Declaration
public ContentItemDisplay GetEmptyByKey(Guid contentTypeKey, int parentId)
Parameters
Type |
Name |
Description |
System.Guid |
contentTypeKey |
|
System.Int32 |
parentId |
|
Returns
View Source
GetEmptyByKeys(Guid[], Int32)
Gets a collection of empty content items for all document types.
Declaration
public IDictionary<Guid, ContentItemDisplay> GetEmptyByKeys(Guid[] contentTypeKeys, int parentId)
Parameters
Type |
Name |
Description |
System.Guid[] |
contentTypeKeys |
|
System.Int32 |
parentId |
|
Returns
View Source
GetEmptyByKeys(ContentTypesByKeys)
Gets a collection of empty content items for all document types.
Declaration
public IDictionary<Guid, ContentItemDisplay> GetEmptyByKeys(ContentTypesByKeys contentTypeByKeys)
Parameters
Returns
View Source
GetNiceUrl(Guid)
Gets the Url for a given node ID
Declaration
public HttpResponseMessage GetNiceUrl(Guid id)
Parameters
Type |
Name |
Description |
System.Guid |
id |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
GetNiceUrl(Int32)
Gets the Url for a given node ID
Declaration
public HttpResponseMessage GetNiceUrl(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
GetNiceUrl(Udi)
Gets the Url for a given node ID
Declaration
public HttpResponseMessage GetNiceUrl(Udi id)
Parameters
Type |
Name |
Description |
Udi |
id |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
GetNotificationOptions(Int32)
Declaration
public IEnumerable<NotifySetting> GetNotificationOptions(int contentId)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<NotifySetting> |
|
View Source
GetPagedContentVersions(Int32, Int32, Int32, String)
Declaration
public PagedResult<ContentVersionMetaViewModel> 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
View Source
GetPublicAccess(Int32)
Declaration
public HttpResponseMessage GetPublicAccess(int contentId)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
GetRecycleBin()
Returns an item to be used to display the recycle bin for content
Declaration
public ContentItemDisplay GetRecycleBin()
Returns
View Source
GetRollbackVersion(Int32, String)
Declaration
public ContentVariantDisplay GetRollbackVersion(int versionId, string culture = null)
Parameters
Type |
Name |
Description |
System.Int32 |
versionId |
|
System.String |
culture |
|
Returns
View Source
GetRollbackVersions(Int32, String)
Declaration
public IEnumerable<RollbackVersion> GetRollbackVersions(int contentId, string culture = null)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
System.String |
culture |
|
Returns
View Source
PostCopy(MoveOrCopy)
Copies a content item and places the copy as a child of a given parent Id
Declaration
public HttpResponseMessage PostCopy(MoveOrCopy copy)
Parameters
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
PostMove(MoveOrCopy)
Change the sort order for media
Declaration
public HttpResponseMessage PostMove(MoveOrCopy move)
Parameters
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
PostNotificationOptions(Int32, String[])
Declaration
public void PostNotificationOptions(int contentId, string[] notifyOptions)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
System.String[] |
notifyOptions |
|
View Source
PostPublicAccess(Int32, String[], String[], Int32, Int32)
Declaration
public HttpResponseMessage PostPublicAccess(int contentId, string[] groups, string[] usernames, int loginPageId, int errorPageId)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
System.String[] |
groups |
|
System.String[] |
usernames |
|
System.Int32 |
loginPageId |
|
System.Int32 |
errorPageId |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
PostPublishById(Int32)
Publishes a document with a given ID
Declaration
public HttpResponseMessage PostPublishById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
PostRollbackContent(Int32, Int32, String)
Declaration
public HttpResponseMessage PostRollbackContent(int contentId, int versionId, string culture = "*")
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
System.Int32 |
versionId |
|
System.String |
culture |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
PostSave(ContentItemSave)
Declaration
public ContentItemDisplay PostSave(ContentItemSave contentItem)
Parameters
Returns
View Source
PostSaveBlueprint(ContentItemSave)
Declaration
public ContentItemDisplay PostSaveBlueprint(ContentItemSave contentItem)
Parameters
Returns
View Source
PostSaveLanguageAndDomains(DomainSave)
Declaration
public DomainSave PostSaveLanguageAndDomains(DomainSave model)
Parameters
Returns
View Source
PostSaveUserGroupPermissions(UserGroupPermissionsSave)
Updates the permissions for a content item for a particular user group
Declaration
public IEnumerable<AssignedUserGroupPermissions> PostSaveUserGroupPermissions(UserGroupPermissionsSave saveModel)
Parameters
Returns
View Source
PostSetContentVersionPreventCleanup(Int32, Int32, Boolean)
Declaration
public HttpResponseMessage PostSetContentVersionPreventCleanup(int contentId, int versionId, bool preventCleanup)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
System.Int32 |
versionId |
|
System.Boolean |
preventCleanup |
|
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
PostSort(ContentSortOrder)
Change the sort order for content
Declaration
public HttpResponseMessage PostSort(ContentSortOrder sorted)
Parameters
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
PostUnpublish(UnpublishContent)
Unpublishes a node with a given Id and returns the unpublished entity
Declaration
public ContentItemDisplay PostUnpublish(UnpublishContent model)
Parameters
Type |
Name |
Description |
UnpublishContent |
model |
The content and variants to unpublish
|
Returns
View Source
RemovePublicAccess(Int32)
Declaration
public HttpResponseMessage RemovePublicAccess(int contentId)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
Returns
Type |
Description |
HttpResponseMessage |
|