Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ExecuteReport.cs
1using System;
2using System.Threading.Tasks;
4using Waher.Things;
6
7namespace Waher.Reports
8{
12 public abstract class ExecuteReport : ICommand
13 {
14 private readonly ReportNode report;
15
21 {
22 this.report = Report;
23 }
24
28 public ReportNode Report => this.report;
29
33 public string CommandID => "Execute";
34
38 public CommandType Type => CommandType.Query;
39
43 public string SortCategory => "Report";
44
48 public string SortKey => this.CommandID;
49
54 public virtual Task<string> GetNameAsync(Language Language)
55 {
56 return Language.GetStringAsync(typeof(ReportsDataSource), 4, "Execute Report...");
57 }
58
63 public Task<string> GetConfirmationStringAsync(Language Language) => Task.FromResult(string.Empty);
64
69 public Task<string> GetFailureStringAsync(Language Language) => Task.FromResult(string.Empty);
70
75 public Task<string> GetSuccessStringAsync(Language Language) => Task.FromResult(string.Empty);
76
82 public async Task<bool> CanExecuteAsync(RequestOrigin Caller)
83 {
84 return await this.report.CanViewAsync(Caller);
85 }
86
90 public Task ExecuteCommandAsync()
91 {
92 throw new NotSupportedException();
93 }
94
101
106 public abstract ICommand Copy();
107 }
108}
Abstract base class for commands executing a report.
async Task< bool > CanExecuteAsync(RequestOrigin Caller)
If the command can be executed by the caller.
CommandType Type
Type of command.
ReportNode Report
Report node.
Task< string > GetConfirmationStringAsync(Language Language)
Gets a confirmation string, if any, of the command. If no confirmation is necessary,...
ExecuteReport(ReportNode Report)
Abstract base class for commands executing a report.
string CommandID
ID of command.
Task ExecuteCommandAsync()
Executes the command.
Task< string > GetFailureStringAsync(Language Language)
Gets a failure string, if any, of the command. If no specific failure string is available,...
string SortKey
Sort Key, if available.
abstract ICommand Copy()
Creates a copy of the command object.
abstract Task StartQueryExecutionAsync(Query Query, Language Language)
Starts the execution of a query.
Task< string > GetSuccessStringAsync(Language Language)
Gets a success string, if any, of the command. If no specific success string is available,...
string SortCategory
Sort Category, if available.
virtual Task< string > GetNameAsync(Language Language)
Gets the displayable name of the command.
Abstract base class for report nodes.
Definition: ReportNode.cs:15
Defines the Reports data source. This data source contains a tree structure of reports published by d...
Contains information about a language.
Definition: Language.cs:17
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Definition: Language.cs:209
Class handling the reception of data from a query.
Definition: Query.cs:12
Tokens available in request.
Definition: RequestOrigin.cs:9
Interface for commands.
Definition: ICommand.cs:32
CommandType
Command type.
Definition: ICommand.cs:11