Skip to content

Commit 7a49dff

Browse files
committed
Adding Ad Hoc Data Source solution (GQI) (SkylineCommunications#22)
(cherry picked from commit 9264d98)
1 parent 6e6770b commit 7a49dff

File tree

20 files changed

+1409
-45
lines changed

20 files changed

+1409
-45
lines changed

working/templatepack.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
1313
<PackageIcon>Icon.png</PackageIcon>
1414
<PackageReadmeFile>README.md</PackageReadmeFile>
15-
1615
<TargetFramework>netstandard2.0</TargetFramework>
1716
<IncludeContentInPack>true</IncludeContentInPack>
1817
<IncludeBuildOutput>false</IncludeBuildOutput>

working/templates/automationsolution/.template_config/template.json

+20-22
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"author": "Skyline Communications",
44
"classifications": [ "DataMiner" ],
55
"tags": {
6-
"language": "C#",
7-
"type": "solution",
8-
"editorTreatAs":"solution"
6+
"language": "C#",
7+
"type": "solution",
8+
"editorTreatAs":"solution"
99
},
1010
"identity": "Skyline.DataMiner.AutomationScript.Solution.Template",
1111
"name": "DataMiner Automation Script Solution",
@@ -15,11 +15,11 @@
1515
"ScriptName": {
1616
"type": "parameter",
1717
"datatype": "string",
18-
"defaultValue": "",
18+
"defaultValue": "AutomationScript1",
1919
"replaces": "$SCRIPTNAME$",
20-
"FileRename": "$SCRIPTNAME$",
20+
"FileRename": "$SCRIPTNAME$",
2121
"description": "The name of the Automation script.",
22-
"isRequired": true
22+
"isRequired": true
2323
},
2424
"Author": {
2525
"type": "parameter",
@@ -58,22 +58,20 @@
5858
}
5959
]
6060
}
61-
},
61+
},
6262
"Namespace": {
63-
"type": "generated",
64-
"generator": "regex",
65-
"dataType": "string",
66-
"replaces": "$NAMESPACE$",
67-
"parameters": {
68-
"source": "ScriptName",
69-
"steps": [
70-
{
71-
"regex": "[\\s+-]",
72-
"replacement": "_"
73-
}
74-
]
75-
}
76-
}
63+
"type": "derived",
64+
"valueSource": "ScriptName",
65+
"valueTransform": "invalidChars",
66+
"replaces": "$NAMESPACE$"
67+
}
68+
},
69+
"forms": {
70+
"invalidChars": {
71+
"identifier": "replace",
72+
"pattern": "([\\-_\\.\\ ])",
73+
"replacement": ""
74+
}
7775
},
7876
"guids": [
7977
"30ECB5E3-395D-4674-9EF8-8B07C6B1AD50",
@@ -87,7 +85,7 @@
8785
"2BF9AFEF-11BA-4037-827E-A7C4408DD5E0",
8886
"54EEBDD9-1D2F-41E5-9654-EB47544FF03D",
8987
"37D054BA-8A8F-489C-B707-D45D9F6AF17E",
90-
"F2683535-3B81-4454-9E99-120E5016BBCE"
88+
"F2683535-3B81-4454-9E99-120E5016BBCE"
9189
],
9290
"sources": [
9391
{

working/templates/connectorsolution/.template_config/template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"ConnectorName": {
1616
"type": "parameter",
1717
"datatype": "string",
18-
"defaultValue": "",
18+
"defaultValue": "Connector1",
1919
"replaces": "$CONNECTORNAME$",
2020
"description": "The name of the connector.",
2121
"isRequired": true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<DMSScript options="272" xmlns="http://www.skyline.be/automation">
3+
<Name>$SCRIPTNAME$</Name>
4+
<Description></Description>
5+
<Type>Automation</Type>
6+
<Author>$AUTHOR$</Author>
7+
<CheckSets>FALSE</CheckSets>
8+
<Folder></Folder>
9+
10+
<Protocols>
11+
</Protocols>
12+
13+
<Memory>
14+
</Memory>
15+
16+
<Parameters>
17+
</Parameters>
18+
19+
<Script>
20+
<Exe id="1" type="csharp">
21+
<Value><![CDATA[[Project:$SCRIPTNAME$_1]]]></Value>
22+
<!--<Param type="debug">true</Param>-->
23+
<Param type="preCompile">true</Param>
24+
<Param type="libraryName">$SCRIPTNAME$</Param>
25+
<Message></Message>
26+
</Exe>
27+
</Script>
28+
</DMSScript>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
namespace $NAMESPACE$_1
2+
{
3+
using System;
4+
using Skyline.DataMiner.Analytics.GenericInterface;
5+
6+
/// <summary>
7+
/// Represents a data source.
8+
/// See: https://aka.dataminer.services/gqi-external-data-source for a complete example.
9+
/// </summary>
10+
[GQIMetaData(Name = "$SCRIPTNAME$")]
11+
public sealed class $NAMESPACE$ : IGQIDataSource
12+
#if (IGQIOnInit)
13+
, IGQIOnInit
14+
#endif
15+
#if (IGQIInputArguments)
16+
, IGQIInputArguments
17+
#endif
18+
#if (IGQIOnPrepareFetch)
19+
, IGQIOnPrepareFetch
20+
#endif
21+
#if (IGQIUpdateable)
22+
, IGQIUpdateable
23+
#endif
24+
#if (IGQIOnDestroy)
25+
, IGQIOnDestroy
26+
#endif
27+
{
28+
#if (IGQIOnInit)
29+
public OnInitOutputArgs OnInit(OnInitInputArgs args)
30+
{
31+
// Initialize the data source
32+
// See: https://aka.dataminer.services/igqioninit-oninit
33+
return default;
34+
}
35+
36+
#endif
37+
#if (IGQIInputArguments)
38+
public GQIArgument[] GetInputArguments()
39+
{
40+
// Define data source input arguments
41+
// See: https://aka.dataminer.services/igqiinputarguments-getinputarguments
42+
return Array.Empty<GQIArgument>();
43+
}
44+
45+
public OnArgumentsProcessedOutputArgs OnArgumentsProcessed(OnArgumentsProcessedInputArgs args)
46+
{
47+
// Process input argument values
48+
// See: https://aka.dataminer.services/igqiinputarguments-onargumentsprocessed
49+
return default;
50+
}
51+
52+
#endif
53+
public GQIColumn[] GetColumns()
54+
{
55+
// Define data source columns
56+
// See: https://aka.dataminer.services/igqidatasource-getcolumns
57+
return Array.Empty<GQIColumn>();
58+
}
59+
#if (IGQIOnPrepareFetch)
60+
61+
public OnPrepareFetchOutputArgs OnPrepareFetch(OnPrepareFetchInputArgs args)
62+
{
63+
// Prepare data source for fetching
64+
// See: https://aka.dataminer.services/igqionpreparefetch-onpreparefetch
65+
return default;
66+
}
67+
#endif
68+
#if (IGQIUpdateable)
69+
70+
public void OnStartUpdates(IGQIUpdater updater)
71+
{
72+
// Enable the data source to send updates
73+
// See: https://aka.dataminer.services/igqiupdateable-onstartupdates
74+
}
75+
#endif
76+
77+
public GQIPage GetNextPage(GetNextPageInputArgs args)
78+
{
79+
// Define data source rows
80+
// See: https://aka.dataminer.services/igqidatasource-getnextpage
81+
return new GQIPage(Array.Empty<GQIRow>())
82+
{
83+
HasNextPage = false,
84+
};
85+
}
86+
#if (IGQIUpdateable)
87+
88+
public void OnStopUpdates()
89+
{
90+
// Stop sending updates
91+
// See: https://aka.dataminer.services/igqiupdateable-onstopupdates
92+
}
93+
#endif
94+
#if (IGQIOnDestroy)
95+
96+
public OnDestroyOutputArgs OnDestroy(OnDestroyInputArgs args)
97+
{
98+
// Clean up the data source
99+
// See: https://aka.dataminer.services/igqiondestroy-ondestroy
100+
return default;
101+
}
102+
#endif
103+
}
104+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net48</TargetFramework>
4+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
5+
</PropertyGroup>
6+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
7+
<DebugType>full</DebugType>
8+
<CodeAnalysisRuleSet>..\Internal\Code Analysis\qaction-debug.ruleset</CodeAnalysisRuleSet>
9+
</PropertyGroup>
10+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
11+
<DebugType>pdbonly</DebugType>
12+
<CodeAnalysisRuleSet>..\Internal\Code Analysis\qaction-release.ruleset</CodeAnalysisRuleSet>
13+
</PropertyGroup>
14+
<PropertyGroup>
15+
<DefineConstants>$(DefineConstants);DCFv1;DBInfo;ALARM_SQUASHING</DefineConstants>
16+
</PropertyGroup>
17+
<ItemGroup>
18+
<!--#if (IGQIUpdateable)-->
19+
<PackageReference Include="Skyline.DataMiner.Dev.Automation" Version="10.4.4.2" />
20+
<!--#else-->
21+
<PackageReference Include="Skyline.DataMiner.Dev.Automation" Version="10.2.5.5" />
22+
<!--#endif-->
23+
</ItemGroup>
24+
<ProjectExtensions>
25+
<VisualStudio>
26+
<UserProperties DisLinkedXmlFile="..\$SCRIPTNAME$.xml" DisProjectType="automationScriptProject" DisLinkId="1" />
27+
</VisualStudio>
28+
</ProjectExtensions>
29+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "http://json.schemastore.org/dotnetcli.host",
3+
"symbolInfo": {
4+
"ScriptName": {
5+
"longName": "ad-hoc-data-source-name",
6+
"shortName": "name"
7+
},
8+
"Author": {
9+
"longName": "author",
10+
"shortName": "auth"
11+
},
12+
"IGQIOnInit": {
13+
"shortName": "on-init"
14+
},
15+
"IGQIInputArguments": {
16+
"shortName": "input-arguments"
17+
},
18+
"IGQIOnPrepareFetch": {
19+
"shortName": "on-prepare-fetch"
20+
},
21+
"IGQIUpdateable": {
22+
"shortName": "updateable"
23+
},
24+
"IGQIOnDestroy": {
25+
"shortName": "on-destroy"
26+
}
27+
}
28+
}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"$schema": "http://json.schemastore.org/vs-2017.3.host",
3+
"order": 0,
4+
"icon": "icon.png",
5+
"symbolInfo": [
6+
{
7+
"id": "ScriptName",
8+
"name":
9+
{
10+
"text": "Ad Hoc Data Source Name"
11+
},
12+
"isVisible": true
13+
},
14+
{
15+
"id": "Author",
16+
"name":
17+
{
18+
"text": "Author"
19+
},
20+
"isVisible": true
21+
},
22+
{
23+
"id": "IGQIOnInit",
24+
"name":
25+
{
26+
"text": "Add the IGQIOnInit interface"
27+
},
28+
"isVisible": true
29+
},
30+
{
31+
"id": "IGQIInputArguments",
32+
"name":
33+
{
34+
"text": "Add the IGQIInputArguments interface"
35+
},
36+
"isVisible": true
37+
},
38+
{
39+
"id": "IGQIOnPrepareFetch",
40+
"name":
41+
{
42+
"text": "Add the IGQIOnPrepareFetch interface"
43+
},
44+
"isVisible": true
45+
},
46+
{
47+
"id": "IGQIUpdateable",
48+
"name":
49+
{
50+
"text": "Add the IGQIUpdateable interface"
51+
},
52+
"isVisible": true
53+
},
54+
{
55+
"id": "IGQIOnDestroy",
56+
"name":
57+
{
58+
"text": "Add the IGQIOnDestroy interface"
59+
},
60+
"isVisible": true
61+
}
62+
]
63+
}

0 commit comments

Comments
 (0)