Search Results for

    Show / Hide Table of Contents
    View Source

    Class DataTypeController

    The API controller used for editing data types

    Inheritance
    System.Object
    Microsoft.AspNetCore.Mvc.ControllerBase
    UmbracoApiControllerBase
    UmbracoApiController
    UmbracoAuthorizedApiController
    UmbracoAuthorizedJsonController
    BackOfficeNotificationsController
    Namespace: Umbraco.Cms.Web.BackOffice.Controllers
    Assembly: Umbraco.Web.BackOffice.dll
    Syntax
    [PluginController("UmbracoApi")]
    [Authorize(Policy = "TreeAccessDocumentsOrDocumentTypes")]
    public class DataTypeController : BackOfficeNotificationsController, IUmbracoFeature, IDiscoverable
    Remarks

    The security for this controller is defined to allow full CRUD access to data types if the user has access to either: Content Types, Member Types or Media Types ... and of course to Data Types

    Constructors

    View Source

    DataTypeController(PropertyEditorCollection, IDataTypeService, IOptionsSnapshot<ContentSettings>, IUmbracoMapper, PropertyEditorCollection, IContentTypeService, IMediaTypeService, IMemberTypeService, ILocalizedTextService, IBackOfficeSecurityAccessor, IConfigurationEditorJsonSerializer)

    Declaration
    [Obsolete("Use constructor that takes IDataTypeUsageService, scheduled for removal in V12")]
    public DataTypeController(PropertyEditorCollection propertyEditors, IDataTypeService dataTypeService, IOptionsSnapshot<ContentSettings> contentSettings, IUmbracoMapper umbracoMapper, PropertyEditorCollection propertyEditorCollection, IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService, ILocalizedTextService localizedTextService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor, IConfigurationEditorJsonSerializer serializer)
    Parameters
    Type Name Description
    PropertyEditorCollection propertyEditors
    IDataTypeService dataTypeService
    Microsoft.Extensions.Options.IOptionsSnapshot<ContentSettings> contentSettings
    IUmbracoMapper umbracoMapper
    PropertyEditorCollection propertyEditorCollection
    IContentTypeService contentTypeService
    IMediaTypeService mediaTypeService
    IMemberTypeService memberTypeService
    ILocalizedTextService localizedTextService
    IBackOfficeSecurityAccessor backOfficeSecurityAccessor
    IConfigurationEditorJsonSerializer serializer
    View Source

    DataTypeController(PropertyEditorCollection, IDataTypeService, IOptionsSnapshot<ContentSettings>, IUmbracoMapper, PropertyEditorCollection, IContentTypeService, IMediaTypeService, IMemberTypeService, ILocalizedTextService, IBackOfficeSecurityAccessor, IConfigurationEditorJsonSerializer, IDataTypeUsageService)

    Declaration
    [ActivatorUtilitiesConstructor]
    public DataTypeController(PropertyEditorCollection propertyEditors, IDataTypeService dataTypeService, IOptionsSnapshot<ContentSettings> contentSettings, IUmbracoMapper umbracoMapper, PropertyEditorCollection propertyEditorCollection, IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService, ILocalizedTextService localizedTextService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor, IConfigurationEditorJsonSerializer serializer, IDataTypeUsageService dataTypeUsageService)
    Parameters
    Type Name Description
    PropertyEditorCollection propertyEditors
    IDataTypeService dataTypeService
    Microsoft.Extensions.Options.IOptionsSnapshot<ContentSettings> contentSettings
    IUmbracoMapper umbracoMapper
    PropertyEditorCollection propertyEditorCollection
    IContentTypeService contentTypeService
    IMediaTypeService mediaTypeService
    IMemberTypeService memberTypeService
    ILocalizedTextService localizedTextService
    IBackOfficeSecurityAccessor backOfficeSecurityAccessor
    IConfigurationEditorJsonSerializer serializer
    IDataTypeUsageService dataTypeUsageService

    Methods

    View Source

    DeleteById(Int32)

    Deletes a data type with a given ID

    Declaration
    [HttpDelete]
    [HttpPost]
    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 data type container with a given ID

    Declaration
    [HttpDelete]
    [HttpPost]
    public IActionResult DeleteContainer(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.IActionResult
    View Source

    GetAll()

    Gets the content json for all data types

    Declaration
    [Authorize(Policy = "SectionAccessForDataTypeReading")]
    public IEnumerable<DataTypeBasic> GetAll()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<DataTypeBasic>
    Remarks

    Permission is granted to this method if the user has access to any of these sections: Content, media, settings, developer, members

    View Source

    GetAllPropertyEditors()

    Gets all property editors defined

    Declaration
    [Authorize(Policy = "SectionAccessForDataTypeReading")]
    public IEnumerable<PropertyEditorBasic> GetAllPropertyEditors()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<PropertyEditorBasic>
    Remarks

    Permission is granted to this method if the user has access to any of these sections: Content, media, settings, developer, members

    View Source

    GetById(Guid)

    Gets the datatype json for the datatype guid

    Declaration
    public ActionResult<DataTypeDisplay> GetById(Guid id)
    Parameters
    Type Name Description
    System.Guid id
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.ActionResult<DataTypeDisplay>
    View Source

    GetById(Int32)

    Gets the datatype json for the datatype id

    Declaration
    public ActionResult<DataTypeDisplay> GetById(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.ActionResult<DataTypeDisplay>
    View Source

    GetById(Udi)

    Gets the datatype json for the datatype udi

    Declaration
    public ActionResult<DataTypeDisplay> GetById(Udi id)
    Parameters
    Type Name Description
    Udi id
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.ActionResult<DataTypeDisplay>
    View Source

    GetByName(String)

    Gets data type by name

    Declaration
    public DataTypeDisplay GetByName(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    DataTypeDisplay
    View Source

    GetCustomListView(String)

    Returns a custom listview, based on a content type alias, if found

    Declaration
    public ActionResult<DataTypeDisplay> GetCustomListView(string contentTypeAlias)
    Parameters
    Type Name Description
    System.String contentTypeAlias
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.ActionResult<DataTypeDisplay>

    a DataTypeDisplay

    View Source

    GetEmpty(Int32)

    Declaration
    public DataTypeDisplay GetEmpty(int parentId)
    Parameters
    Type Name Description
    System.Int32 parentId
    Returns
    Type Description
    DataTypeDisplay
    View Source

    GetGroupedDataTypes()

    Returns all data types grouped by their property editor group

    Declaration
    [Authorize(Policy = "SectionAccessForDataTypeReading")]
    public IDictionary<string, IEnumerable<DataTypeBasic>> GetGroupedDataTypes()
    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.String, System.Collections.Generic.IEnumerable<DataTypeBasic>>
    Remarks

    Permission is granted to this method if the user has access to any of these sections: Content, media, settings, developer, members

    View Source

    GetGroupedPropertyEditors()

    Returns all property editors grouped

    Declaration
    [Authorize(Policy = "SectionAccessForDataTypeReading")]
    public IDictionary<string, IEnumerable<DataTypeBasic>> GetGroupedPropertyEditors()
    Returns
    Type Description
    System.Collections.Generic.IDictionary<System.String, System.Collections.Generic.IEnumerable<DataTypeBasic>>
    Remarks

    Permission is granted to this method if the user has access to any of these sections: Content, media, settings, developer, members

    View Source

    GetPreValues(String, Int32)

    Returns the pre-values for the specified property editor

    Declaration
    public ActionResult<IEnumerable<DataTypeConfigurationFieldDisplay>> GetPreValues(string editorAlias, int dataTypeId = -1)
    Parameters
    Type Name Description
    System.String editorAlias
    System.Int32 dataTypeId

    The data type id for the pre-values, -1 if it is a new data type

    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.ActionResult<System.Collections.Generic.IEnumerable<DataTypeConfigurationFieldDisplay>>
    View Source

    GetReferences(Int32)

    Returns the references (usages) for the data type

    Declaration
    public DataTypeReferences GetReferences(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    DataTypeReferences
    View Source

    HasValues(Int32)

    Declaration
    [HttpGet]
    public ActionResult<DataTypeHasValuesDisplay> HasValues(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.ActionResult<DataTypeHasValuesDisplay>
    View Source

    PostCopy(MoveOrCopy)

    Declaration
    public IActionResult PostCopy(MoveOrCopy copy)
    Parameters
    Type Name Description
    MoveOrCopy copy
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.IActionResult
    View Source

    PostCreateContainer(Int32, String)

    Declaration
    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

    PostCreateCustomListView(String)

    Creates a custom list view - give a document type alias

    Declaration
    public DataTypeDisplay PostCreateCustomListView(string contentTypeAlias)
    Parameters
    Type Name Description
    System.String contentTypeAlias
    Returns
    Type Description
    DataTypeDisplay
    View Source

    PostMove(MoveOrCopy)

    Move the media type

    Declaration
    public IActionResult PostMove(MoveOrCopy move)
    Parameters
    Type Name Description
    MoveOrCopy move
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.IActionResult
    View Source

    PostRenameContainer(Int32, String)

    Declaration
    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(DataTypeSave)

    Saves the data type

    Declaration
    public ActionResult<DataTypeDisplay> PostSave(DataTypeSave dataType)
    Parameters
    Type Name Description
    DataTypeSave dataType
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.ActionResult<DataTypeDisplay>
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • DataTypeController(PropertyEditorCollection, IDataTypeService, IOptionsSnapshot<ContentSettings>, IUmbracoMapper, PropertyEditorCollection, IContentTypeService, IMediaTypeService, IMemberTypeService, ILocalizedTextService, IBackOfficeSecurityAccessor, IConfigurationEditorJsonSerializer)
      • DataTypeController(PropertyEditorCollection, IDataTypeService, IOptionsSnapshot<ContentSettings>, IUmbracoMapper, PropertyEditorCollection, IContentTypeService, IMediaTypeService, IMemberTypeService, ILocalizedTextService, IBackOfficeSecurityAccessor, IConfigurationEditorJsonSerializer, IDataTypeUsageService)
    • Methods
      • DeleteById(Int32)
      • DeleteContainer(Int32)
      • GetAll()
      • GetAllPropertyEditors()
      • GetById(Guid)
      • GetById(Int32)
      • GetById(Udi)
      • GetByName(String)
      • GetCustomListView(String)
      • GetEmpty(Int32)
      • GetGroupedDataTypes()
      • GetGroupedPropertyEditors()
      • GetPreValues(String, Int32)
      • GetReferences(Int32)
      • HasValues(Int32)
      • PostCopy(MoveOrCopy)
      • PostCreateContainer(Int32, String)
      • PostCreateCustomListView(String)
      • PostMove(MoveOrCopy)
      • PostRenameContainer(Int32, String)
      • PostSave(DataTypeSave)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX