"); // will carry the scrollbar
+
+ var outputtext = "";
+ var inputtext = oControl.getText();
+ if (inputtext) {
+ var json = JSON.parse(inputtext);
+ outputtext = json2html(json, oControl.getId(), undefined, oControl.getCollapsed());
+ }
+
+ oRm.write(outputtext);
+
+ oRm.write("
")
+ },
+
+ init : function() {
+ },
+
+ onAfterRendering : function(arguments) {
+ if (sap.ui.core.Control.prototype.onAfterRendering) {
+ sap.ui.core.Control.prototype.onAfterRendering.apply(this, arguments);
+ }
+ },
+
+ });
+
+ control.prototype.onclick = function (oEvent) {
+ var target1 = $(oEvent.target).siblings('ul.json-dict, ol.json-array');
+ var target2 = $(oEvent.target).siblings('.json-placeholder');
+ if (target1.length == 0 || target2.length == 0) {
+ // ignore
+ } else if (target1[0].style.display === 'none') {
+ target1[0].style.display = 'block';
+ target2[0].style.display = 'none';
+ } else {
+ target1[0].style.display = 'none';
+ target2[0].style.display = 'inline';
+ }
+ return false;
+ };
+
+ return control;
+});
diff --git a/WebContent/ui5/lib/RulesToolPage.js b/WebContent/ui5/lib/RulesToolPage.js
new file mode 100644
index 0000000..c0bb19c
--- /dev/null
+++ b/WebContent/ui5/lib/RulesToolPage.js
@@ -0,0 +1,59 @@
+sap.ui.define([
+ 'sap/tnt/ToolPage',
+ './library'
+], function(ToolPage) {
+ return ToolPage.extend("io.rtdi.bigdata.rulesservice.ui5.lib.RulesToolPage", {
+ metadata : {
+ properties : {
+ },
+ aggregations : {
+ },
+ events : {
+ }
+ },
+ renderer : {},
+ init : function() {
+ ToolPage.prototype.init.apply(this, arguments);
+ this.setAggregation("sideContent",
+ new sap.tnt.SideNavigation( {
+ id : "sideNavigation",
+ expanded: false,
+ item : new sap.tnt.NavigationList ( {
+ items: [
+ new sap.tnt.NavigationListItem({
+ text: "Home",
+ icon: "sap-icon://home",
+ href: "../index.html",
+ tooltip: "Home screen"
+ }),
+ new sap.tnt.NavigationListItem({
+ text: "Topics",
+ icon: "sap-icon://inventory",
+ href: "./Topics.html",
+ tooltip: "Rules applied to topic data"
+ }),
+ new sap.tnt.NavigationListItem({
+ text: "Rules",
+ icon: "sap-icon://document-text",
+ href: "./Rules.html",
+ tooltip: "List or create rules for a subject"
+ }),
+ new sap.tnt.NavigationListItem({
+ text: "Sample",
+ icon: "sap-icon://download",
+ href: "./Sample.html",
+ tooltip: "Generate sample data"
+ }),
+ new sap.tnt.NavigationListItem({
+ text: "Config",
+ icon: "sap-icon://wrench",
+ href: "./Config.html",
+ tooltip: "Configure the connections"
+ })
+ ]}
+ )
+ })
+ );
+ }
+ });
+});
diff --git a/WebContent/ui5/lib/library.js b/WebContent/ui5/lib/library.js
new file mode 100644
index 0000000..b388d98
--- /dev/null
+++ b/WebContent/ui5/lib/library.js
@@ -0,0 +1,32 @@
+sap.ui.define([
+ 'sap/ui/core/Lib',
+ 'sap/ui/core/library'
+ ], function(Library) {
+
+ "use strict";
+
+ /**
+ *
+ * @namespace
+ * @alias io.rtdi.bigdata.rulesservice.ui5.lib
+ * @author rtdi.io GmbH
+ * @public
+ */
+
+ const thisLib = Library.init({
+ version: "${version}",
+ name : "io.rtdi.bigdata.rulesservice.ui5.lib",
+ apiVersion: 2,
+ dependencies : ["sap.ui.core"],
+ types: [
+ ],
+ interfaces: [],
+ controls: [
+ "io.rtdi.bigdata.rulesservice.ui5.lib.FocusInput",
+ "io.rtdi.bigdata.rulesservice.ui5.lib.JSONViewer"
+ ],
+ elements: []
+ });
+
+ return thisLib;
+});
\ No newline at end of file
diff --git a/WebContent/ui5/lib/themes/sap_fiori_3/library.css b/WebContent/ui5/lib/themes/sap_fiori_3/library.css
new file mode 100644
index 0000000..680c4e5
--- /dev/null
+++ b/WebContent/ui5/lib/themes/sap_fiori_3/library.css
@@ -0,0 +1,45 @@
+/* Root element */
+.json-document {
+ padding: 1em 2em;
+}
+
+/* Syntax highlighting for JSON objects */
+ul.json-dict, ol.json-array {
+ list-style-type: none;
+ margin: 0 0 0 1px;
+ border-left: 1px dotted #ccc;
+ padding-left: 2em;
+}
+
+.json-string {
+ color: black;
+}
+
+.json-key {
+ color: blue;
+}
+
+.json-key-array {
+ color: blue;
+ cursor: row-resize;
+}
+
+.json-key-record {
+ color: blue;
+ cursor: row-resize;
+}
+
+.json-literal {
+ color: red;
+}
+
+/* Collapsable placeholder links */
+a.json-placeholder {
+ color: #aaa;
+ padding: 0 1em;
+ text-decoration: none;
+}
+
+a.json-placeholder:hover {
+ text-decoration: underline;
+}
\ No newline at end of file
diff --git a/docs/audit-schema.md b/docs/audit-schema.md
new file mode 100644
index 0000000..d81ad15
--- /dev/null
+++ b/docs/audit-schema.md
@@ -0,0 +1,98 @@
+This is the `__audit` field definition within the Avro schema.
+
+```
+ {
+ "__internal": true,
+ "__originalname": "__audit",
+ "default": null,
+ "doc": "If data is transformed this information is recorded here",
+ "name": "__audit",
+ "type": [
+ "null",
+ {
+ "__originalname": "__audit",
+ "doc": "If data is transformed this information is recorded here",
+ "fields": [
+ {
+ "__originalname": "__transformresult",
+ "doc": "Is the record PASS, FAILED or WARN?",
+ "name": "__transformresult",
+ "type": {
+ "length": 4,
+ "logicalType": "VARCHAR",
+ "type": "string"
+ }
+ },
+ {
+ "__originalname": "__details",
+ "default": null,
+ "doc": "Details of all transformations",
+ "name": "__details",
+ "type": [
+ "null",
+ {
+ "items": {
+ "__originalname": "__audit_details",
+ "doc": "Details of all transformations",
+ "fields": [
+ {
+ "__originalname": "__transformationname",
+ "doc": "A name identifying the applied transformation",
+ "name": "__transformationname",
+ "type": {
+ "length": 1024,
+ "logicalType": "NVARCHAR",
+ "type": "string"
+ }
+ },
+ {
+ "__originalname": "__transformresult",
+ "doc": "Is the record PASS, FAIL or WARN?",
+ "name": "__transformresult",
+ "type": {
+ "length": 4,
+ "logicalType": "VARCHAR",
+ "type": "string"
+ }
+ },
+ {
+ "__originalname": "__transformresult_text",
+ "doc": "Transforms can optionally describe what they did",
+ "name": "__transformresult_text",
+ "type": [
+ "null",
+ {
+ "length": 1024,
+ "logicalType": "NVARCHAR",
+ "type": "string"
+ }
+ ]
+ },
+ {
+ "__originalname": "__transformresult_quality",
+ "doc": "Transforms can optionally return a percent value from 0 (FAIL) to 100 (PASS)",
+ "name": "__transformresult_quality",
+ "type": [
+ "null",
+ {
+ "logicalType": "BYTE",
+ "type": "int"
+ }
+ ]
+ }
+ ],
+ "name": "__audit_details",
+ "type": "record"
+ },
+ "type": "array"
+ }
+ ]
+ }
+ ],
+ "name": "__audit",
+ "namespace": "",
+ "type": "record"
+ }
+ ]
+ }
+```
\ No newline at end of file
diff --git a/docs/media/Config.png b/docs/media/Config.png
new file mode 100644
index 0000000..550521f
Binary files /dev/null and b/docs/media/Config.png differ
diff --git a/docs/media/Rule.png b/docs/media/Rule.png
new file mode 100644
index 0000000..a6a4370
Binary files /dev/null and b/docs/media/Rule.png differ
diff --git a/docs/media/RulesService-RuleResult.png b/docs/media/RuleResult.png
similarity index 100%
rename from docs/media/RulesService-RuleResult.png
rename to docs/media/RuleResult.png
diff --git a/docs/media/RulesService-PipelineConfig.png b/docs/media/RulesService-PipelineConfig.png
deleted file mode 100644
index c1fc8a6..0000000
Binary files a/docs/media/RulesService-PipelineConfig.png and /dev/null differ
diff --git a/docs/media/RulesService-RuleDefinition-Level1.png b/docs/media/RulesService-RuleDefinition-Level1.png
deleted file mode 100644
index ef7c91a..0000000
Binary files a/docs/media/RulesService-RuleDefinition-Level1.png and /dev/null differ
diff --git a/docs/media/RulesService-RuleDefinition-Level2.png b/docs/media/RulesService-RuleDefinition-Level2.png
deleted file mode 100644
index 87f2896..0000000
Binary files a/docs/media/RulesService-RuleDefinition-Level2.png and /dev/null differ
diff --git a/docs/media/RulesService-RuleDefinition-Level3.png b/docs/media/RulesService-RuleDefinition-Level3.png
deleted file mode 100644
index dd14b32..0000000
Binary files a/docs/media/RulesService-RuleDefinition-Level3.png and /dev/null differ
diff --git a/docs/media/RulesService-RuleInstances.png b/docs/media/RulesService-RuleInstances.png
deleted file mode 100644
index 7337210..0000000
Binary files a/docs/media/RulesService-RuleInstances.png and /dev/null differ
diff --git a/docs/media/SampleData.png b/docs/media/SampleData.png
new file mode 100644
index 0000000..093dd7b
Binary files /dev/null and b/docs/media/SampleData.png differ
diff --git a/docs/media/Topics.png b/docs/media/Topics.png
new file mode 100644
index 0000000..2af57ed
Binary files /dev/null and b/docs/media/Topics.png differ
diff --git a/docs/rule-syntax.md b/docs/rule-syntax.md
new file mode 100644
index 0000000..986a447
--- /dev/null
+++ b/docs/rule-syntax.md
@@ -0,0 +1 @@
+Note: The library used here is [Apache JEXL](https://commons.apache.org/proper/commons-jexl/reference/syntax.html).
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index a2e8273..361ce68 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,11 +4,15 @@