Class ContentTypeController
- Namespace
- Umbraco.Cms.Web.BackOffice.Controllers
- Assembly
- Umbraco.Web.BackOffice.dll
An API controller used for dealing with content types
public class ContentTypeController : ContentTypeControllerBase<IContentType>
- Inheritance
-
ContentTypeControllerBase<IContentType>ContentTypeController
- Inherited Members
Constructors
ContentTypeController(ICultureDictionary, IContentTypeService, IMediaTypeService, IMemberTypeService, IUmbracoMapper, ILocalizedTextService, IEntityXmlSerializer, PropertyEditorCollection, IBackOfficeSecurityAccessor, IDataTypeService, IShortStringHelper, IFileService, ILogger<ContentTypeController>, IContentService, IContentTypeBaseServiceProvider, IHostingEnvironment, EditorValidatorCollection, PackageDataInstallation)
[Obsolete("Use constructor that takes BlockGridSampleHelper as a parameter")]
public ContentTypeController(ICultureDictionary cultureDictionary, IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService, IUmbracoMapper umbracoMapper, ILocalizedTextService localizedTextService, IEntityXmlSerializer serializer, PropertyEditorCollection propertyEditors, IBackOfficeSecurityAccessor backofficeSecurityAccessor, IDataTypeService dataTypeService, IShortStringHelper shortStringHelper, IFileService fileService, ILogger<ContentTypeController> logger, IContentService contentService, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, IHostingEnvironment hostingEnvironment, EditorValidatorCollection editorValidatorCollection, PackageDataInstallation packageDataInstallation)
Parameters
cultureDictionaryICultureDictionarycontentTypeServiceIContentTypeServicemediaTypeServiceIMediaTypeServicememberTypeServiceIMemberTypeServiceumbracoMapperIUmbracoMapperlocalizedTextServiceILocalizedTextServiceserializerIEntityXmlSerializerpropertyEditorsPropertyEditorCollectionbackofficeSecurityAccessorIBackOfficeSecurityAccessordataTypeServiceIDataTypeServiceshortStringHelperIShortStringHelperfileServiceIFileServiceloggerILogger<ContentTypeController>contentServiceIContentServicecontentTypeBaseServiceProviderIContentTypeBaseServiceProviderhostingEnvironmentIHostingEnvironmenteditorValidatorCollectionEditorValidatorCollectionpackageDataInstallationPackageDataInstallation
ContentTypeController(ICultureDictionary, IContentTypeService, IMediaTypeService, IMemberTypeService, IUmbracoMapper, ILocalizedTextService, IEntityXmlSerializer, PropertyEditorCollection, IBackOfficeSecurityAccessor, IDataTypeService, IShortStringHelper, IFileService, ILogger<ContentTypeController>, IContentService, IContentTypeBaseServiceProvider, IHostingEnvironment, EditorValidatorCollection, PackageDataInstallation, BlockGridSampleHelper)
[Obsolete("Please use constructor that takes an ICoreScopeProvider")]
public ContentTypeController(ICultureDictionary cultureDictionary, IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService, IUmbracoMapper umbracoMapper, ILocalizedTextService localizedTextService, IEntityXmlSerializer serializer, PropertyEditorCollection propertyEditors, IBackOfficeSecurityAccessor backofficeSecurityAccessor, IDataTypeService dataTypeService, IShortStringHelper shortStringHelper, IFileService fileService, ILogger<ContentTypeController> logger, IContentService contentService, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, IHostingEnvironment hostingEnvironment, EditorValidatorCollection editorValidatorCollection, PackageDataInstallation packageDataInstallation, BlockGridSampleHelper blockGridSampleHelper)
Parameters
cultureDictionaryICultureDictionarycontentTypeServiceIContentTypeServicemediaTypeServiceIMediaTypeServicememberTypeServiceIMemberTypeServiceumbracoMapperIUmbracoMapperlocalizedTextServiceILocalizedTextServiceserializerIEntityXmlSerializerpropertyEditorsPropertyEditorCollectionbackofficeSecurityAccessorIBackOfficeSecurityAccessordataTypeServiceIDataTypeServiceshortStringHelperIShortStringHelperfileServiceIFileServiceloggerILogger<ContentTypeController>contentServiceIContentServicecontentTypeBaseServiceProviderIContentTypeBaseServiceProviderhostingEnvironmentIHostingEnvironmenteditorValidatorCollectionEditorValidatorCollectionpackageDataInstallationPackageDataInstallationblockGridSampleHelperBlockGridSampleHelper
ContentTypeController(ICultureDictionary, IContentTypeService, IMediaTypeService, IMemberTypeService, IUmbracoMapper, ILocalizedTextService, IEntityXmlSerializer, PropertyEditorCollection, IBackOfficeSecurityAccessor, IDataTypeService, IShortStringHelper, IFileService, ILogger<ContentTypeController>, IContentService, IContentTypeBaseServiceProvider, IHostingEnvironment, EditorValidatorCollection, PackageDataInstallation, BlockGridSampleHelper, ICoreScopeProvider)
[ActivatorUtilitiesConstructor]
public ContentTypeController(ICultureDictionary cultureDictionary, IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService, IUmbracoMapper umbracoMapper, ILocalizedTextService localizedTextService, IEntityXmlSerializer serializer, PropertyEditorCollection propertyEditors, IBackOfficeSecurityAccessor backofficeSecurityAccessor, IDataTypeService dataTypeService, IShortStringHelper shortStringHelper, IFileService fileService, ILogger<ContentTypeController> logger, IContentService contentService, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, IHostingEnvironment hostingEnvironment, EditorValidatorCollection editorValidatorCollection, PackageDataInstallation packageDataInstallation, BlockGridSampleHelper blockGridSampleHelper, ICoreScopeProvider coreScopeProvider)
Parameters
cultureDictionaryICultureDictionarycontentTypeServiceIContentTypeServicemediaTypeServiceIMediaTypeServicememberTypeServiceIMemberTypeServiceumbracoMapperIUmbracoMapperlocalizedTextServiceILocalizedTextServiceserializerIEntityXmlSerializerpropertyEditorsPropertyEditorCollectionbackofficeSecurityAccessorIBackOfficeSecurityAccessordataTypeServiceIDataTypeServiceshortStringHelperIShortStringHelperfileServiceIFileServiceloggerILogger<ContentTypeController>contentServiceIContentServicecontentTypeBaseServiceProviderIContentTypeBaseServiceProviderhostingEnvironmentIHostingEnvironmenteditorValidatorCollectionEditorValidatorCollectionpackageDataInstallationPackageDataInstallationblockGridSampleHelperBlockGridSampleHelpercoreScopeProviderICoreScopeProvider
Methods
AllowsCultureVariation()
Returns true if any content types have culture variation enabled
[HttpGet]
[Authorize(Policy = "BackOfficeAccess")]
public bool AllowsCultureVariation()
Returns
DeleteById(int)
Deletes a document type with a given ID
[HttpDelete]
[HttpPost]
[Authorize(Policy = "TreeAccessDocumentTypes")]
public IActionResult DeleteById(int id)
Parameters
idint
Returns
DeleteContainer(int)
Deletes a document type container with a given ID
[HttpDelete]
[HttpPost]
[Authorize(Policy = "TreeAccessDocumentTypes")]
public IActionResult DeleteContainer(int id)
Parameters
idint
Returns
Export(int)
[HttpGet]
[Authorize(Policy = "TreeAccessDocumentTypes")]
public IActionResult Export(int id)
Parameters
idint
Returns
GetAll()
Returns all content type objects
[Authorize(Policy = "TreeAccessDocumentsOrDocumentTypes")]
public IEnumerable<ContentTypeBasic> GetAll()
Returns
- IEnumerable<ContentTypeBasic>
GetAllPropertyTypeAliases()
Gets all user defined properties.
[Authorize(Policy = "TreeAccessAnyContentOrTypes")]
public IEnumerable<string> GetAllPropertyTypeAliases()
Returns
GetAllStandardFields()
Gets all the standard fields.
[Authorize(Policy = "TreeAccessAnyContentOrTypes")]
public IEnumerable<string> GetAllStandardFields()
Returns
GetAllowedChildren(int)
Returns the allowed child content type objects for the content item id passed in
[Authorize(Policy = "TreeAccessDocumentsOrDocumentTypes")]
public IEnumerable<ContentTypeBasic> GetAllowedChildren(int contentId)
Parameters
contentIdint
Returns
- IEnumerable<ContentTypeBasic>
GetAvailableCompositeContentTypes(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 = "TreeAccessDocumentTypes")]
public ActionResult GetAvailableCompositeContentTypes(GetAvailableCompositionsFilter filter)
Parameters
filterGetAvailableCompositionsFilter
Returns
GetById(Guid)
Gets the document type a given guid
[Authorize(Policy = "TreeAccessDocumentTypes")]
public ActionResult<DocumentTypeDisplay?> GetById(Guid id)
Parameters
idGuid
Returns
- ActionResult<DocumentTypeDisplay>
GetById(int)
Gets the document type a given id
[Authorize(Policy = "TreeAccessDocumentTypes")]
public ActionResult<DocumentTypeDisplay?> GetById(int id)
Parameters
idint
Returns
- ActionResult<DocumentTypeDisplay>
GetById(Udi)
Gets the document type a given udi
[Authorize(Policy = "TreeAccessDocumentTypes")]
public ActionResult<DocumentTypeDisplay?> GetById(Udi id)
Parameters
idUdi
Returns
- ActionResult<DocumentTypeDisplay>
GetCount()
[Authorize(Policy = "TreeAccessDocumentTypes")]
public int GetCount()
Returns
GetEmpty(int)
Returns an empty content type for use as a scaffold when creating a new type
[Authorize(Policy = "TreeAccessDocumentTypes")]
public DocumentTypeDisplay? GetEmpty(int parentId)
Parameters
parentIdint
Returns
- DocumentTypeDisplay
GetPropertyTypeScaffold(int)
[Authorize(Policy = "TreeAccessAnyContentOrTypes")]
public ActionResult<ContentPropertyDisplay> GetPropertyTypeScaffold(int id)
Parameters
idint
Returns
- ActionResult<ContentPropertyDisplay>
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 = "TreeAccessDocumentTypes")]
public IActionResult GetWhereCompositionIsUsedInContentTypes(GetAvailableCompositionsFilter filter)
Parameters
filterGetAvailableCompositionsFilter
Returns
HasContentNodes(int)
[HttpGet]
[Authorize(Policy = "TreeAccessDocumentTypes")]
public bool HasContentNodes(int id)
Parameters
idint
Returns
Import(string)
[HttpPost]
[Authorize(Policy = "TreeAccessDocumentTypes")]
public IActionResult Import(string file)
Parameters
filestring
Returns
PostCopy(MoveOrCopy)
Copy the content type
[Authorize(Policy = "TreeAccessDocumentTypes")]
public IActionResult PostCopy(MoveOrCopy copy)
Parameters
copyMoveOrCopy
Returns
PostCreateBlockGridSample()
[Authorize(Policy = "TreeAccessDocumentTypes")]
public ActionResult PostCreateBlockGridSample()
Returns
PostCreateContainer(int, string)
[Authorize(Policy = "TreeAccessDocumentTypes")]
public IActionResult PostCreateContainer(int parentId, string name)
Parameters
Returns
PostCreateDefaultTemplate(int)
[Authorize(Policy = "TreeAccessDocumentTypes")]
public ActionResult<TemplateDisplay?> PostCreateDefaultTemplate(int id)
Parameters
idint
Returns
- ActionResult<TemplateDisplay>
PostMove(MoveOrCopy)
Move the content type
[Authorize(Policy = "TreeAccessDocumentTypes")]
public IActionResult PostMove(MoveOrCopy move)
Parameters
moveMoveOrCopy
Returns
PostRenameContainer(int, string)
[Authorize(Policy = "TreeAccessDocumentTypes")]
public IActionResult PostRenameContainer(int id, string name)
Parameters
Returns
PostSave(DocumentTypeSave)
[Authorize(Policy = "TreeAccessDocumentTypes")]
public ActionResult<DocumentTypeDisplay?> PostSave(DocumentTypeSave contentTypeSave)
Parameters
contentTypeSaveDocumentTypeSave
Returns
- ActionResult<DocumentTypeDisplay>
Upload(List<IFormFile>)
[HttpPost]
[Authorize(Policy = "TreeAccessDocumentTypes")]
public ActionResult<ContentTypeImportModel> Upload(List<IFormFile> file)
Parameters
Returns
- ActionResult<ContentTypeImportModel>