Class MediaTypeController
- Namespace
- Umbraco.Cms.Web.BackOffice.Controllers
- Assembly
- Umbraco.Web.BackOffice.dll
An API controller used for dealing with content types
public class MediaTypeController : ContentTypeControllerBase<IMediaType>
- Inheritance
-
ContentTypeControllerBase<IMediaType>MediaTypeController
- Inherited Members
Constructors
MediaTypeController(ICultureDictionary, EditorValidatorCollection, IContentTypeService, IMediaTypeService, IMemberTypeService, IUmbracoMapper, ILocalizedTextService, IShortStringHelper, IEntityService, IMediaService, IBackOfficeSecurityAccessor)
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
cultureDictionaryICultureDictionaryeditorValidatorCollectionEditorValidatorCollectioncontentTypeServiceIContentTypeServicemediaTypeServiceIMediaTypeServicememberTypeServiceIMemberTypeServiceumbracoMapperIUmbracoMapperlocalizedTextServiceILocalizedTextServiceshortStringHelperIShortStringHelperentityServiceIEntityServicemediaServiceIMediaServicebackofficeSecurityAccessorIBackOfficeSecurityAccessor
Methods
DeleteById(int)
Deletes a media type with a given ID
[HttpDelete]
[HttpPost]
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult DeleteById(int id)
Parameters
idint
Returns
DeleteContainer(int)
Deletes a media type container with a given ID
[HttpDelete]
[HttpPost]
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult DeleteContainer(int id)
Parameters
idint
Returns
GetAll()
Returns all media types
[Authorize(Policy = "TreeAccessMediaTypes")]
public IEnumerable<ContentTypeBasic> GetAll()
Returns
- IEnumerable<ContentTypeBasic>
GetAllFiltered(string[])
Returns a media type by alias
public IEnumerable<MediaTypeDisplay> GetAllFiltered(string[] aliases)
Parameters
aliasesstring[]Alias of the media type
Returns
- IEnumerable<MediaTypeDisplay>
GetAllowedChildren(Guid)
Returns the allowed child content type objects for the content item id passed in - based on a GUID id
[Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<IEnumerable<ContentTypeBasic>> GetAllowedChildren(Guid contentId)
Parameters
contentIdGuid
Returns
- ActionResult<IEnumerable<ContentTypeBasic>>
GetAllowedChildren(int)
Returns the allowed child content type objects for the content item id passed in - based on an INT id
[Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public IEnumerable<ContentTypeBasic> GetAllowedChildren(int contentId)
Parameters
contentIdint
Returns
- IEnumerable<ContentTypeBasic>
GetAllowedChildren(Udi)
Returns the allowed child content type objects for the content item id passed in - based on a UDI id
[Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<IEnumerable<ContentTypeBasic>> GetAllowedChildren(Udi contentId)
Parameters
contentIdUdi
Returns
- ActionResult<IEnumerable<ContentTypeBasic>>
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
[HttpPost]
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult GetAvailableCompositeMediaTypes(GetAvailableCompositionsFilter filter)
Parameters
filterGetAvailableCompositionsFilterFilter applied when resolving compositions
Returns
GetById(Guid)
Gets the media type a given guid
[Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<MediaTypeDisplay?> GetById(Guid id)
Parameters
idGuid
Returns
- ActionResult<MediaTypeDisplay>
GetById(int)
Gets the media type a given id
[Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<MediaTypeDisplay?> GetById(int id)
Parameters
idint
Returns
- ActionResult<MediaTypeDisplay>
GetById(Udi)
Gets the media type a given udi
[Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<MediaTypeDisplay?> GetById(Udi id)
Parameters
idUdi
Returns
- ActionResult<MediaTypeDisplay>
GetCount()
public int GetCount()
Returns
GetEmpty(int)
[Authorize(Policy = "TreeAccessMediaTypes")]
public MediaTypeDisplay? GetEmpty(int parentId)
Parameters
parentIdint
Returns
- MediaTypeDisplay
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
[HttpPost]
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult GetWhereCompositionIsUsedInContentTypes(GetAvailableCompositionsFilter filter)
Parameters
filterGetAvailableCompositionsFilter
Returns
PostCopy(MoveOrCopy)
Copy the media type
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult PostCopy(MoveOrCopy copy)
Parameters
copyMoveOrCopy
Returns
PostCreateContainer(int, string)
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult PostCreateContainer(int parentId, string name)
Parameters
Returns
PostMove(MoveOrCopy)
Move the media type
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult PostMove(MoveOrCopy move)
Parameters
moveMoveOrCopy
Returns
PostRenameContainer(int, string)
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult PostRenameContainer(int id, string name)
Parameters
Returns
PostSave(MediaTypeSave)
[Authorize(Policy = "TreeAccessMediaTypes")]
public ActionResult<MediaTypeDisplay?> PostSave(MediaTypeSave contentTypeSave)
Parameters
contentTypeSaveMediaTypeSave
Returns
- ActionResult<MediaTypeDisplay>