Class ModuleForm
Represents a module that manages form-based operations within a section.
Inherited Members
Namespace: DataWeb.Structure.Modules
Assembly: DataWeb.Core.dll
Syntax
public class ModuleForm : Module
Remarks
This class provides methods for validating, saving, and cloning form data associated with an item. It also handles additional functionalities such as checking completion status and processing data during save operations. It integrates with various services including form, cache, item, audit, and file services to provide robust form management.
Constructors
ModuleForm(Section, NavigationContext, IServiceProvider)
Represents a module that manages form-based operations within a section.
Declaration
public ModuleForm(Section section, NavigationContext navigationContext, IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
Section | section | |
NavigationContext | navigationContext | |
IServiceProvider | serviceProvider |
Remarks
This class provides methods for validating, saving, and cloning form data associated with an item. It also handles additional functionalities such as checking completion status and processing data during save operations. It integrates with various services including form, cache, item, audit, and file services to provide robust form management.
Methods
CloneAsync(Item, Item, CancellationToken)
Clones the module's section data, including versions, from one item to another.
Declaration
public override Task CloneAsync(Item item, Item itemCloned, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Item | item | The source item to clone from. |
Item | itemCloned | The target item to clone to. |
CancellationToken | cancellationToken | Token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
Overrides
IsCompletedAsync(Item, Section, CancellationToken)
Determines whether the module's section is completed for a specific item.
Declaration
public override Task<bool> IsCompletedAsync(Item item, Section currentSection, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Item | item | The item to check completion for. |
Section | currentSection | The current section of the item. |
CancellationToken | cancellationToken | Token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
Task<bool> | A task that represents the asynchronous operation. The task result indicates whether the section is completed. |
Overrides
ProcessOnSaveDataAsync(Item, SectionPart, List<ProvidedValue>, Dictionary<string, object>, CancellationToken)
Performs additional processing when saving module data.
Declaration
public virtual Task ProcessOnSaveDataAsync(Item item, Item.SectionPart sectionPart, List<Form.ProvidedValue> providedValues, Dictionary<string, object> historySectionData, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Item | item | The item being processed. |
Item.SectionPart | sectionPart | The section part associated with the item. |
List<Form.ProvidedValue> | providedValues | The provided values for the form. |
Dictionary<string, object> | historySectionData | The previous values in the section data. |
CancellationToken | cancellationToken | Token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
SaveAsync(Item, Dictionary<string, object>, CancellationToken)
Saves the module data for a specific item.
Declaration
public override Task<ModuleSaveResult> SaveAsync(Item item, Dictionary<string, object> moduleData, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Item | item | The item to save the data for. |
Dictionary<string, object> | moduleData | The module data to save. |
CancellationToken | cancellationToken | Token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
Task<ModuleSaveResult> | A task that represents the asynchronous operation. The task result contains the save result, including modification details. |
Overrides
ValidateAsync(Item, Dictionary<string, object>, CancellationToken)
Validates the module data for a specific item.
Declaration
public override Task<List<ValidationError>> ValidateAsync(Item item, Dictionary<string, object> moduleData, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Item | item | The item being validated. |
Dictionary<string, object> | moduleData | The module data to validate. |
CancellationToken | cancellationToken | Token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
Task<List<ValidationError>> | A task that represents the asynchronous operation. The task result contains a list of validation errors. |