View Source
An API controller used for dealing with content types
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Assembly: Umbraco.Web.BackOffice.dll
[PluginController("UmbracoApi")]
public class MediaTypeController : ContentTypeControllerBase<IMediaType>, IUmbracoFeature, IDiscoverable
Constructors
View Source
MediaTypeController(ICultureDictionary, EditorValidatorCollection, IContentTypeService, IMediaTypeService, IMemberTypeService, IUmbracoMapper, ILocalizedTextService, IShortStringHelper, IEntityService, IMediaService, IBackOfficeSecurityAccessor)
Declaration
public MediaTypeController(ICultureDictionary cultureDictionary, EditorValidatorCollection editorValidatorCollection, IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService, IUmbracoMapper umbracoMapper, ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, IEntityService entityService, IMediaService mediaService, IBackOfficeSecurityAccessor backofficeSecurityAccessor)
Parameters
Methods
View Source
Deletes a media type with a given ID
Declaration
[HttpDelete]
[HttpPost]
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult DeleteById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
Deletes a media type container with a given ID
Declaration
[HttpDelete]
[HttpPost]
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult DeleteContainer(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
Declaration
[Authorize(Policy = "TreeAccessMediaTypes")]
public IEnumerable<ContentTypeBasic> GetAll()
Returns
View Source
Returns a media type by alias
Declaration
public IEnumerable<MediaTypeDisplay> GetAllFiltered([FromQuery] string[] aliases)
Parameters
Type |
Name |
Description |
System.String[] |
aliases |
|
Returns
View Source
Returns the allowed child content type objects for the content item id passed in - based on a GUID id
Declaration
[Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<IEnumerable<ContentTypeBasic>> GetAllowedChildren(Guid contentId)
Parameters
Type |
Name |
Description |
Guid |
contentId |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<IEnumerable<ContentTypeBasic>> |
|
View Source
Returns the allowed child content type objects for the content item id passed in - based on an INT id
Declaration
[Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public IEnumerable<ContentTypeBasic> GetAllowedChildren(int contentId)
Parameters
Type |
Name |
Description |
System.Int32 |
contentId |
|
Returns
View Source
Returns the allowed child content type objects for the content item id passed in - based on a UDI id
Declaration
[Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<IEnumerable<ContentTypeBasic>> GetAllowedChildren(Udi contentId)
Parameters
Type |
Name |
Description |
Udi |
contentId |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<IEnumerable<ContentTypeBasic>> |
|
View Source
GetAvailableCompositeMediaTypes(GetAvailableCompositionsFilter)
Returns the available compositions for this content type
This has been wrapped in a dto instead of simple parameters to support having multiple parameters in post request
body
Declaration
[HttpPost]
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult GetAvailableCompositeMediaTypes(GetAvailableCompositionsFilter filter)
Parameters
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
Gets the media type a given guid
Declaration
[Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<MediaTypeDisplay> GetById(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
View Source
Gets the media type a given id
Declaration
[Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<MediaTypeDisplay> GetById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
View Source
Gets the media type a given udi
Declaration
[Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<MediaTypeDisplay> GetById(Udi id)
Parameters
Type |
Name |
Description |
Udi |
id |
|
Returns
View Source
Declaration
Returns
Type |
Description |
System.Int32 |
|
View Source
Declaration
[Authorize(Policy = "TreeAccessMediaTypes")]
public MediaTypeDisplay GetEmpty(int parentId)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
Returns
View Source
GetWhereCompositionIsUsedInContentTypes(GetAvailableCompositionsFilter)
Returns where a particular composition has been used
This has been wrapped in a dto instead of simple parameters to support having multiple parameters in post request
body
Declaration
[HttpPost]
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult GetWhereCompositionIsUsedInContentTypes(GetAvailableCompositionsFilter filter)
Parameters
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostCopy(MoveOrCopy)
Declaration
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult PostCopy(MoveOrCopy copy)
Parameters
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostCreateContainer(Int32, String)
Declaration
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult PostCreateContainer(int parentId, string name)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.String |
name |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostMove(MoveOrCopy)
Declaration
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult PostMove(MoveOrCopy move)
Parameters
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostRenameContainer(Int32, String)
Declaration
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult PostRenameContainer(int id, string name)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.String |
name |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PostSave(MediaTypeSave)
Declaration
[Authorize(Policy = "TreeAccessMediaTypes")]
public ActionResult<MediaTypeDisplay> PostSave(MediaTypeSave contentTypeSave)
Parameters
Returns