Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions LICENSE_COMMERCIAL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
COMMERCIAL LICENSE
21 June 2020
16 April 2025

Preamble

Expand All @@ -20,10 +20,10 @@ program (sum of all instances) per month.

Programs are billed according to the following table

<100’000messages/month 0EUR/month
<1’000’000messages/month 50EUR/month
<10’000’000messages/month 100EUR/month
>10’000’000messages/month 200EUR/month
<100’000messages/month 0EUR/month
<1’000’000messages/month 500EUR/month
<10’000’000messages/month 1000EUR/month
>10’000’000messages/month 2000EUR/month

(plus taxes if applicable)

Expand All @@ -38,10 +38,11 @@ of rows copied is 50'000rows per month.
fee is 0EUR according to above table. No contract needs to be signed,
no invoices will be created.

Example 3: The program is started 20 times to process different Kafka
topics and partitions at speed, processing 5m records per month in
total. --> The program is used under this Commercial License and
100EUR/month are to be invoiced.
Example 3: The program is started in production 20 times to process
different Kafka topics and partitions at speed, processing 5m records
per month in total.
--> The program is used under this Commercial License and
1000EUR/month are to be invoiced.

Once an order is placed for a defined volume, rtdi.io GmbH (Austria,
Europe), as the copyright owner, will send invoices on a monthly basis
Expand Down
59 changes: 36 additions & 23 deletions README.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions WebContent/Controller.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ sap.ui.define([ "sap/ui/core/mvc/Controller"], function(Controller) {
return Controller.extend("io.rtdi.bigdata.rulesservice.Controller", {

onInit : function() {
var oModel = new sap.ui.model.json.JSONModel();
var statusbox = this.getView().byId("systemstatus");
oModel.attachRequestCompleted(function(event) {
if (event.getParameter("success")) {
statusbox.setVisible(true);
}
});
oModel.attachRequestFailed(function(event) {
var text = event.getParameter("responseText");
sap.m.MessageToast.show("Reading status info failed: " + text);
});
this.getView().setModel(oModel);
oModel.loadData("./rest/config/service");
},
onRefresh : function(event) {
var model = this.getView().getModel();
model.loadData("./rest/config/service");
}

});
Expand Down
8 changes: 5 additions & 3 deletions WebContent/View.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
<customHeader>
<OverflowToolbar>
<Text text="Settings" />
<ToolbarSpacer/>
<Button icon="sap-icon://refresh" press="onRefresh" />
</OverflowToolbar>
</customHeader>
<HBox>
<HBox id="systemstatus" visible="false" >
<ObjectStatus
text="Kafka"
inverted="true"
Expand Down Expand Up @@ -71,8 +73,8 @@
<VBox justifyContent="SpaceBetween" width="200px" height="150px" backgroundDesign="Solid" class="sapUiSmallMargin" tooltip="{tooltip}" >
<VBox class="sapUiSmallMargin">
<core:Icon src="sap-icon://order-status" class="sapUiTinyMarginBottom"/>
<Link text="Sample" href="ui5/Status.html" target="_blank" class="sapUiTinyMarginTop" />
<Text text="Rule status" wrapping="true"/>
<Link text="Status" href="ui5/Status.html" target="_blank" class="sapUiTinyMarginTop" />
<Text text="Status of each rule service" wrapping="true"/>
</VBox>
</VBox>
</HBox>
Expand Down
17 changes: 15 additions & 2 deletions WebContent/ui5/Config.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ function(Controller) {"use strict";
return Controller.extend("io.rtdi.bigdata.rulesservice.ui5.Config", {
onInit : function() {
var model = new sap.ui.model.json.JSONModel();
var statusbox = this.getView().byId("systemstatus");
model.attachRequestCompleted(function(event) {
if (event.getParameter("success")) {
statusbox.setVisible(true);
}
});
model.attachRequestFailed(function(event) {
var text = event.getParameter("responseText");
sap.m.MessageToast.show("Reading config failed: " + text);
});
model.loadData("../rest/config");
this.getView().setModel(model);
model.loadData("../rest/config");
},
onSave : function(event) {
var model = this.getView().getModel();
Expand All @@ -17,8 +23,11 @@ return Controller.extend("io.rtdi.bigdata.rulesservice.ui5.Config", {
var text = event.getParameter("responseText");
sap.m.MessageToast.show("Save failed: " + text);
});
post.attachRequestCompleted(function() {
post.attachRequestCompleted(function(event) {
console.log(post.getProperty("/"));
if (event.getParameter("success")) {
sap.m.MessageToast.show("Saved");
}
});
var json = JSON.stringify(model.getProperty("/"));
var headers = {
Expand All @@ -27,6 +36,10 @@ return Controller.extend("io.rtdi.bigdata.rulesservice.ui5.Config", {
post.loadData("../rest/config", json, true, "POST", false, true, headers);
model.loadData("../rest/config");
},
onRefresh : function(event) {
var model = this.getView().getModel();
model.loadData("../rest/config");
}
});
});

3 changes: 2 additions & 1 deletion WebContent/ui5/Config.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
<tnt:ToolHeader>
<Text text="Rulesservice" />
<ToolbarSpacer/>
<Button icon="sap-icon://refresh" press="onRefresh" />
<Button text="Save" press="onSave" visible="{/admin}" />
</tnt:ToolHeader>
</controls:header>
<controls:mainContents>
<VBox>
<Text text="{/errormessage}" />
<HBox>
<HBox id="systemstatus" visible="false" >
<ObjectStatus
text="Kafka"
inverted="true"
Expand Down
27 changes: 19 additions & 8 deletions WebContent/ui5/Rule.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,16 @@ return Controller.extend("io.rtdi.bigdata.rulesservice.ui5.Rule", {
var model = this.getView().getModel();
var newrulename = model.getProperty("/name");
var post = new sap.ui.model.json.JSONModel();
post.attachRequestCompleted(function() {
post.attachRequestCompleted(function(event) {
console.log(post.getProperty("/"));
if (rulename !== newrulename) {
const url = new URL(window.location)
url.searchParams.set("rule", newrulename);
url.searchParams.delete("new");
history.pushState(null, '', url);
if (event.getParameter("success")) {
if (rulename !== newrulename) {
const url = new URL(window.location)
url.searchParams.set("rule", newrulename);
url.searchParams.delete("new");
history.pushState(null, '', url);
}
sap.m.MessageToast.show("Saved");
}
});
post.attachRequestFailed(function(event) {
Expand All @@ -153,11 +156,14 @@ return Controller.extend("io.rtdi.bigdata.rulesservice.ui5.Rule", {
}
post.loadData("../rest/subjects/" + encodeURI(subjectname) + "/rules/" + rulename, json, true, "POST", false, true, headers);
},
onActivate : function(event) {
onActivate : function() {
var rulename = jQuery.sap.getUriParameters().get("rule");
var post = new sap.ui.model.json.JSONModel();
post.attachRequestCompleted(function() {
post.attachRequestCompleted(function(event) {
console.log(post.getProperty("/"));
if (event.getParameter("success")) {
sap.m.MessageToast.show("Activated");
}
});
post.attachRequestFailed(function(event) {
var text = event.getParameter("responseText");
Expand All @@ -176,6 +182,8 @@ return Controller.extend("io.rtdi.bigdata.rulesservice.ui5.Rule", {
editor.setValue(event.getParameter("value"));
editor.setEditable(true);
editor.data("path", rulepath + "/condition");
var label = this.getView().byId("formulaeditorlabel");
label.setText("Rule Formula for: " + rulepath);
},
onSubstituteChange: function(event) {
var source = event.getSource();
Expand All @@ -184,6 +192,8 @@ return Controller.extend("io.rtdi.bigdata.rulesservice.ui5.Rule", {
editor.setValue(event.getParameter("value"));
editor.setEditable(true);
editor.data("path", rulepath + "/substitute");
var label = this.getView().byId("formulaeditorlabel");
label.setText("Rule Formula for: " + rulepath);
},
onEditorChange: function(event) {
var source = event.getSource();
Expand Down Expand Up @@ -226,6 +236,7 @@ return Controller.extend("io.rtdi.bigdata.rulesservice.ui5.Rule", {
var successful = event.getParameter("success");
if (successful) {
model.setProperty("/rulesteps/" + stepindex + "/", stepmodel.getProperty("/"));
sap.m.MessageToast.show("Recalculated");
}
});
stepmodel.loadData("../rest/calculate/" + stepindex, json, true, "POST", false, true, headers);
Expand Down
11 changes: 5 additions & 6 deletions WebContent/ui5/Rule.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
<controls:FocusInput value="{condition}"
valueState="{= (${conditionerror} ? 'Error' : 'None') }"
valueStateText="{conditionerror}"
liveChange=".onConditionChange"
focusIn=".onConditionChange"
tooltip="{conditionerror}"
focusOut=".onConditionChange"
visible="{= ${type} === 'PrimitiveRule' }"
/>
</t:template>
Expand All @@ -137,9 +137,8 @@
<controls:FocusInput value="{substitute}"
valueState="{= (${substituteerror} ? 'Error' : 'None') }"
valueStateText="{substituteerror}"
tooltip="{substituteresult}"
liveChange=".onSubstituteChange"
focusIn=".onSubstituteChange"
tooltip="{substituteerror}"
focusOut=".onSubstituteChange"
visible="{= ${type} === 'PrimitiveRule' &amp;&amp; !!${fieldname} }"
/>
</t:template>
Expand All @@ -164,7 +163,7 @@
</items>
</TabContainer>
</Panel>
<Title id="formulaeditorlabel" text="Rule Formula"/>
<Title id="formulaeditorlabel" text="Rule Formula for:"/>
<ce:CodeEditor id="formulaeditor" type="text" editable="false" liveChange=".onEditorChange" >
<ce:layoutData>
<FlexItemData growFactor="1" />
Expand Down
4 changes: 4 additions & 0 deletions WebContent/ui5/Rules.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ return Controller.extend("io.rtdi.bigdata.rulesservice.ui5.Rules", {

var ruleurl = url.replace("Rules.html", "Rule.html?subject=" + encodeURI(subjectname) + rulelink);
window.open(ruleurl, "_blank");
},
onRefresh : function(event) {
var model = this.getView().getModel();
model.loadData("../rest/subjects");
}
});
});
Expand Down
2 changes: 2 additions & 0 deletions WebContent/ui5/Rules.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<controls:header>
<tnt:ToolHeader>
<Text text="Rulesservice" />
<ToolbarSpacer/>
<Button icon="sap-icon://refresh" press="onRefresh" />
</tnt:ToolHeader>
</controls:header>
<controls:mainContents>
Expand Down
33 changes: 33 additions & 0 deletions WebContent/ui5/Status.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,39 @@ return Controller.extend("io.rtdi.bigdata.rulesservice.ui5.Status", {
var oModel = new sap.ui.model.json.JSONModel();
oModel.loadData("../rest/config/service");
this.getView().setModel(oModel);
},
onRefresh : function(event) {
var model = this.getView().getModel();
model.loadData("../rest/config/service");
},
onStartStop : function(event) {
var model = this.getView().getModel();
var source = event.getSource();
var path = source.getBindingContext().getPath();
var servicename = model.getProperty(path + "/topicname"); // path.substring(path.lastIndexOf("/") + 1);
var status = model.getProperty(path + "/status"); // path.substring(path.lastIndexOf("/") - 1, path.lastIndexOf("/"));
var newstatustext = status === true ? "stopping" : "starting";
var post = new sap.ui.model.json.JSONModel();
post.attachRequestFailed(function(event) {
var text = event.getParameter("responseText");
sap.m.MessageToast.show(newstatustext + " failed: " + text);
});
post.attachRequestCompleted(function(event) {
console.log(post.getProperty("/"));
if (event.getParameter("success")) {
sap.m.MessageToast.show(newstatustext + " completed");
}
model.loadData("../rest/config/service");
});
var json = JSON.stringify(model.getProperty("/"));
var headers = {
"Content-Type": "application/json;charset=utf-8"
}
if (status === true) {
post.loadData("../rest/topics/stop/" + servicename, json, true, "POST", false, true, headers);
} else {
post.loadData("../rest/topics/start/" + servicename, json, true, "POST", false, true, headers);
}
}
});
});
Expand Down
18 changes: 17 additions & 1 deletion WebContent/ui5/Status.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<tnt:ToolHeader>
<Text text="Status" />
<ToolbarSpacer/>
<Button icon="sap-icon://refresh" press="onRefresh" />
</tnt:ToolHeader>
</controls:header>
<controls:mainContents>
Expand All @@ -25,7 +26,7 @@
items="{/topicstatus}"
width="100%"
height="100%">
<VBox justifyContent="SpaceBetween" width="200px" height="150px" backgroundDesign="Solid" class="sapUiSmallMargin" tooltip="{tooltip}" >
<VBox justifyContent="SpaceBetween" width="200px" height="200px" backgroundDesign="Solid" class="sapUiSmallMargin" tooltip="{tooltip}" >
<VBox class="sapUiSmallMargin">
<Text text="Topic: {topicname}" wrapping="true"/>
<ObjectNumber
Expand All @@ -43,12 +44,27 @@
unit="rows"
emphasized="false"
state="None" />
<ObjectNumber
number="{queuedrecords}"
unit="rows waiting"
emphasized="false"
state="None" />
<ObjectNumber
number="{rowspersecond}"
unit="rows/sec processed"
emphasized="false"
visible="{= ${rowspersecond} > 0 }"
state="None" />
<ObjectStatus
class="sapUiSmallMarginBottom"
text="{= ${status} === true ? 'Active' : 'Inactive' }"
inverted="true"
icon="{= ${status} === true ? 'sap-icon://sys-enter-2' : 'sap-icon://alert' }"
state="{= ${status} === true ? 'Success' : 'Warning' }" />
<Button
icon="{= ${status} === true ? 'sap-icon://stop' : 'sap-icon://restart' }"
press=".onStartStop"
type="Emphasized" />
</VBox>
</VBox>
</HBox>
Expand Down
19 changes: 18 additions & 1 deletion WebContent/ui5/Topics.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,34 @@ return Controller.extend("io.rtdi.bigdata.rulesservice.ui5.Topics", {
},
onSave : function(event) {
var model = this.getView().getModel();
var post = new sap.ui.model.json.JSONModel();
post.attachRequestFailed(function(event) {
var text = event.getParameter("responseText");
sap.m.MessageToast.show("Save failed: " + text);
});
post.attachRequestCompleted(function(event) {
console.log(post.getProperty("/"));
if (event.getParameter("success")) {
sap.m.MessageToast.show("Saved");
}
});
var json = JSON.stringify(model.getProperty("/"));
var headers = {
"Content-Type": "application/json;charset=utf-8"
}
model.loadData("../rest/topicrules", json, true, "POST", false, true, headers);
post.loadData("../rest/topicrules", json, true, "POST", false, true, headers);
},
onChange: function(event) {
var model = this.getView().getModel();
var context = event.getSource().getBindingContext();
var path = context.getPath();
model.setProperty(path + "/modified", true);
},
onRefresh : function(event) {
var model = this.getView().getModel();
model.loadData("../rest/topicrules");
var model2 = this.getView().getModel("rulegroups");
model2.loadData("../rest/rules");
}

});
Expand Down
1 change: 1 addition & 0 deletions WebContent/ui5/Topics.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<tnt:ToolHeader>
<Text text="Topic rules" />
<ToolbarSpacer/>
<Button icon="sap-icon://refresh" press="onRefresh" />
<Button text="Save" press="onSave" tooltip="Store the settings for each input topic as file"/>
</tnt:ToolHeader>
</controls:header>
Expand Down
Loading