You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2020/08/04 18:42:42 UTC
[incubator-streampipes] branch STREAMPIPES-145 updated (d5cdb8f ->
35874b1)
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a change to branch STREAMPIPES-145
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git.
from d5cdb8f Fix add timestamp rule
new a2bc6d7 Working on add transformation rule
new 18d8add Fix add static propty rule in schema editor
new 35874b1 Fix add nested property rule
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../rules/TransformationRuleDescription.java | 4 ++
.../SchemaTransformationRuleDescription.java | 6 ---
.../edit-event-property-primitive.component.html | 10 +++--
.../edit-event-property-primitive.component.ts | 4 ++
.../edit-event-property.component.ts | 3 ++
.../event-schema/event-schema.component.ts | 5 ++-
ui/src/app/connect/transformation-rule.service.ts | 15 +++----
ui/src/app/core-model/gen/streampipes-model.ts | 50 +++++-----------------
8 files changed, 39 insertions(+), 58 deletions(-)
[incubator-streampipes] 02/03: Fix add static propty rule in schema
editor
Posted by ze...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch STREAMPIPES-145
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit 18d8addc58068a6ea5e65391db78a80f1d2d7dc7
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Tue Aug 4 20:16:37 2020 +0200
Fix add static propty rule in schema editor
---
.../rules/TransformationRuleDescription.java | 4 ++
.../SchemaTransformationRuleDescription.java | 6 ---
ui/src/app/connect/transformation-rule.service.ts | 15 +++----
ui/src/app/core-model/gen/streampipes-model.ts | 50 +++++-----------------
4 files changed, 22 insertions(+), 53 deletions(-)
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/TransformationRuleDescription.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/TransformationRuleDescription.java
index e99b32e..48cbbf8 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/TransformationRuleDescription.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/TransformationRuleDescription.java
@@ -52,6 +52,10 @@ import javax.persistence.Entity;
@JsonSubTypes.Type(DeleteRuleDescription.class),
@JsonSubTypes.Type(RenameRuleDescription.class),
@JsonSubTypes.Type(MoveRuleDescription.class),
+ @JsonSubTypes.Type(CreateNestedRuleDescription.class),
+ @JsonSubTypes.Type(DeleteRuleDescription.class),
+ @JsonSubTypes.Type(RenameRuleDescription.class),
+ @JsonSubTypes.Type(MoveRuleDescription.class),
})
public abstract class TransformationRuleDescription extends UnnamedStreamPipesEntity {
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/schema/SchemaTransformationRuleDescription.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/schema/SchemaTransformationRuleDescription.java
index 45a5b9b..51b3cbf 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/schema/SchemaTransformationRuleDescription.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/schema/SchemaTransformationRuleDescription.java
@@ -21,12 +21,6 @@ package org.apache.streampipes.model.connect.rules.schema;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import org.apache.streampipes.model.connect.rules.TransformationRuleDescription;
-@JsonSubTypes({
- @JsonSubTypes.Type(CreateNestedRuleDescription.class),
- @JsonSubTypes.Type(DeleteRuleDescription.class),
- @JsonSubTypes.Type(RenameRuleDescription.class),
- @JsonSubTypes.Type(MoveRuleDescription.class),
-})
public abstract class SchemaTransformationRuleDescription extends TransformationRuleDescription {
public SchemaTransformationRuleDescription() {
diff --git a/ui/src/app/connect/transformation-rule.service.ts b/ui/src/app/connect/transformation-rule.service.ts
index 99c6ac4..0070e93 100644
--- a/ui/src/app/connect/transformation-rule.service.ts
+++ b/ui/src/app/connect/transformation-rule.service.ts
@@ -73,7 +73,7 @@ export class TransformationRuleService {
for (const ep of staticValueProperties) {
this.oldEventSchema.eventProperties.push(ep);
const rule: AddValueTransformationRuleDescription = new AddValueTransformationRuleDescription();
- rule['class'] = 'org.apache.streampipes.model.connect.rules.value.AddValueTransformationRuleDescription';
+ rule['@class'] = 'org.apache.streampipes.model.connect.rules.value.AddValueTransformationRuleDescription';
rule.runtimeKey = ep.runtimeName;
rule.staticValue = (ep as any).staticValue;
transformationRuleDescription.push(rule);
@@ -143,7 +143,7 @@ export class TransformationRuleService {
keyOfOldValue = keyOldPrefix + '.' + keyNew.substr(keyNew.lastIndexOf('.') + 1, keyNew.length);
}
const rule: MoveRuleDescription = new MoveRuleDescription();
- rule['class'] = 'org.apache.streampipes.model.connect.rules.schema.MoveRuleDescription';
+ rule['@class'] = 'org.apache.streampipes.model.connect.rules.schema.MoveRuleDescription';
rule.oldRuntimeKey = keyOfOldValue;
rule.newRuntimeKey = keyNewPrefix;
result.push(rule);
@@ -169,7 +169,7 @@ export class TransformationRuleService {
if (allOldIds.indexOf(id) === -1) {
const key = this.getCompleteRuntimeNameKey(newEventSchema.eventProperties, id);
const rule: CreateNestedRuleDescription = new CreateNestedRuleDescription();
- rule['class'] = 'org.apache.streampipes.model.connect.rules.schema.CreateNestedRuleDescription';
+ rule['@class'] = 'org.apache.streampipes.model.connect.rules.schema.CreateNestedRuleDescription';
rule.runtimeKey = key;
result.push(rule);
}
@@ -190,12 +190,11 @@ export class TransformationRuleService {
const keyNew = this.getCompleteRuntimeNameKey(newEventSchema.eventProperties, eventProperty.elementId);
const renameRule: RenameRuleDescription = new RenameRuleDescription();
- renameRule['class'] = 'org.apache.streampipes.model.connect.rules.schema.RenameRuleDescription';
+ renameRule['@class'] = 'org.apache.streampipes.model.connect.rules.schema.RenameRuleDescription';
renameRule.oldRuntimeKey = keyOld;
renameRule.newRuntimeKey = keyNew;
result.push(renameRule);
if (eventProperty instanceof EventPropertyNested) {
-
const tmpResults: RenameRuleDescription[] = this.getRenameRules((<EventPropertyNested> eventProperty).eventProperties, oldEventSchema, newEventSchema);
result = result.concat(tmpResults);
@@ -204,7 +203,7 @@ export class TransformationRuleService {
var filteredResult: RenameRuleDescription[] = [];
for (let res of result) {
- if (this.getRuntimeNameKey(res.newRuntimeKey) != this.getRuntimeNameKey(res.oldRuntimeKey) && res.oldRuntimeKey) {
+ if (this.getRuntimeNameKey(res.newRuntimeKey) !== this.getRuntimeNameKey(res.oldRuntimeKey) && res.oldRuntimeKey) {
filteredResult.push(res);
}
}
@@ -269,7 +268,7 @@ export class TransformationRuleService {
//let unitTransformation: UnitTransformRuleDescription = new UnitTransformRuleDescription();
//unitTransformation.fromUnitRessourceURL = eventPropertyPrimitive.
const rule: UnitTransformRuleDescription = new UnitTransformRuleDescription();
- rule['class'] = 'org.apache.streampipes.model.connect.rules.value.UnitTransformRuleDescription';
+ rule['@class'] = 'org.apache.streampipes.model.connect.rules.value.UnitTransformRuleDescription';
rule.runtimeKey = keyNew;
rule.fromUnitRessourceURL = (eventPropertyPrimitive as any).oldMeasurementUnit;
rule.toUnitRessourceURL = (eventPropertyPrimitive as any).measurementUnitTmp
@@ -417,7 +416,7 @@ export class TransformationRuleService {
if (this.isTimestampProperty(eventPropertyPrimitive)) {
const rule: TimestampTranfsformationRuleDescription = new TimestampTranfsformationRuleDescription();
- rule['class'] = 'org.apache.streampipes.model.connect.rules.value.TimestampTranfsformationRuleDescription';
+ rule['@class'] = 'org.apache.streampipes.model.connect.rules.value.TimestampTranfsformationRuleDescription';
rule.runtimeKey = keyNew;
rule.mode = (eventProperty as any).timestampTransformationMode;
rule.formatString = (eventProperty as any).timestampTransformationFormatString;
diff --git a/ui/src/app/core-model/gen/streampipes-model.ts b/ui/src/app/core-model/gen/streampipes-model.ts
index a6e2d2d..5a21d8d 100644
--- a/ui/src/app/core-model/gen/streampipes-model.ts
+++ b/ui/src/app/core-model/gen/streampipes-model.ts
@@ -1,25 +1,7 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
-// Generated using typescript-generator version 2.24.612 on 2020-07-31 21:29:23.
+// Generated using typescript-generator version 2.24.612 on 2020-08-04 20:08:43.
export class AbstractStreamPipesEntity {
"@class": "org.apache.streampipes.model.base.NamedStreamPipesEntity" | "org.apache.streampipes.model.connect.adapter.AdapterDescription" | "org.apache.streampipes.model.connect.adapter.AdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.GenericAdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.SpecificAdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.AdapterStreamDescription" | "org.apache.streampipes.model.connect.adapter.G [...]
@@ -337,6 +319,14 @@ export class TransformationRuleDescription extends UnnamedStreamPipesEntity {
return RenameRuleDescription.fromData(data);
case "org.apache.streampipes.model.connect.rules.schema.MoveRuleDescription":
return MoveRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.schema.CreateNestedRuleDescription":
+ return CreateNestedRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.schema.DeleteRuleDescription":
+ return DeleteRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.schema.RenameRuleDescription":
+ return RenameRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.schema.MoveRuleDescription":
+ return MoveRuleDescription.fromData(data);
}
}
}
@@ -656,22 +646,6 @@ export class SchemaTransformationRuleDescription extends TransformationRuleDescr
super.fromData(data, instance);
return instance;
}
-
- static fromDataUnion(data: SchemaTransformationRuleDescriptionUnion): SchemaTransformationRuleDescriptionUnion {
- if (!data) {
- return data;
- }
- switch (data["@class"]) {
- case "org.apache.streampipes.model.connect.rules.schema.CreateNestedRuleDescription":
- return CreateNestedRuleDescription.fromData(data);
- case "org.apache.streampipes.model.connect.rules.schema.DeleteRuleDescription":
- return DeleteRuleDescription.fromData(data);
- case "org.apache.streampipes.model.connect.rules.schema.RenameRuleDescription":
- return RenameRuleDescription.fromData(data);
- case "org.apache.streampipes.model.connect.rules.schema.MoveRuleDescription":
- return MoveRuleDescription.fromData(data);
- }
- }
}
export class CreateNestedRuleDescription extends SchemaTransformationRuleDescription {
@@ -1563,9 +1537,9 @@ export class GenericAdapterSetDescription extends AdapterSetDescription implemen
}
const instance = target || new GenericAdapterSetDescription();
super.fromData(data, instance);
+ instance.formatDescription = FormatDescription.fromData(data.formatDescription);
instance.eventSchema = EventSchema.fromData(data.eventSchema);
instance.protocolDescription = ProtocolDescription.fromData(data.protocolDescription);
- instance.formatDescription = FormatDescription.fromData(data.formatDescription);
return instance;
}
}
@@ -1582,9 +1556,9 @@ export class GenericAdapterStreamDescription extends AdapterStreamDescription im
}
const instance = target || new GenericAdapterStreamDescription();
super.fromData(data, instance);
+ instance.formatDescription = FormatDescription.fromData(data.formatDescription);
instance.eventSchema = EventSchema.fromData(data.eventSchema);
instance.protocolDescription = ProtocolDescription.fromData(data.protocolDescription);
- instance.formatDescription = FormatDescription.fromData(data.formatDescription);
return instance;
}
}
@@ -2762,8 +2736,6 @@ export type OneOfStaticPropertyUnion = RuntimeResolvableOneOfStaticProperty;
export type OutputStrategyUnion = AppendOutputStrategy | CustomOutputStrategy | CustomTransformOutputStrategy | FixedOutputStrategy | KeepOutputStrategy | ListOutputStrategy | TransformOutputStrategy | UserDefinedOutputStrategy;
-export type SchemaTransformationRuleDescriptionUnion = CreateNestedRuleDescription | DeleteRuleDescription | RenameRuleDescription | MoveRuleDescription;
-
export type SelectionStaticPropertyUnion = AnyStaticProperty | OneOfStaticProperty;
export type SpDataStreamUnion = SpDataStream | SpDataSet;
[incubator-streampipes] 03/03: Fix add nested property rule
Posted by ze...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch STREAMPIPES-145
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit 35874b18027232f89d7ccb995859c5cc4fd2ac54
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Tue Aug 4 20:41:36 2020 +0200
Fix add nested property rule
---
ui/src/app/connect/schema-editor/event-schema/event-schema.component.ts | 1 +
1 file changed, 1 insertion(+)
diff --git a/ui/src/app/connect/schema-editor/event-schema/event-schema.component.ts b/ui/src/app/connect/schema-editor/event-schema/event-schema.component.ts
index d57cd57..da7b58d 100644
--- a/ui/src/app/connect/schema-editor/event-schema/event-schema.component.ts
+++ b/ui/src/app/connect/schema-editor/event-schema/event-schema.component.ts
@@ -125,6 +125,7 @@ export class EventSchemaComponent implements OnChanges {
nested['@class'] = 'org.apache.streampipes.model.schema.EventPropertyNested';
nested.elementId = uuid;
nested.eventProperties = [];
+ nested.domainProperties = [];
if (!eventProperty) {
this.eventSchema.eventProperties.push(nested);
} else {
[incubator-streampipes] 01/03: Working on add transformation rule
Posted by ze...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch STREAMPIPES-145
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit a2bc6d7ffc11146fdccebcfeb5bf0c2aadc641f3
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Mon Aug 3 22:37:06 2020 +0200
Working on add transformation rule
---
.../edit-event-property-primitive.component.html | 10 ++++++----
.../edit-event-property-primitive.component.ts | 4 ++++
.../edit-event-property/edit-event-property.component.ts | 3 +++
.../schema-editor/event-schema/event-schema.component.ts | 4 +++-
4 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-event-property-primitive/edit-event-property-primitive.component.html b/ui/src/app/connect/dialog/edit-event-property/components/edit-event-property-primitive/edit-event-property-primitive.component.html
index e84b175..b272966 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-event-property-primitive/edit-event-property-primitive.component.html
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-event-property-primitive/edit-event-property-primitive.component.html
@@ -34,9 +34,11 @@
[showUnitTransformation]="!hideUnitTransformation">
</sp-edit-unit-transformation>
- <mat-form-field *ngIf="staticValueAddedByUser()" class="doubleWidth">
- <input matInput placeholder="Static Value" name="static_value" id="static_value"
- [(ngModel)]="cachedProperty.staticValue">
- </mat-form-field>
+ <div fxLayout="row" fxLayoutAlign="start" *ngIf="addedByUser">
+ <mat-form-field class="doubleWidth">
+ <input matInput placeholder="Static Value" name="static_value" id="static_value"
+ [(ngModel)]="cachedProperty.staticValue">
+ </mat-form-field>
+ </div>
</div>
\ No newline at end of file
diff --git a/ui/src/app/connect/dialog/edit-event-property/components/edit-event-property-primitive/edit-event-property-primitive.component.ts b/ui/src/app/connect/dialog/edit-event-property/components/edit-event-property-primitive/edit-event-property-primitive.component.ts
index 8b098f4..e974016 100644
--- a/ui/src/app/connect/dialog/edit-event-property/components/edit-event-property-primitive/edit-event-property-primitive.component.ts
+++ b/ui/src/app/connect/dialog/edit-event-property/components/edit-event-property-primitive/edit-event-property-primitive.component.ts
@@ -32,11 +32,15 @@ export class EditEventPropertyPrimitiveComponent implements OnInit {
hideUnitTransformation: boolean;
+ addedByUser: boolean;
+
constructor(private dataTypesService: DataTypesService) {
}
ngOnInit(): void {
this.setShowUnitTransformation();
+ this.addedByUser = this.staticValueAddedByUser();
+ this.cachedProperty.staticValue = '';
}
setShowUnitTransformation() {
diff --git a/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.ts b/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.ts
index f5bd7e1..45e6aef 100644
--- a/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.ts
+++ b/ui/src/app/connect/dialog/edit-event-property/edit-event-property.component.ts
@@ -84,6 +84,8 @@ export class EditEventPropertyComponent implements OnInit {
(result as any).timestampTransformationMode = (ep as any).timestampTransformationMode;
(result as any).timestampTransformationFormatString = (ep as any).timestampTransformationFormatString;
(result as any).timestampTransformationMultiplier = (ep as any).timestampTransformationMultiplier;
+
+ (result as any).staticValue = (ep as any).staticValue;
return result;
} else if (ep instanceof EventPropertyNested) {
return EventPropertyNested.fromData(ep as EventPropertyNested, new EventPropertyNested());
@@ -140,6 +142,7 @@ export class EditEventPropertyComponent implements OnInit {
(this.property as any).timestampTransformationFormatString = (this.cachedProperty as any).timestampTransformationFormatString;
(this.property as any).timestampTransformationMultiplier = (this.cachedProperty as any).timestampTransformationMultiplier;
+ (this.property as any).staticValue = (this.cachedProperty as any).staticValue;
}
this.dialogRef.close({ data: this.property});
}
diff --git a/ui/src/app/connect/schema-editor/event-schema/event-schema.component.ts b/ui/src/app/connect/schema-editor/event-schema/event-schema.component.ts
index 28105c4..d57cd57 100644
--- a/ui/src/app/connect/schema-editor/event-schema/event-schema.component.ts
+++ b/ui/src/app/connect/schema-editor/event-schema/event-schema.component.ts
@@ -151,10 +151,12 @@ export class EventSchemaComponent implements OnChanges {
public addStaticValueProperty(): void {
const eventProperty = new EventPropertyPrimitive();
eventProperty['@class'] = 'org.apache.streampipes.model.schema.EventPropertyPrimitive';
- eventProperty.elementId = 'staticValue/' + UUID.UUID();
+ eventProperty.elementId = 'http://eventProperty.de/staticValue/' + UUID.UUID();
eventProperty.runtimeName = 'key_0';
+ (eventProperty as any).staticValue = '';
eventProperty.runtimeType = this.dataTypesService.getStringTypeUrl();
+ eventProperty.domainProperties = [];
this.eventSchema.eventProperties.push(eventProperty);
this.refreshTree();