Search Results for

    Show / Hide Table of Contents
    View Source

    Class MediaTypeController

    An API controller used for dealing with content types

    Inheritance
    System.Object
    Microsoft.AspNetCore.Mvc.ControllerBase
    UmbracoApiControllerBase
    UmbracoApiController
    UmbracoAuthorizedApiController
    UmbracoAuthorizedJsonController
    BackOfficeNotificationsController
    ContentTypeControllerBase<IMediaType>
    Namespace: Umbraco.Cms.Web.BackOffice.Controllers
    Assembly: Umbraco.Web.BackOffice.dll
    Syntax
    [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
    Type Name Description
    ICultureDictionary cultureDictionary
    EditorValidatorCollection editorValidatorCollection
    IContentTypeService contentTypeService
    IMediaTypeService mediaTypeService
    IMemberTypeService memberTypeService
    IUmbracoMapper umbracoMapper
    ILocalizedTextService localizedTextService
    IShortStringHelper shortStringHelper
    IEntityService entityService
    IMediaService mediaService
    IBackOfficeSecurityAccessor backofficeSecurityAccessor

    Methods

    View Source

    DeleteById(Int32)

    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

    DeleteContainer(Int32)

    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

    GetAll()

    Returns all media types

    Declaration
    [Authorize(Policy = "TreeAccessMediaTypes")]
    public IEnumerable<ContentTypeBasic> GetAll()
    Returns
    Type Description
    IEnumerable<ContentTypeBasic>
    View Source

    GetAllFiltered(String[])

    Returns a media type by alias

    Declaration
    public IEnumerable<MediaTypeDisplay> GetAllFiltered([FromQuery] string[] aliases)
    Parameters
    Type Name Description
    System.String[] aliases
    Returns
    Type Description
    IEnumerable<MediaTypeDisplay>
    View Source

    GetAllowedChildren(Guid)

    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

    GetAllowedChildren(Int32)

    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
    Type Description
    IEnumerable<ContentTypeBasic>
    View Source

    GetAllowedChildren(Udi)

    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
    Type Name Description
    GetAvailableCompositionsFilter filter

    Filter applied when resolving compositions

    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.IActionResult
    View Source

    GetById(Guid)

    Gets the media type a given guid

    Declaration
    [Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
    public ActionResult<MediaTypeDisplay> GetById(Guid id)
    Parameters
    Type Name Description
    Guid id
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.ActionResult<MediaTypeDisplay>
    View Source

    GetById(Int32)

    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
    Type Description
    Microsoft.AspNetCore.Mvc.ActionResult<MediaTypeDisplay>
    View Source

    GetById(Udi)

    Gets the media type a given udi

    Declaration
    [Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
    public ActionResult<MediaTypeDisplay> GetById(Udi id)
    Parameters
    Type Name Description
    Udi id
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.ActionResult<MediaTypeDisplay>
    View Source

    GetCount()

    Declaration
    public int GetCount()
    Returns
    Type Description
    System.Int32
    View Source

    GetEmpty(Int32)

    Declaration
    [Authorize(Policy = "TreeAccessMediaTypes")]
    public MediaTypeDisplay GetEmpty(int parentId)
    Parameters
    Type Name Description
    System.Int32 parentId
    Returns
    Type Description
    MediaTypeDisplay
    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
    Type Name Description
    GetAvailableCompositionsFilter filter
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.IActionResult
    View Source

    PostCopy(MoveOrCopy)

    Copy the media type

    Declaration
    [Authorize(Policy = "TreeAccessMediaTypes")]
    public IActionResult PostCopy(MoveOrCopy copy)
    Parameters
    Type Name Description
    MoveOrCopy copy
    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)

    Move the media type

    Declaration
    [Authorize(Policy = "TreeAccessMediaTypes")]
    public IActionResult PostMove(MoveOrCopy move)
    Parameters
    Type Name Description
    MoveOrCopy move
    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
    Type Name Description
    MediaTypeSave contentTypeSave
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.ActionResult<MediaTypeDisplay>
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • MediaTypeController(ICultureDictionary, EditorValidatorCollection, IContentTypeService, IMediaTypeService, IMemberTypeService, IUmbracoMapper, ILocalizedTextService, IShortStringHelper, IEntityService, IMediaService, IBackOfficeSecurityAccessor)
    • Methods
      • DeleteById(Int32)
      • DeleteContainer(Int32)
      • GetAll()
      • GetAllFiltered(String[])
      • GetAllowedChildren(Guid)
      • GetAllowedChildren(Int32)
      • GetAllowedChildren(Udi)
      • GetAvailableCompositeMediaTypes(GetAvailableCompositionsFilter)
      • GetById(Guid)
      • GetById(Int32)
      • GetById(Udi)
      • GetCount()
      • GetEmpty(Int32)
      • GetWhereCompositionIsUsedInContentTypes(GetAvailableCompositionsFilter)
      • PostCopy(MoveOrCopy)
      • PostCreateContainer(Int32, String)
      • PostMove(MoveOrCopy)
      • PostRenameContainer(Int32, String)
      • PostSave(MediaTypeSave)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX