Class ExportData
This command executes the ExportData system command
Exports the data from the specified entity, ISQLWrapper, or ICollectionExportable controller
Provides appropriate parameter selection for filtering, columns, and parametersInheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Commands
Assembly: LemonEdge.ClientCore.dll
Syntax
[CommandDescriptorOptions(Command.ExportData, typeof(ExportCSVParameter))]
public class ExportData : TaskBase, IHasChildren<EPCommandWithDescriptor>, IHasChildren, IDisposable, IEPCommandWithDescriptor, IEPCommand, ICommand, ICommandDescriptor
Constructors
ExportData(IRootController, IModelLayoutCommon, IEntityDescriptorFactory, IStorageServiceFactory)
Creates a new ExportData command set to run on the server, ignoring any ICollectionExportable implementation, and allowing the user to make entity or sql wrapper selections and configuration
Declaration
public ExportData(IRootController root, IModelLayoutCommon owner, IEntityDescriptorFactory entityDescriptorFactory, IStorageServiceFactory storageServiceFactory)
Parameters
Type | Name | Description |
---|---|---|
IRootController | root | The root controller, for service access. |
IModelLayoutCommon | owner | The owning context for this command |
IEntityDescriptorFactory | entityDescriptorFactory | |
IStorageServiceFactory | storageServiceFactory |
ExportData(IRootController, ModelViewController, Func<EntityDescriptor>)
Creates a new ExportData command set to export data from the specified type of entity only
Declaration
public ExportData(IRootController root, ModelViewController controller, Func<EntityDescriptor> getDescriptor)
Parameters
Type | Name | Description |
---|---|---|
IRootController | root | The root controller, for service access. |
ModelViewController | controller | The view controller to export data from. Can use the ICollectionExportable implementation of the controller. |
Func<EntityDescriptor> | getDescriptor | A function that return the type of entity to export data for |
ExportData(IRootController, ModelViewController, Func<Task<ISQLWrapper>>, Func<EntityDescriptor>, bool)
Creates a new ExportData command
Declaration
public ExportData(IRootController root, ModelViewController controller, Func<Task<ISQLWrapper>> getWrapper, Func<EntityDescriptor> getDescriptor, bool ignoreGridContents = false)
Parameters
Type | Name | Description |
---|---|---|
IRootController | root | The root controller, for service access. |
ModelViewController | controller | The view controller to export data from. Can use the
ICollectionExportable implementation of the controller if
|
Func<Task<ISQLWrapper>> | getWrapper | A function that returns the sql wrapper to use for exporting data if that is the type of data to automatically export from this command |
Func<EntityDescriptor> | getDescriptor | A function that return the entity to export if that is the type of data to automatically export from this command |
bool | ignoreGridContents | Indicates if the |
Properties
CustomTitle
A custom title for this command, other than just Export Data
Declaration
public string CustomTitle { get; set; }
Property Value
Type | Description |
---|---|
string |
IconID
Returns system Excel image
Declaration
public override Guid IconID { get; }
Property Value
Type | Description |
---|---|
Guid |
Overrides
IncludeInSimple
True - This command can be included automatically in any simple set of view commands
Declaration
public override bool IncludeInSimple { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
InternalExecuteWithChanges
Allow running this command with changes if there are no changes, or the data to be exported is coming from a local ICollectionExportable implementation
Declaration
protected override bool InternalExecuteWithChanges { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Title
The Title to use for this command which is either the CustomTitle or if null, then the the Export Data Task title
Declaration
public override string Title { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Methods
GetParameters()
If this is exporting a sql wrapper or entity, and one has not been set yet, then this will prompt the main export parameters dialog which allows a sql wrapper or entity selection and the parameters to be then set for either
If a sql wrapper or entity is selected, then this will display the parameters for that selection in terms of filtering, columns, and query parameters
Declaration
protected override Task<ServerTaskParameter> GetParameters()
Returns
Type | Description |
---|---|
Task<ServerTaskParameter> | A task indicating the completion of the operation |
Overrides
InternalCanExecuteAsync(object)
Returns true if exporting from local ICollectionExportable implementation, or if there are no changes and the data can be retrieved from a server call
Declaration
public override Task<bool> InternalCanExecuteAsync(object parameter)
Parameters
Type | Name | Description |
---|---|---|
object | parameter | The command parameter |
Returns
Type | Description |
---|---|
Task<bool> | True if exporting from local ICollectionExportable implementation, or if there are no changes and the data can be retrieved from a server call |
Overrides
InternalExecuteAsync(object)
Gets the parameters for the task (possibly prompting the user for som if GetParameters() override calls GetUserModifiedParametersFromDefault(IModelLayoutCommon, ServerTaskParameter)) and executes the task locally or against a task service depending on the setup
The system then also tracks the progress of the task in the application and notifies the user when the task is complete
Declaration
public override Task InternalExecuteAsync(object parameter)
Parameters
Type | Name | Description |
---|---|---|
object | parameter | The command parameter |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
Overrides
ProcessExecute(ServerTaskParameter, bool)
Processes the export data task by sending it to the task server, or running locally if exporting directly from a ICollectionExportable implementation.
Declaration
public override Task ProcessExecute(ServerTaskParameter taskParam, bool isKeymodifierPressed)
Parameters
Type | Name | Description |
---|---|---|
ServerTaskParameter | taskParam | The parameter for runnin this task |
bool | isKeymodifierPressed | Indicates if the key modifier is pressed indicating a service task should be run locally if it can be |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of creating the task (and tracking it as it runs) |