Interface IContentBlueprintEditingService
Provides editing services for content blueprints.
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IContentBlueprintEditingService
Remarks
Content blueprints are templates that can be used to create new content items with pre-populated property values.
Methods
View SourceCreateAsync(ContentBlueprintCreateModel, Guid)
Creates a new content blueprint.
Declaration
Task<Attempt<ContentCreateResult, ContentEditingOperationStatus>> CreateAsync(ContentBlueprintCreateModel createModel, Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentBlueprintCreateModel | createModel | The model containing the blueprint data. |
| Guid | userKey | The unique identifier of the user performing the action. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<ContentCreateResult, ContentEditingOperationStatus>> | An attempt containing the creation result or an error status. |
CreateFromContentAsync(Guid, string, Guid?, Guid)
Creates a new content blueprint from an existing content item.
Declaration
Task<Attempt<ContentCreateResult, ContentEditingOperationStatus>> CreateFromContentAsync(Guid contentKey, string name, Guid? key, Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | contentKey | The unique identifier of the content item to create the blueprint from. |
| string | name | The name for the new blueprint. |
| Guid? | key | The optional unique identifier for the new blueprint. |
| Guid | userKey | The unique identifier of the user performing the action. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<ContentCreateResult, ContentEditingOperationStatus>> | An attempt containing the creation result or an error status. |
DeleteAsync(Guid, Guid)
Deletes a content blueprint.
Declaration
Task<Attempt<IContent?, ContentEditingOperationStatus>> DeleteAsync(Guid key, Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The unique identifier of the blueprint to delete. |
| Guid | userKey | The unique identifier of the user performing the action. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<IContent, ContentEditingOperationStatus>> | An attempt containing the deleted blueprint or an error status. |
GetAsync(Guid)
Gets a content blueprint by its unique identifier.
Declaration
Task<IContent?> GetAsync(Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The unique identifier of the blueprint. |
Returns
| Type | Description |
|---|---|
| Task<IContent> | The content blueprint, or |
GetPagedByContentTypeAsync(Guid, int, int)
Gets a paged collection of blueprints for a specific content type.
Declaration
Task<Attempt<PagedModel<IContent>?, ContentEditingOperationStatus>> GetPagedByContentTypeAsync(Guid contentTypeKey, int skip, int take)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | contentTypeKey | The unique identifier of the content type. |
| int | skip | The number of items to skip. |
| int | take | The number of items to take. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<PagedModel<IContent>, ContentEditingOperationStatus>> | An attempt containing the paged result of blueprints or an error status. |
GetScaffoldedAsync(Guid)
Gets a scaffolded content item based on a blueprint.
Declaration
Task<IContent?> GetScaffoldedAsync(Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The unique identifier of the blueprint to scaffold from. |
Returns
| Type | Description |
|---|---|
| Task<IContent> | A new content item with values populated from the blueprint, or |
MoveAsync(Guid, Guid?, Guid)
Moves a content blueprint to a different container.
Declaration
Task<Attempt<ContentEditingOperationStatus>> MoveAsync(Guid key, Guid? containerKey, Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The unique identifier of the blueprint to move. |
| Guid? | containerKey | The unique identifier of the target container, or |
| Guid | userKey | The unique identifier of the user performing the action. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<ContentEditingOperationStatus>> | An attempt containing the operation status. |
UpdateAsync(Guid, ContentBlueprintUpdateModel, Guid)
Updates an existing content blueprint.
Declaration
Task<Attempt<ContentUpdateResult, ContentEditingOperationStatus>> UpdateAsync(Guid key, ContentBlueprintUpdateModel updateModel, Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The unique identifier of the blueprint to update. |
| ContentBlueprintUpdateModel | updateModel | The model containing the updated blueprint data. |
| Guid | userKey | The unique identifier of the user performing the action. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<ContentUpdateResult, ContentEditingOperationStatus>> | An attempt containing the update result or an error status. |