View Source
Class ContentTypeControllerBase<TContentType>
Am abstract API controller providing functionality used for dealing with content and media types
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Assembly: Umbraco.Web.BackOffice.dll
Syntax
[PluginController("UmbracoApi")]
[PrefixlessBodyModelValidator]
public abstract class ContentTypeControllerBase<TContentType> : BackOfficeNotificationsController, IUmbracoFeature, IDiscoverable where TContentType : class, IContentTypeComposition
Type Parameters
Name |
Description |
TContentType |
|
Constructors
View Source
ContentTypeControllerBase(ICultureDictionary, EditorValidatorCollection, IContentTypeService, IMediaTypeService, IMemberTypeService, IUmbracoMapper, ILocalizedTextService)
Declaration
protected ContentTypeControllerBase(ICultureDictionary cultureDictionary, EditorValidatorCollection editorValidatorCollection, IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService, IUmbracoMapper umbracoMapper, ILocalizedTextService localizedTextService)
Parameters
Properties
View Source
ContentTypeService
Declaration
public IContentTypeService ContentTypeService { get; }
Property Value
View Source
CultureDictionary
Declaration
protected ICultureDictionary CultureDictionary { get; }
Property Value
View Source
LocalizedTextService
Declaration
public ILocalizedTextService LocalizedTextService { get; }
Property Value
View Source
MediaTypeService
Declaration
public IMediaTypeService MediaTypeService { get; }
Property Value
View Source
MemberTypeService
Declaration
public IMemberTypeService MemberTypeService { get; }
Property Value
View Source
UmbracoMapper
Declaration
public IUmbracoMapper UmbracoMapper { get; }
Property Value
Methods
View Source
GetContentTypeService<T>()
Declaration
public IContentTypeBaseService<T> GetContentTypeService<T>()
where T : IContentTypeComposition
Returns
Type Parameters
View Source
PerformCopy(MoveOrCopy, Func<Int32, TContentType>, Func<TContentType, Int32, Attempt<OperationResult<MoveOperationStatusType, TContentType>>>)
Declaration
protected IActionResult PerformCopy(MoveOrCopy move, Func<int, TContentType> getContentType, Func<TContentType, int, Attempt<OperationResult<MoveOperationStatusType, TContentType>>> doCopy)
Parameters
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PerformGetAvailableCompositeContentTypes(Int32, UmbracoObjectTypes, String[], String[], Boolean)
Returns the available composite content types for a given content type
Declaration
protected ActionResult<IEnumerable<Tuple<EntityBasic, bool>>> PerformGetAvailableCompositeContentTypes(int contentTypeId, UmbracoObjectTypes type, string[] filterContentTypes, string[] filterPropertyTypes, bool isElement)
Parameters
Type |
Name |
Description |
System.Int32 |
contentTypeId |
|
UmbracoObjectTypes |
type |
|
System.String[] |
filterContentTypes |
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
|
System.String[] |
filterPropertyTypes |
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.
|
System.Boolean |
isElement |
Whether the composite content types should be applicable for an element type
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<IEnumerable<Tuple<EntityBasic, System.Boolean>>> |
|
View Source
PerformGetWhereCompositionIsUsedInContentTypes(Int32, UmbracoObjectTypes)
Returns a list of content types where a particular composition content type is used
Declaration
protected ActionResult<IEnumerable<EntityBasic>> PerformGetWhereCompositionIsUsedInContentTypes(int contentTypeId, UmbracoObjectTypes type)
Parameters
Type |
Name |
Description |
System.Int32 |
contentTypeId |
Id of composition content type
|
UmbracoObjectTypes |
type |
Type of content Type, eg documentType or mediaType
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<IEnumerable<EntityBasic>> |
|
View Source
PerformMove(MoveOrCopy, Func<Int32, TContentType>, Func<TContentType, Int32, Attempt<OperationResult<MoveOperationStatusType>>>)
Declaration
protected IActionResult PerformMove(MoveOrCopy move, Func<int, TContentType> getContentType, Func<TContentType, int, Attempt<OperationResult<MoveOperationStatusType>>> doMove)
Parameters
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
PerformPostSave<TContentTypeDisplay, TContentTypeSave, TPropertyType>(TContentTypeSave, Func<Int32, TContentType>, Action<TContentType>, Nullable<Action<TContentTypeSave>>)
Declaration
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
Type |
Name |
Description |
TContentTypeSave |
contentTypeSave |
|
Func<System.Int32, TContentType> |
getContentType |
|
Action<TContentType> |
saveContentType |
|
System.Nullable<Action<TContentTypeSave>> |
beforeCreateNew |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<TContentType> |
|
Type Parameters
Name |
Description |
TContentTypeDisplay |
|
TContentTypeSave |
|
TPropertyType |
|
View Source
TranslateItem(String)
Declaration
protected string TranslateItem(string text)
Parameters
Type |
Name |
Description |
System.String |
text |
|
Returns
Type |
Description |
System.String |
|