Class ContentTypeControllerBase<TContentType>
- Namespace
- Umbraco.Cms.Web.BackOffice.Controllers
- Assembly
- Umbraco.Web.BackOffice.dll
Am abstract API controller providing functionality used for dealing with content and media types
[PrefixlessBodyModelValidator]
public abstract class ContentTypeControllerBase<TContentType> : BackOfficeNotificationsController where TContentType : class, IContentTypeComposition
Type Parameters
TContentType
- Inheritance
-
ContentTypeControllerBase<TContentType>
- Derived
- Inherited Members
Constructors
ContentTypeControllerBase(ICultureDictionary, EditorValidatorCollection, IContentTypeService, IMediaTypeService, IMemberTypeService, IUmbracoMapper, ILocalizedTextService)
protected ContentTypeControllerBase(ICultureDictionary cultureDictionary, EditorValidatorCollection editorValidatorCollection, IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService, IUmbracoMapper umbracoMapper, ILocalizedTextService localizedTextService)
Parameters
cultureDictionaryICultureDictionaryeditorValidatorCollectionEditorValidatorCollectioncontentTypeServiceIContentTypeServicemediaTypeServiceIMediaTypeServicememberTypeServiceIMemberTypeServiceumbracoMapperIUmbracoMapperlocalizedTextServiceILocalizedTextService
Properties
ContentTypeService
public IContentTypeService ContentTypeService { get; }
Property Value
- IContentTypeService
CultureDictionary
protected ICultureDictionary CultureDictionary { get; }
Property Value
- ICultureDictionary
LocalizedTextService
public ILocalizedTextService LocalizedTextService { get; }
Property Value
- ILocalizedTextService
MediaTypeService
public IMediaTypeService MediaTypeService { get; }
Property Value
- IMediaTypeService
MemberTypeService
public IMemberTypeService MemberTypeService { get; }
Property Value
- IMemberTypeService
UmbracoMapper
public IUmbracoMapper UmbracoMapper { get; }
Property Value
- IUmbracoMapper
Methods
GetContentTypeService<T>()
public IContentTypeBaseService<T>? GetContentTypeService<T>() where T : IContentTypeComposition
Returns
- IContentTypeBaseService<T>
Type Parameters
T
PerformCopy(MoveOrCopy, Func<int, TContentType?>, Func<TContentType, int, Attempt<OperationResult<MoveOperationStatusType, TContentType>>>)
Move
protected IActionResult PerformCopy(MoveOrCopy move, Func<int, TContentType?> getContentType, Func<TContentType, int, Attempt<OperationResult<MoveOperationStatusType, TContentType>>> doCopy)
Parameters
moveMoveOrCopygetContentTypeFunc<int, TContentType>doCopyFunc<TContentType, int, Attempt<OperationResult<MoveOperationStatusType, TContentType>>>
Returns
PerformGetAvailableCompositeContentTypes(int, UmbracoObjectTypes, string[]?, string[]?, bool)
Returns the available composite content types for a given content type
protected ActionResult<IEnumerable<Tuple<EntityBasic?, bool>>> PerformGetAvailableCompositeContentTypes(int contentTypeId, UmbracoObjectTypes type, string[]? filterContentTypes, string[]? filterPropertyTypes, bool isElement)
Parameters
contentTypeIdinttypeUmbracoObjectTypesfilterContentTypesstring[]This is normally an empty list but if additional content type aliases are passed in, any content types containing those aliases will be filtered out along with any content types that have matching property types that are included in the filtered content types
filterPropertyTypesstring[]This is normally an empty list but if additional property type aliases are passed in, any content types that have these aliases will be filtered out. This is required because in the case of creating/modifying a content type because new property types being added to it are not yet persisted so cannot be looked up via the db, they need to be passed in.
isElementboolWhether the composite content types should be applicable for an element type
Returns
- ActionResult<IEnumerable<Tuple<EntityBasic, bool>>>
PerformGetWhereCompositionIsUsedInContentTypes(int, UmbracoObjectTypes)
Returns a list of content types where a particular composition content type is used
protected ActionResult<IEnumerable<EntityBasic>> PerformGetWhereCompositionIsUsedInContentTypes(int contentTypeId, UmbracoObjectTypes type)
Parameters
contentTypeIdintId of composition content type
typeUmbracoObjectTypesType of content Type, eg documentType or mediaType
Returns
- ActionResult<IEnumerable<EntityBasic>>
PerformMove(MoveOrCopy, Func<int, TContentType?>, Func<TContentType, int, Attempt<OperationResult<MoveOperationStatusType>>>)
Move
protected IActionResult PerformMove(MoveOrCopy move, Func<int, TContentType?> getContentType, Func<TContentType, int, Attempt<OperationResult<MoveOperationStatusType>>> doMove)
Parameters
moveMoveOrCopygetContentTypeFunc<int, TContentType>doMoveFunc<TContentType, int, Attempt<OperationResult<MoveOperationStatusType>>>
Returns
PerformPostSave<TContentTypeDisplay, TContentTypeSave, TPropertyType>(TContentTypeSave, Func<int, TContentType?>, Action<TContentType?>, Action<TContentTypeSave>?)
protected ActionResult<TContentType?> PerformPostSave<TContentTypeDisplay, TContentTypeSave, TPropertyType>(TContentTypeSave contentTypeSave, Func<int, TContentType?> getContentType, Action<TContentType?> saveContentType, Action<TContentTypeSave>? beforeCreateNew = null) where TContentTypeDisplay : ContentTypeCompositionDisplay where TContentTypeSave : ContentTypeSave<TPropertyType> where TPropertyType : PropertyTypeBasic
Parameters
contentTypeSaveTContentTypeSavegetContentTypeFunc<int, TContentType>saveContentTypeAction<TContentType>beforeCreateNewAction<TContentTypeSave>
Returns
- ActionResult<TContentType>
Type Parameters
TContentTypeDisplayTContentTypeSaveTPropertyType
TranslateItem(string?)
protected string? TranslateItem(string? text)
Parameters
textstring