2using System.Collections.Generic;
3using System.Threading.Tasks;
36 this.queryNode = QueryNode;
48 public string CommandID => this.queryNode.CommandId;
63 public string SortKey => this.queryNode.SortKey;
101 throw new Exception(
"Script query is not a command.");
115 this.values[
"Query"] =
Query;
116 this.values[
"Language"] =
Query;
123 object Result = await this.queryNode.ParsedScript.EvaluateAsync(this.values);
135 int NrColumns = ResultSet.Columns;
138 string[] ColumnNames = ResultSet.ColumnNames;
139 int NrColumnNames = ColumnNames?.Length ?? 0;
153 foreach (
double d
in dv.Values)
163 Columns[
Column] =
new Column(
"C" +
Column.ToString(), Header,
null,
null,
null,
null, Alignment, NrDec);
168 int NrRows = ResultSet.Rows;
169 List<Record> Records =
new List<Record>();
170 List<object> RecordElements =
new List<object>();
172 foreach (
IElement RowElement
in ResultSet.VectorElements)
174 if (!(RowElement is
IVector RowVector))
177 RecordElements.Clear();
181 Records.Add(
new Record(RecordElements.ToArray()));
212 return new ScriptQuery(this.node, this.queryNode, this.parameters);
229 Value = v.ValueObject;
Helps with parsing of commong data types.
static byte GetNrDecimals(double x)
Calculates the number of decimals of a floating-point number.
Static class managing editable parameters in objects. Editable parameters are defined by using the at...
Contains information about a language.
async Task< Namespace > GetNamespaceAsync(string Name)
Gets the namespace object, given its name, if available.
Contains information about a namespace in a language.
Task< LanguageString > GetStringAsync(int Id)
Gets the string object, given its ID, if available.
Base class for all types of elements.
abstract object AssociatedObjectValue
Associated object value.
Contains information about a variable.
Defines a column in a table.
Class handling the reception of data from a query.
Task TableDone(string TableId)
Reports a table as being complete.
Task EndSection()
Ends a section. Each call to BeginSection(string) must be followed by a call to EndSection().
bool IsDone
If the query is done.
Task NewObject(object Object)
Reports a new object.
bool HasReported
If anything has been reported.
bool IsStarted
If the query has been started.
bool HasTitle
If a title has been set
Task Start()
Starts query execution.
Task NewRecords(string TableId, params Record[] Records)
Reports a new set of records in a table.
bool IsAborted
If the query is aborted.
Task BeginSection(string Header)
Begins a new section. Sections can be nested. Each call to BeginSection(string) must be followed by a...
Task NewTable(string TableId, string TableName, params Column[] Columns)
Defines a new table in the query output.
Task LogMessage(Exception Exception)
Logs an Exception as a query message.
async Task Done()
Query execution completed.
Task SetStatus(string Status)
Sets the current status of the query execution.
Task SetTitle(string Title)
Sets the title of the report.
Defines a record in a table.
Tokens available in request.
Represents a parameter on a command.
abstract Task SetParameter(DataForm Parameters, Language Language, bool OnlySetChanged, Variables Values, SetEditableFormResult Result)
Sets the parameters of the object, based on contents in the data form.
abstract Task PopulateForm(DataForm Parameters, Language Language, object Value)
Populates a data form with parameters for the object.
string ParameterName
Parameter name.
Represents a query on a script node.
Task< string > GetNameAsync(Language Language)
Gets the name of data source.
async Task< SetEditableFormResult > SetParameters(DataForm Parameters, Language Language, bool OnlySetChanged)
Sets the parameters of the object, based on contents in the data form.
string CommandID
ID of command.
string SortCategory
Sort Category, if available.
async Task PopulateForm(DataForm Parameters, Language Language)
Populates a data form with parameters for the object.
Task< string > GetConfirmationStringAsync(Language Language)
Gets a confirmation string, if any, of the command. If no confirmation is necessary,...
async 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,...
ScriptQuery(VirtualNode Node, ScriptQueryNode QueryNode, ScriptParameterNode[] Parameters)
Represents a query on a script node.
Task< string > GetFailureStringAsync(Language Language)
Gets a failure string, if any, of the command. If no specific failure string is available,...
CommandType Type
Type of command.
ICommand Copy()
Creates a copy of the command object.
Task< bool > CanExecuteAsync(RequestOrigin Caller)
If the command can be executed by the caller.
Task ExecuteCommandAsync()
Executes the command.
string SortKey
Sort Key, if available.
Represents a query that can be executed on a script node or script reference node.
Virtual node, that can be used as a placeholder for services.
Interface for editable objects.
Basic interface for all types of elements.
Basic interface for vectors.
ColumnAlignment
Column alignment.