Class ContentItemSelectorComponentBase<TProperties>
A base class for content item selector form components.
public abstract class ContentItemSelectorComponentBase<TProperties> : FormComponentWithNestedComponents<TProperties, ContentItemSelectorClientProperties, IEnumerable<ContentItemReference>>, IFormComponent, IFormItem<IFormComponentClientProperties>, IFormItem where TProperties : ContentItemSelectorBaseProperties, new()
Type Parameters
TProperties
- Inheritance
-
objectFormComponentWithNestedComponents<TProperties, ContentItemSelectorClientProperties, IEnumerable<ContentItemReference>>ContentItemSelectorComponentBase<TProperties>
- Implements
- Derived
- Inherited Members
- Extension Methods
Remarks
This API supports the framework infrastructure and is not intended to be used directly from your code.
Constructors
ContentItemSelectorComponentBase(IFormComponentCommandInvoker, IFormDataBinder, IAuthenticatedUserAccessor, IContentItemManagerFactory, ILocalizationService, IEventLogService, IFormItemCollectionProvider, IContentLanguageRetriever, IContentItemDisplayNameValidator, IContentItemCommonDataInfoRetriever, IContentItemSelectorItemProvider)
Initializes a new instance of ContentItemSelectorComponentBase<TProperties>.
[Obsolete("Method was not intended for public use and will be removed in the next version.")]
[ObsoleteSince(29, 2)]
public ContentItemSelectorComponentBase(IFormComponentCommandInvoker formComponentCommandInvoker, IFormDataBinder formDataBinder, IAuthenticatedUserAccessor userAccessor, IContentItemManagerFactory contentItemManagerFactory, ILocalizationService localizationService, IEventLogService eventLogService, IFormItemCollectionProvider formItemCollectionProvider, IContentLanguageRetriever contentLanguageRetriever, IContentItemDisplayNameValidator contentItemDisplayNameValidator, IContentItemCommonDataInfoRetriever contentItemCommonDataInfoRetriever, IContentItemSelectorItemProvider selectorItemProvider)
Parameters
formComponentCommandInvoker
IFormComponentCommandInvokerformDataBinder
IFormDataBinderuserAccessor
IAuthenticatedUserAccessorcontentItemManagerFactory
IContentItemManagerFactorylocalizationService
ILocalizationServiceeventLogService
IEventLogServiceformItemCollectionProvider
IFormItemCollectionProvidercontentLanguageRetriever
IContentLanguageRetrievercontentItemDisplayNameValidator
IContentItemDisplayNameValidatorcontentItemCommonDataInfoRetriever
IContentItemCommonDataInfoRetrieverselectorItemProvider
IContentItemSelectorItemProvider
Methods
ChangeEditContentItemPanelForm(FormChangeCommandArguments, CancellationToken)
Handles the form change command. The command is invoked whenever visibility conditions of the form need to be reevaluated to re-render the form.
public Task<ICommandResponse<FormChangeResult>> ChangeEditContentItemPanelForm(FormChangeCommandArguments args, CancellationToken cancellationToken = default)
Parameters
args
FormChangeCommandArgumentsForm change arguments.
cancellationToken
CancellationTokenCancellation instruction.
Returns
- Task<ICommandResponse<FormChangeResult>>
Returns the form change result.
ConfigureClientProperties(ContentItemSelectorClientProperties)
Configures the form component client properties.
protected override Task ConfigureClientProperties(ContentItemSelectorClientProperties clientProperties)
Parameters
clientProperties
ContentItemSelectorClientPropertiesThe 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.
ConfirmSelection(ContentItemSubmissionCommandArguments, CancellationToken)
Confirms the selection of content item creation parameters.
public Task<ICommandResponse> ConfirmSelection(ContentItemSubmissionCommandArguments args, CancellationToken cancellationToken)
Parameters
args
ContentItemSubmissionCommandArgumentsConfirm selection form command arguments.
cancellationToken
CancellationTokenCancellation instruction.
Returns
- Task<ICommandResponse>
Create(ContentItemSubmissionCommandArguments, CancellationToken)
Creates a content item based on args
and returns a created content item data.
public Task<ICommandResponse> Create(ContentItemSubmissionCommandArguments args, CancellationToken cancellationToken)
Parameters
args
ContentItemSubmissionCommandArgumentsSubmission arguments.
cancellationToken
CancellationTokenCancellation instruction.
Returns
- Task<ICommandResponse>
CreateContentItem(ContentItemSubmissionCommandArguments, string, VersionStatus, ContentItemData, CancellationToken)
Creates a reusable content item based on provided parameters.
protected virtual Task<int> CreateContentItem(ContentItemSubmissionCommandArguments args, string languageName, VersionStatus versionStatus, ContentItemData data, CancellationToken cancellationToken)
Parameters
args
ContentItemSubmissionCommandArgumentsSubmission arguments.
languageName
stringLanguage code name.
versionStatus
VersionStatusVersion status.
data
ContentItemDataContent item data retrieved from form.
cancellationToken
CancellationTokenCancellation instruction.
Returns
- Task<int>
Content item identifier of newly created item.
Remarks
Method creates a reusable content item. If you want to create specific content type item you need to override this method.
GetContentTypeSelectionModel()
Returns the model object for the content type selection form.
protected abstract object GetContentTypeSelectionModel()
Returns
- object
GetNestedFormItems()
Returns the form items that are used within the nested form.
protected override Task<ICollection<IFormItem>> GetNestedFormItems()
Returns
- Task<ICollection<IFormItem>>
GetSelectionModel()
Returns model class for the form.
[Obsolete("Method was not intended for public use and will be removed in the next version.")]
[ObsoleteSince(30, 0)]
protected virtual object GetSelectionModel()
Returns
- object
InitializeNestedContext()
Initializes form context within the nested form.
protected override Task<IFormContext> InitializeNestedContext()
Returns
- Task<IFormContext>
LoadContentItemPanelItems(LoadContentItemPanelItemsCommandArguments, CancellationToken)
Loads content item panel items.
public Task<ICommandResponse<LoadContentItemPanelItemsResult>> LoadContentItemPanelItems(LoadContentItemPanelItemsCommandArguments args, CancellationToken cancellationToken)
Parameters
args
LoadContentItemPanelItemsCommandArgumentscancellationToken
CancellationToken
Returns
LoadFormItems(ContentItemCommandParameters, CancellationToken)
Loads form items.
public Task<ICommandResponse> LoadFormItems(ContentItemCommandParameters args, CancellationToken cancellationToken)
Parameters
args
ContentItemCommandParameterscancellationToken
CancellationToken
Returns
- Task<ICommandResponse>
Publish(ContentItemSubmissionCommandArguments, CancellationToken)
Publishes the content item.
public Task<ICommandResponse> Publish(ContentItemSubmissionCommandArguments args, CancellationToken cancellationToken)
Parameters
args
ContentItemSubmissionCommandArgumentsPublish content item command arguments.
cancellationToken
CancellationTokenCancellation instruction.
Returns
- Task<ICommandResponse>
ValidateDisplayName(RenameCommandArguments)
Validates the content item display name.
public Task<ICommandResponse<RenameCommandResult>> ValidateDisplayName(RenameCommandArguments args)
Parameters
args
RenameCommandArgumentsRename command arguments.