Class ContentItemAssetUploaderComponent
Represents asset uploader form component.
public sealed class ContentItemAssetUploaderComponent : FormComponent<ContentItemAssetUploaderProperties, ContentItemAssetUploaderClientProperties, ContentItemAssetMetadata>, IFormComponent, IFormItem<IFormComponentClientProperties>, IFormItem
- Inheritance
-
objectFormComponent<ContentItemAssetUploaderProperties, ContentItemAssetUploaderClientProperties, ContentItemAssetMetadata>ContentItemAssetUploaderComponent
- Implements
- Inherited Members
- Extension Methods
Constructors
ContentItemAssetUploaderComponent(IEventLogService, ILocalizationService, ISettingsService, IDataProtectionProvider, IOptions<FileUploadOptions>)
Initializes a new instance of ContentItemAssetUploaderComponent.
public ContentItemAssetUploaderComponent(IEventLogService eventLogService, ILocalizationService localizationService, ISettingsService settingsService, IDataProtectionProvider dataProtectionProvider, IOptions<FileUploadOptions> fileUploadOptions)
Parameters
eventLogServiceIEventLogServicelocalizationServiceILocalizationServicesettingsServiceISettingsServicedataProtectionProviderIDataProtectionProviderfileUploadOptionsIOptions<FileUploadOptions>
Fields
IDENTIFIER
Represents the ContentItemAssetUploaderComponent identifier.
public const string IDENTIFIER = "Kentico.Administration.ContentItemAssetUploader"
Field Value
- string
Properties
ClientComponentName
Name of the front-end type implementing the UI form component.
public override string ClientComponentName { get; }
Property Value
- string
Methods
CalculateCropParameters(VariantRecalculationArguments)
Recalculate the variant crops of the content item asset's variants after a focal point has changed in order to preview them new crops in the UI.
[FormComponentCommand]
public Task<ICommandResponse<ContentItemAssetMetadataClientItem>> CalculateCropParameters(VariantRecalculationArguments args)
Parameters
argsVariantRecalculationArgumentsThe arguments identifying the asset and the variants to recalculate.
Returns
CompleteUpload(CompleteUploadCommandArguments, CancellationToken)
Completes the upload of the file.
[FormComponentCommand]
public Task<ICommandResponse<CompleteUploadCommandResult>> CompleteUpload(CompleteUploadCommandArguments args, CancellationToken cancellationToken)
Parameters
argsCompleteUploadCommandArgumentsComplete upload command arguments.
cancellationTokenCancellationTokenCancellation token.
Returns
ConfigureClientProperties(ContentItemAssetUploaderClientProperties)
Configures the form component client properties.
protected override Task ConfigureClientProperties(ContentItemAssetUploaderClientProperties clientProperties)
Parameters
clientPropertiesContentItemAssetUploaderClientPropertiesThe current instance of the form component client properties.
Returns
- Task
Remarks
Override this method in order to configure form component client properties.
ConfigureComponent()
Configures the form component. This method is called when all form component properties are set.
protected override void ConfigureComponent()
Remarks
Override this method to set component inner state, like additional component validation rules.
ConvertImage(ImageConversionArguments)
Convert file.
[FormComponentCommand]
public Task<ICommandResponse<ImageConversionResponse>> ConvertImage(ImageConversionArguments args)
Parameters
argsImageConversionArgumentsConvert the file in the command arguments.
Returns
Remarks
This command will try to convert the file from temporary or persistent file location. Converted file is returned as a byte array. Any error is logged when conversion fails.
FetchAdjustImageDialogData(DialogDataFetchArguments)
Provide data for the crop editor dialog related to the given content item asset.
[FormComponentCommand]
public Task<ICommandResponse<AdjustImageDialogResult>> FetchAdjustImageDialogData(DialogDataFetchArguments args)
Parameters
Returns
GetValue()
Gets the value of the form component.
public override ContentItemAssetMetadata GetValue()
Returns
- ContentItemAssetMetadata
Returns the value of the form component.
Remarks
Returns an instance of ContentItemAssetMetadataWithSource carrying the underlying temp file as an ContentItemAssetUploadedFileSource with the original file as an ContentItemAssetFileSource or ContentItemAssetUploadedFileSource depending on whether the original asset is permanent or not.
RemoveUploadedFile(RemoveUploadedFileCommandArguments)
Delete removed uploaded file.
[FormComponentCommand]
public Task RemoveUploadedFile(RemoveUploadedFileCommandArguments args)
Parameters
argsRemoveUploadedFileCommandArgumentsRemove uploaded file command arguments.
Returns
- Task
Remarks
This command will try to delete the uploaded file from temporary location. No result is returned. Exception is logged when deletion fails.
SaveAdjustImageDialogData(SaveAdjustImageDialogArguments)
Provide data for the crop editor dialog related to the given content item asset.
[FormComponentCommand]
public Task<ICommandResponse<ContentItemAssetMetadataClientItem>> SaveAdjustImageDialogData(SaveAdjustImageDialogArguments args)
Parameters
argsSaveAdjustImageDialogArgumentsThe arguments identifying the asset and the parameters to persist.
Returns
UploadChunk(UploadChunkCommandArguments, CancellationToken)
Uploads single chunk of the file.
[FormComponentCommand]
public Task<ICommandResponse<UploadChunkCommandResult>> UploadChunk(UploadChunkCommandArguments args, CancellationToken cancellationToken)
Parameters
argsUploadChunkCommandArgumentsUpload chunk command arguments.
cancellationTokenCancellationTokenCancellation token.