View Source
Class ContentTypeControllerBase<TContentType>
Am abstract API controller providing functionality used for dealing with content and media types
Inheritance
System.Object
Assembly: Umbraco.Web.dll
Syntax
[PluginController("UmbracoApi")]
public abstract class ContentTypeControllerBase<TContentType> : UmbracoAuthorizedJsonController, IDiscoverable where TContentType : class, IContentTypeComposition
Type Parameters
Name |
Description |
TContentType |
|
Constructors
View Source
ContentTypeControllerBase(ICultureDictionaryFactory, IGlobalSettings, IUmbracoContextAccessor, ISqlContext, ServiceContext, AppCaches, IProfilingLogger, IRuntimeState, UmbracoHelper)
Declaration
protected ContentTypeControllerBase(ICultureDictionaryFactory cultureDictionaryFactory, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper)
Parameters
Methods
View Source
PerformCopy(MoveOrCopy, Func<Int32, TContentType>, Func<TContentType, Int32, Attempt<OperationResult<MoveOperationStatusType, TContentType>>>)
Declaration
protected HttpResponseMessage PerformCopy(MoveOrCopy move, Func<int, TContentType> getContentType, Func<TContentType, int, Attempt<OperationResult<MoveOperationStatusType, TContentType>>> doCopy)
Parameters
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
PerformGetAvailableCompositeContentTypes(Int32, UmbracoObjectTypes, String[], String[], Boolean)
Returns the available composite content types for a given content type
Declaration
protected 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 |
System.Collections.Generic.IEnumerable<System.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 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 |
System.Collections.Generic.IEnumerable<EntityBasic> |
|
View Source
PerformMove(MoveOrCopy, Func<Int32, TContentType>, Func<TContentType, Int32, Attempt<OperationResult<MoveOperationStatusType>>>)
Declaration
protected HttpResponseMessage PerformMove(MoveOrCopy move, Func<int, TContentType> getContentType, Func<TContentType, int, Attempt<OperationResult<MoveOperationStatusType>>> doMove)
Parameters
Returns
Type |
Description |
HttpResponseMessage |
|
View Source
PerformPostSave<TContentTypeDisplay, TContentTypeSave, TPropertyType>(TContentTypeSave, Func<Int32, TContentType>, Action<TContentType>, Action<TContentTypeSave>)
Declaration
protected 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 |
|
System.Func<System.Int32, TContentType> |
getContentType |
|
System.Action<TContentType> |
saveContentType |
|
System.Action<TContentTypeSave> |
beforeCreateNew |
|
Returns
Type |
Description |
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 |
|