Interface IContentTypeService
Defines the ContentTypeService, which is an easy access to operations involving IContentType
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
public interface IContentTypeService : IService
Methods
Copy(IContentType, String, String, Int32)
Copies a content type as a child under the specified parent if specified (otherwise to the root)
Declaration
IContentType Copy(IContentType original, string alias, string name, int parentId = -1)
Parameters
Type |
Name |
Description |
IContentType |
original |
The content type to copy
|
System.String |
alias |
The new alias of the content type
|
System.String |
name |
The new name of the content type
|
System.Int32 |
parentId |
The parent to copy the content type to, default is -1 (root)
|
Returns
Copy(IContentType, String, String, IContentType)
Copies a content type as a child under the specified parent if specified (otherwise to the root)
Declaration
IContentType Copy(IContentType original, string alias, string name, IContentType parent)
Parameters
Type |
Name |
Description |
IContentType |
original |
The content type to copy
|
System.String |
alias |
The new alias of the content type
|
System.String |
name |
The new name of the content type
|
IContentType |
parent |
The parent to copy the content type to
|
Returns
CopyContentType(IContentType, Int32)
Declaration
Attempt<OperationStatus<IContentType, MoveOperationStatusType>> CopyContentType(IContentType toCopy, int containerId)
Parameters
Type |
Name |
Description |
IContentType |
toCopy |
|
System.Int32 |
containerId |
|
Returns
CopyMediaType(IMediaType, Int32)
Declaration
Attempt<OperationStatus<IMediaType, MoveOperationStatusType>> CopyMediaType(IMediaType toCopy, int containerId)
Parameters
Type |
Name |
Description |
IMediaType |
toCopy |
|
System.Int32 |
containerId |
|
Returns
CountContentTypes()
Declaration
Returns
Type |
Description |
System.Int32 |
|
CountMediaTypes()
Declaration
Returns
Type |
Description |
System.Int32 |
|
CreateContentTypeContainer(Int32, String, Int32)
Declaration
Attempt<OperationStatus<EntityContainer, OperationStatusType>> CreateContentTypeContainer(int parentId, string name, int userId = 0)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.String |
name |
|
System.Int32 |
userId |
|
Returns
CreateMediaTypeContainer(Int32, String, Int32)
Declaration
Attempt<OperationStatus<EntityContainer, OperationStatusType>> CreateMediaTypeContainer(int parentId, string name, int userId = 0)
Parameters
Type |
Name |
Description |
System.Int32 |
parentId |
|
System.String |
name |
|
System.Int32 |
userId |
|
Returns
Delete(IEnumerable<IContentType>, Int32)
Declaration
void Delete(IEnumerable<IContentType> contentTypes, int userId = 0)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<IContentType> |
contentTypes |
Collection of IContentType to delete
|
System.Int32 |
userId |
Optional Id of the User deleting the ContentTypes
|
Delete(IEnumerable<IMediaType>, Int32)
Declaration
void Delete(IEnumerable<IMediaType> mediaTypes, int userId = 0)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<IMediaType> |
mediaTypes |
Collection of IMediaType to delete
|
System.Int32 |
userId |
Optional Id of the User deleting the MediaTypes
|
Delete(IContentType, Int32)
Declaration
void Delete(IContentType contentType, int userId = 0)
Parameters
Type |
Name |
Description |
IContentType |
contentType |
IContentType to delete
|
System.Int32 |
userId |
Optional Id of the User deleting the ContentType
|
Delete(IMediaType, Int32)
Declaration
void Delete(IMediaType mediaType, int userId = 0)
Parameters
Type |
Name |
Description |
IMediaType |
mediaType |
IMediaType to delete
|
System.Int32 |
userId |
Optional Id of the User deleting the MediaType
|
DeleteContentTypeContainer(Int32, Int32)
Declaration
Attempt<OperationStatus> DeleteContentTypeContainer(int containerId, int userId = 0)
Parameters
Type |
Name |
Description |
System.Int32 |
containerId |
|
System.Int32 |
userId |
|
Returns
DeleteMediaTypeContainer(Int32, Int32)
Declaration
Attempt<OperationStatus> DeleteMediaTypeContainer(int folderId, int userId = 0)
Parameters
Type |
Name |
Description |
System.Int32 |
folderId |
|
System.Int32 |
userId |
|
Returns
GetAllContentTypeAliases(Guid[])
Gets all content type aliases
Declaration
IEnumerable<string> GetAllContentTypeAliases(params Guid[] objectTypes)
Parameters
Type |
Name |
Description |
System.Guid[] |
objectTypes |
If this list is empty, it will return all content type aliases for media, members and content, otherwise
it will only return content type aliases for the object types specified
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
GetAllContentTypeIds(String[])
Returns all content type Ids for the aliases given
Declaration
IEnumerable<int> GetAllContentTypeIds(string[] aliases)
Parameters
Type |
Name |
Description |
System.String[] |
aliases |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Int32> |
|
GetAllContentTypes(IEnumerable<Guid>)
Declaration
IEnumerable<IContentType> GetAllContentTypes(IEnumerable<Guid> ids)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Guid> |
ids |
Optional list of ids
|
Returns
GetAllContentTypes(Int32[])
Declaration
IEnumerable<IContentType> GetAllContentTypes(params int[] ids)
Parameters
Type |
Name |
Description |
System.Int32[] |
ids |
Optional list of ids
|
Returns
GetAllMediaTypes(IEnumerable<Guid>)
Declaration
IEnumerable<IMediaType> GetAllMediaTypes(IEnumerable<Guid> ids)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Guid> |
ids |
Optional list of ids
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IMediaType> |
An Enumerable list of IMediaType objects
|
GetAllMediaTypes(Int32[])
Declaration
IEnumerable<IMediaType> GetAllMediaTypes(params int[] ids)
Parameters
Type |
Name |
Description |
System.Int32[] |
ids |
Optional list of ids
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IMediaType> |
An Enumerable list of IMediaType objects
|
GetAllPropertyTypeAliases()
Gets all property type aliases.
Declaration
IEnumerable<string> GetAllPropertyTypeAliases()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
GetContentType(Guid)
Declaration
IContentType GetContentType(Guid id)
Parameters
Type |
Name |
Description |
System.Guid |
id |
Alias of the IContentType to retrieve
|
Returns
GetContentType(Int32)
Declaration
IContentType GetContentType(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
Id of the IContentType to retrieve
|
Returns
GetContentType(String)
Declaration
IContentType GetContentType(string alias)
Parameters
Type |
Name |
Description |
System.String |
alias |
Alias of the IContentType to retrieve
|
Returns
GetContentTypeChildren(Guid)
Declaration
IEnumerable<IContentType> GetContentTypeChildren(Guid id)
Parameters
Type |
Name |
Description |
System.Guid |
id |
Id of the Parent
|
Returns
GetContentTypeChildren(Int32)
Declaration
IEnumerable<IContentType> GetContentTypeChildren(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
Id of the Parent
|
Returns
GetContentTypeContainer(Guid)
Declaration
EntityContainer GetContentTypeContainer(Guid containerId)
Parameters
Type |
Name |
Description |
System.Guid |
containerId |
|
Returns
GetContentTypeContainer(Int32)
Declaration
EntityContainer GetContentTypeContainer(int containerId)
Parameters
Type |
Name |
Description |
System.Int32 |
containerId |
|
Returns
GetContentTypeContainers(Int32[])
Declaration
IEnumerable<EntityContainer> GetContentTypeContainers(int[] containerIds)
Parameters
Type |
Name |
Description |
System.Int32[] |
containerIds |
|
Returns
GetContentTypeContainers(String, Int32)
Declaration
IEnumerable<EntityContainer> GetContentTypeContainers(string folderName, int level)
Parameters
Type |
Name |
Description |
System.String |
folderName |
|
System.Int32 |
level |
|
Returns
GetContentTypeContainers(IContentType)
Declaration
IEnumerable<EntityContainer> GetContentTypeContainers(IContentType contentType)
Parameters
Returns
GetContentTypesDtd()
Generates the complete XML DTD without the root.
Declaration
string GetContentTypesDtd()
Returns
Type |
Description |
System.String |
The DTD as a string
|
GetDtd()
Generates the complete (simplified) XML DTD.
Declaration
Returns
Type |
Description |
System.String |
The DTD as a string
|
GetMediaType(Guid)
Declaration
IMediaType GetMediaType(Guid id)
Parameters
Type |
Name |
Description |
System.Guid |
id |
Id of the IMediaType to retrieve
|
Returns
GetMediaType(Int32)
Declaration
IMediaType GetMediaType(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
Id of the IMediaType to retrieve
|
Returns
GetMediaType(String)
Declaration
IMediaType GetMediaType(string alias)
Parameters
Type |
Name |
Description |
System.String |
alias |
Alias of the IMediaType to retrieve
|
Returns
GetMediaTypeChildren(Guid)
Declaration
IEnumerable<IMediaType> GetMediaTypeChildren(Guid id)
Parameters
Type |
Name |
Description |
System.Guid |
id |
Id of the Parent
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IMediaType> |
An Enumerable list of IMediaType objects
|
GetMediaTypeChildren(Int32)
Declaration
IEnumerable<IMediaType> GetMediaTypeChildren(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
Id of the Parent
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IMediaType> |
An Enumerable list of IMediaType objects
|
GetMediaTypeContainer(Guid)
Declaration
EntityContainer GetMediaTypeContainer(Guid containerId)
Parameters
Type |
Name |
Description |
System.Guid |
containerId |
|
Returns
GetMediaTypeContainer(Int32)
Declaration
EntityContainer GetMediaTypeContainer(int containerId)
Parameters
Type |
Name |
Description |
System.Int32 |
containerId |
|
Returns
GetMediaTypeContainers(Int32[])
Declaration
IEnumerable<EntityContainer> GetMediaTypeContainers(int[] containerIds)
Parameters
Type |
Name |
Description |
System.Int32[] |
containerIds |
|
Returns
GetMediaTypeContainers(String, Int32)
Declaration
IEnumerable<EntityContainer> GetMediaTypeContainers(string folderName, int level)
Parameters
Type |
Name |
Description |
System.String |
folderName |
|
System.Int32 |
level |
|
Returns
GetMediaTypeContainers(IMediaType)
Declaration
IEnumerable<EntityContainer> GetMediaTypeContainers(IMediaType mediaType)
Parameters
Returns
HasChildren(Guid)
Declaration
bool HasChildren(Guid id)
Parameters
Returns
Type |
Description |
System.Boolean |
True if the content type has any children otherwise False
|
HasChildren(Int32)
Declaration
Parameters
Type |
Name |
Description |
System.Int32 |
id |
Id of the IContentType
|
Returns
Type |
Description |
System.Boolean |
True if the content type has any children otherwise False
|
HasContainerInPath(String)
Given the path of a content item, this will return true if the content item exists underneath a list view content item
Declaration
bool HasContainerInPath(string contentPath)
Parameters
Type |
Name |
Description |
System.String |
contentPath |
|
Returns
Type |
Description |
System.Boolean |
|
MediaTypeHasChildren(Guid)
Checks whether an IMediaType item has any children
Declaration
bool MediaTypeHasChildren(Guid id)
Parameters
Type |
Name |
Description |
System.Guid |
id |
Id of the IMediaType
|
Returns
Type |
Description |
System.Boolean |
True if the media type has any children otherwise False
|
MediaTypeHasChildren(Int32)
Checks whether an IMediaType item has any children
Declaration
bool MediaTypeHasChildren(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
Id of the IMediaType
|
Returns
Type |
Description |
System.Boolean |
True if the media type has any children otherwise False
|
MoveContentType(IContentType, Int32)
Declaration
Attempt<OperationStatus<MoveOperationStatusType>> MoveContentType(IContentType toMove, int containerId)
Parameters
Type |
Name |
Description |
IContentType |
toMove |
|
System.Int32 |
containerId |
|
Returns
MoveMediaType(IMediaType, Int32)
Declaration
Attempt<OperationStatus<MoveOperationStatusType>> MoveMediaType(IMediaType toMove, int containerId)
Parameters
Type |
Name |
Description |
IMediaType |
toMove |
|
System.Int32 |
containerId |
|
Returns
RenameContentTypeContainer(Int32, String, Int32)
Declaration
Attempt<OperationStatus<EntityContainer, OperationStatusType>> RenameContentTypeContainer(int id, string name, int userId = 0)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.String |
name |
|
System.Int32 |
userId |
|
Returns
RenameDataTypeContainer(Int32, String, Int32)
Declaration
Attempt<OperationStatus<EntityContainer, OperationStatusType>> RenameDataTypeContainer(int id, string name, int userId = 0)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.String |
name |
|
System.Int32 |
userId |
|
Returns
RenameMediaTypeContainer(Int32, String, Int32)
Declaration
Attempt<OperationStatus<EntityContainer, OperationStatusType>> RenameMediaTypeContainer(int id, string name, int userId = 0)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.String |
name |
|
System.Int32 |
userId |
|
Returns
Save(IEnumerable<IContentType>, Int32)
Declaration
void Save(IEnumerable<IContentType> contentTypes, int userId = 0)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<IContentType> |
contentTypes |
Collection of IContentType to save
|
System.Int32 |
userId |
Optional Id of the User saving the ContentTypes
|
Save(IEnumerable<IMediaType>, Int32)
Declaration
void Save(IEnumerable<IMediaType> mediaTypes, int userId = 0)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<IMediaType> |
mediaTypes |
Collection of IMediaType to save
|
System.Int32 |
userId |
Optional Id of the User saving the MediaTypes
|
Save(IContentType, Int32)
Declaration
void Save(IContentType contentType, int userId = 0)
Parameters
Type |
Name |
Description |
IContentType |
contentType |
IContentType to save
|
System.Int32 |
userId |
Optional Id of the User saving the ContentType
|
Save(IMediaType, Int32)
Declaration
void Save(IMediaType mediaType, int userId = 0)
Parameters
Type |
Name |
Description |
IMediaType |
mediaType |
IMediaType to save
|
System.Int32 |
userId |
Optional Id of the User saving the MediaType
|
SaveContentTypeContainer(EntityContainer, Int32)
Declaration
Attempt<OperationStatus> SaveContentTypeContainer(EntityContainer container, int userId = 0)
Parameters
Returns
SaveMediaTypeContainer(EntityContainer, Int32)
Declaration
Attempt<OperationStatus> SaveMediaTypeContainer(EntityContainer container, int userId = 0)
Parameters
Returns
ValidateComposition(IContentTypeComposition)
Validates the composition, if its invalid a list of property type aliases that were duplicated is returned
Declaration
Attempt<string[]> ValidateComposition(IContentTypeComposition compo)
Parameters
Returns
Type |
Description |
Attempt<System.String[]> |
|