You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2020/07/19 18:53:49 UTC
[incubator-streampipes] branch STREAMPIPES-145 updated (4969fa8 ->
2214749)
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a change to branch STREAMPIPES-145
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git.
from 4969fa8 [STREAMPIPES-145] Add documentation feature to customize dialog
new f968392 [STREAMPIPES-145] Fix bug in pipeine assembly options
new 2214749 [STREAMPIPES-145] Change serializer of dashboard models
The 2 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:
streampipes-model-client/pom.xml | 2 +-
streampipes-model/pom.xml | 2 +-
.../model/dashboard/DashboardEntity.java | 3 +
.../model/dashboard/DashboardModel.java | 11 +-
.../model/dashboard/DashboardWidgetModel.java | 2 +
.../model/dashboard/DashboardWidgetSettings.java | 13 +-
.../model/dashboard/VisualizablePipeline.java | 12 ++
.../streampipes/rest/impl/dashboard/Dashboard.java | 2 +-
.../rest/impl/dashboard/DashboardWidget.java | 33 ++-
.../rest/impl/dashboard/VisualizablePipeline.java | 25 ++-
.../connect/static-properties/input.validator.ts | 3 -
.../app/core-model/gen/streampipes-model-client.ts | 18 ++
ui/src/app/core-model/gen/streampipes-model.ts | 230 ++++++++++++++++++++-
.../components/grid/dashboard-grid.component.ts | 6 +-
.../components/panel/dashboard-panel.component.ts | 8 +-
.../widget/dashboard-widget.component.ts | 10 +-
.../components/widgets/base/base-config.ts | 2 +-
.../widgets/base/base-ngx-charts-widget.ts | 2 -
.../widgets/base/base-ngx-line-config.ts | 2 +-
.../components/widgets/base/base-widget.ts | 8 +-
.../components/widgets/gauge/gauge-config.ts | 2 +-
.../components/widgets/html/html-config.ts | 2 +-
.../components/widgets/image/image-config.ts | 2 +-
.../dashboard/components/widgets/map/map-config.ts | 2 +-
.../components/widgets/number/number-config.ts | 2 +-
.../components/widgets/pallet/pallet-config.ts | 2 +-
.../dashboard/components/widgets/raw/raw-config.ts | 2 +-
.../components/widgets/table/table-config.ts | 2 +-
.../widgets/trafficlight/traffic-light-config.ts | 2 +-
.../add-visualization-dialog.component.html | 5 +-
.../add-visualization-dialog.component.ts | 60 +++---
.../dashboard/registry/widget-config-builder.ts | 13 +-
ui/src/app/dashboard/registry/widget-registry.ts | 7 +-
.../dashboard/sdk/collected-schema-requirements.ts | 14 +-
ui/src/app/dashboard/sdk/ep-requirements.ts | 32 +--
.../sdk/extractor/static-property-extractor.ts | 21 +-
.../sdk/matching/domain-property-match.ts | 10 +-
.../sdk/matching/mapping-property-generator.ts | 4 +-
.../sdk/matching/primitive-property-match.ts | 4 +-
.../app/dashboard/sdk/matching/property-match.ts | 8 +-
ui/src/app/dashboard/sdk/matching/schema-match.ts | 2 +-
.../dashboard/sdk/schema-requirements-builder.ts | 36 ++--
ui/src/app/dashboard/services/dashboard.service.ts | 87 +++-----
.../pipeline-assembly.component.html | 12 +-
.../pipeline-assembly.component.ts | 2 -
.../app/platform-services/apis/pipeline.service.ts | 9 +-
46 files changed, 490 insertions(+), 248 deletions(-)
[incubator-streampipes] 01/02: [STREAMPIPES-145] Fix bug in pipeine
assembly options
Posted by ri...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch STREAMPIPES-145
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit f968392dea321565e55b20d5b02d912a013cd806
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Sat Jul 18 22:17:25 2020 +0200
[STREAMPIPES-145] Fix bug in pipeine assembly options
---
.../pipeline-assembly/pipeline-assembly.component.html | 12 ++++++------
.../pipeline-assembly/pipeline-assembly.component.ts | 2 --
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/ui/src/app/editor-v2/components/pipeline-assembly/pipeline-assembly.component.html b/ui/src/app/editor-v2/components/pipeline-assembly/pipeline-assembly.component.html
index 90177ad..6fe56a1 100644
--- a/ui/src/app/editor-v2/components/pipeline-assembly/pipeline-assembly.component.html
+++ b/ui/src/app/editor-v2/components/pipeline-assembly/pipeline-assembly.component.html
@@ -20,34 +20,34 @@
<div class="assemblyOptions sp-blue-bg">
<div fxFlex="100" fxLayout="row" fxLayoutAlign="start center">
<button mat-button matTooltip="Save Pipeline" [matTooltipPosition]="'above'"
- style="display:flex;align-items:center;" class="md-button settings-bar-icon-button"
+ style="display:flex;align-items:center;" class="settings-bar-icon-button"
[disabled]="!PipelineValidationService.pipelineValid"
(click)="submit()" type="submit">
<mat-icon>save</mat-icon> <span>Save pipeline</span>
</button>
<button mat-button matTooltip="Pan" [matTooltipPosition]="'above'"
- class="md-icon-button settings-bar-icon-button"
+ class="settings-bar-icon-button"
[disabled]="!selectMode"
(click)="toggleSelectMode()">
<i class="material-icons">open_with</i>
</button>
<button mat-button matTooltip="Select" [matTooltipPosition]="'above'"
- class="md-icon-button settings-bar-icon-button" [disabled]="selectMode"
+ class="settings-bar-icon-button" [disabled]="selectMode"
(click)="toggleSelectMode()">
<i class="material-icons">mode_edit</i>
</button>
<button mat-button matTooltip="Zoom In" [matTooltipPosition]="'above'"
- class="md-icon-button settings-bar-icon-button" [disabled]="currentZoomLevel == 1"
+ class="settings-bar-icon-button" [disabled]="currentZoomLevel == 1"
(click)="zoomIn()">
<i class="material-icons">zoom_in</i>
</button>
<button mat-button matTooltip="Zoom Out" [matTooltipPosition]="'above'"
- class="md-icon-button settings-bar-icon-button" [disabled]="currentZoomLevel == 0.5"
+ class="settings-bar-icon-button" [disabled]="currentZoomLevel == 0.5"
(click)="zoomOut()">
<i class="material-icons">zoom_out</i>
</button>
<button mat-button matTooltip="Auto Layout" [matTooltipPosition]="'above'"
- class="md-icon-button settings-bar-icon-button" (click)="autoLayout()">
+ class="settings-bar-icon-button" (click)="autoLayout()">
<i class="material-icons">settings_overscan</i>
</button>
<div fxLayout="column" fxLayoutAlign="start center" class="pipeline-cache-block">
diff --git a/ui/src/app/editor-v2/components/pipeline-assembly/pipeline-assembly.component.ts b/ui/src/app/editor-v2/components/pipeline-assembly/pipeline-assembly.component.ts
index 62c5689..4bbf6c3 100644
--- a/ui/src/app/editor-v2/components/pipeline-assembly/pipeline-assembly.component.ts
+++ b/ui/src/app/editor-v2/components/pipeline-assembly/pipeline-assembly.component.ts
@@ -120,12 +120,10 @@ export class PipelineAssemblyComponent implements OnInit {
toggleSelectMode() {
if (this.selectMode) {
($("#assembly") as any).panzoom("option", "disablePan", false);
- ($("#assembly") as any).selectable("disable");
this.selectMode = false;
}
else {
($("#assembly") as any).panzoom("option", "disablePan", true);
- ($("#assembly") as any).selectable("enable");
this.selectMode = true;
}
}
[incubator-streampipes] 02/02: [STREAMPIPES-145] Change serializer
of dashboard models
Posted by ri...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch STREAMPIPES-145
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit 2214749eac0cf090af59f2ff958ee23af080025c
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Sun Jul 19 20:53:29 2020 +0200
[STREAMPIPES-145] Change serializer of dashboard models
---
streampipes-model-client/pom.xml | 2 +-
streampipes-model/pom.xml | 2 +-
.../model/dashboard/DashboardEntity.java | 3 +
.../model/dashboard/DashboardModel.java | 11 +-
.../model/dashboard/DashboardWidgetModel.java | 2 +
.../model/dashboard/DashboardWidgetSettings.java | 13 +-
.../model/dashboard/VisualizablePipeline.java | 12 ++
.../streampipes/rest/impl/dashboard/Dashboard.java | 2 +-
.../rest/impl/dashboard/DashboardWidget.java | 33 ++-
.../rest/impl/dashboard/VisualizablePipeline.java | 25 ++-
.../connect/static-properties/input.validator.ts | 3 -
.../app/core-model/gen/streampipes-model-client.ts | 18 ++
ui/src/app/core-model/gen/streampipes-model.ts | 230 ++++++++++++++++++++-
.../components/grid/dashboard-grid.component.ts | 6 +-
.../components/panel/dashboard-panel.component.ts | 8 +-
.../widget/dashboard-widget.component.ts | 10 +-
.../components/widgets/base/base-config.ts | 2 +-
.../widgets/base/base-ngx-charts-widget.ts | 2 -
.../widgets/base/base-ngx-line-config.ts | 2 +-
.../components/widgets/base/base-widget.ts | 8 +-
.../components/widgets/gauge/gauge-config.ts | 2 +-
.../components/widgets/html/html-config.ts | 2 +-
.../components/widgets/image/image-config.ts | 2 +-
.../dashboard/components/widgets/map/map-config.ts | 2 +-
.../components/widgets/number/number-config.ts | 2 +-
.../components/widgets/pallet/pallet-config.ts | 2 +-
.../dashboard/components/widgets/raw/raw-config.ts | 2 +-
.../components/widgets/table/table-config.ts | 2 +-
.../widgets/trafficlight/traffic-light-config.ts | 2 +-
.../add-visualization-dialog.component.html | 5 +-
.../add-visualization-dialog.component.ts | 60 +++---
.../dashboard/registry/widget-config-builder.ts | 13 +-
ui/src/app/dashboard/registry/widget-registry.ts | 7 +-
.../dashboard/sdk/collected-schema-requirements.ts | 14 +-
ui/src/app/dashboard/sdk/ep-requirements.ts | 32 +--
.../sdk/extractor/static-property-extractor.ts | 21 +-
.../sdk/matching/domain-property-match.ts | 10 +-
.../sdk/matching/mapping-property-generator.ts | 4 +-
.../sdk/matching/primitive-property-match.ts | 4 +-
.../app/dashboard/sdk/matching/property-match.ts | 8 +-
ui/src/app/dashboard/sdk/matching/schema-match.ts | 2 +-
.../dashboard/sdk/schema-requirements-builder.ts | 36 ++--
ui/src/app/dashboard/services/dashboard.service.ts | 87 +++-----
.../app/platform-services/apis/pipeline.service.ts | 9 +-
44 files changed, 484 insertions(+), 240 deletions(-)
diff --git a/streampipes-model-client/pom.xml b/streampipes-model-client/pom.xml
index 915e6a3..d5c7342 100644
--- a/streampipes-model-client/pom.xml
+++ b/streampipes-model-client/pom.xml
@@ -51,7 +51,7 @@
<plugin>
<groupId>cz.habarta.typescript-generator</groupId>
<artifactId>typescript-generator-maven-plugin</artifactId>
- <version>2.23.603</version>
+ <version>2.24.612</version>
<executions>
<execution>
<id>generate</id>
diff --git a/streampipes-model/pom.xml b/streampipes-model/pom.xml
index 7fe2da4..ad8996e 100644
--- a/streampipes-model/pom.xml
+++ b/streampipes-model/pom.xml
@@ -91,7 +91,7 @@
<plugin>
<groupId>cz.habarta.typescript-generator</groupId>
<artifactId>typescript-generator-maven-plugin</artifactId>
- <version>2.23.603</version>
+ <version>2.24.612</version>
<executions>
<execution>
<id>generate</id>
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardEntity.java b/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardEntity.java
index 78133d8..3487940 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardEntity.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardEntity.java
@@ -18,6 +18,7 @@
package org.apache.streampipes.model.dashboard;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.google.gson.annotations.SerializedName;
import io.fogsy.empire.annotations.RdfProperty;
@@ -40,9 +41,11 @@ import javax.persistence.MappedSuperclass;
public abstract class DashboardEntity extends UnnamedStreamPipesEntity {
@RdfProperty("sp:couchDbId")
+ @JsonProperty("_id")
private @SerializedName("_id") String id;
@RdfProperty("sp:couchDbRev")
+ @JsonProperty("_rev")
private @SerializedName("_rev") String rev;
public DashboardEntity() {
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardModel.java b/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardModel.java
index a18f00b..100288e 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardModel.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardModel.java
@@ -18,21 +18,26 @@
package org.apache.streampipes.model.dashboard;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
-import org.apache.streampipes.vocabulary.StreamPipes;
import io.fogsy.empire.annotations.RdfsClass;
-
-import java.util.List;
+import org.apache.streampipes.model.shared.annotation.TsModel;
+import org.apache.streampipes.vocabulary.StreamPipes;
import javax.persistence.Entity;
import javax.persistence.MappedSuperclass;
+import java.util.List;
@RdfsClass(StreamPipes.DASHBOARD_MODEL)
@MappedSuperclass
@Entity
+@TsModel
public class DashboardModel {
+ @JsonProperty("_id")
private @SerializedName("_id") String couchDbId;
+
+ @JsonProperty("_rev")
private @SerializedName("_rev") String couchDbRev;
private String id;
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardWidgetModel.java b/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardWidgetModel.java
index d3f2491..498ee16 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardWidgetModel.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardWidgetModel.java
@@ -18,6 +18,7 @@
package org.apache.streampipes.model.dashboard;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import org.apache.streampipes.vocabulary.StreamPipes;
import io.fogsy.empire.annotations.RdfProperty;
import io.fogsy.empire.annotations.RdfsClass;
@@ -29,6 +30,7 @@ import javax.persistence.OneToOne;
@RdfsClass(StreamPipes.DASHBOARD_WIDGET_MODEL)
@Entity
+@TsModel
public class DashboardWidgetModel extends DashboardEntity {
@RdfProperty(StreamPipes.HAS_DASHBOARD_WIDGET_ID)
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardWidgetSettings.java b/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardWidgetSettings.java
index 8d5c790..14a6b72 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardWidgetSettings.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/DashboardWidgetSettings.java
@@ -18,23 +18,20 @@
package org.apache.streampipes.model.dashboard;
+import io.fogsy.empire.annotations.RdfProperty;
+import io.fogsy.empire.annotations.RdfsClass;
import org.apache.streampipes.model.base.UnnamedStreamPipesEntity;
import org.apache.streampipes.model.schema.EventSchema;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import org.apache.streampipes.model.staticproperty.StaticProperty;
import org.apache.streampipes.vocabulary.StreamPipes;
-import io.fogsy.empire.annotations.RdfProperty;
-import io.fogsy.empire.annotations.RdfsClass;
+import javax.persistence.*;
import java.util.List;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-
@RdfsClass(StreamPipes.DASHBOARD_WIDGET_SETTINGS)
@Entity
+@TsModel
public class DashboardWidgetSettings extends UnnamedStreamPipesEntity {
@RdfProperty(StreamPipes.HAS_DASHBOARD_WIDGET_LABEL)
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/VisualizablePipeline.java b/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/VisualizablePipeline.java
index 63f5e7c..9bb0aa8 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/VisualizablePipeline.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/dashboard/VisualizablePipeline.java
@@ -19,6 +19,7 @@
package org.apache.streampipes.model.dashboard;
import org.apache.streampipes.model.schema.EventSchema;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import org.apache.streampipes.vocabulary.StreamPipes;
import io.fogsy.empire.annotations.RdfProperty;
import io.fogsy.empire.annotations.RdfsClass;
@@ -28,6 +29,7 @@ import javax.persistence.FetchType;
import javax.persistence.OneToOne;
@RdfsClass(StreamPipes.VISUALIZABLE_PIPELINE)
+@TsModel
public class VisualizablePipeline extends DashboardEntity {
@RdfProperty(StreamPipes.HAS_PIPELINE_ID)
@@ -44,6 +46,8 @@ public class VisualizablePipeline extends DashboardEntity {
@RdfProperty(StreamPipes.HAS_TOPIC)
private String topic;
+ private String pipelineName;
+
public VisualizablePipeline() {
super();
}
@@ -79,4 +83,12 @@ public class VisualizablePipeline extends DashboardEntity {
public void setTopic(String topic) {
this.topic = topic;
}
+
+ public String getPipelineName() {
+ return pipelineName;
+ }
+
+ public void setPipelineName(String pipelineName) {
+ this.pipelineName = pipelineName;
+ }
}
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/Dashboard.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/Dashboard.java
index ed2f69f..7166f74 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/Dashboard.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/Dashboard.java
@@ -20,7 +20,7 @@ import org.apache.streampipes.storage.api.IDashboardStorage;
import javax.ws.rs.Path;
-@Path("/v2/users/{username}/ld/dashboards")
+@Path("/v2/users/{username}/dashboard/dashboards")
public class Dashboard extends AbstractDashboardResource {
protected IDashboardStorage getDashboardStorage() {
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DashboardWidget.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DashboardWidget.java
index d50341d..624bfad 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DashboardWidget.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DashboardWidget.java
@@ -21,35 +21,27 @@ package org.apache.streampipes.rest.impl.dashboard;
import org.apache.streampipes.model.dashboard.DashboardWidgetModel;
import org.apache.streampipes.rest.api.dashboard.IDashboardWidget;
import org.apache.streampipes.rest.impl.AbstractRestInterface;
-import org.apache.streampipes.rest.shared.annotation.JsonLdSerialized;
-import org.apache.streampipes.rest.shared.util.SpMediaType;
+import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
import org.apache.streampipes.storage.api.IDashboardWidgetStorage;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-@Path("/v2/users/{username}/ld/widgets")
+@Path("/v2/users/{username}/dashboard/widgets")
public class DashboardWidget extends AbstractRestInterface implements IDashboardWidget {
@GET
- @JsonLdSerialized
+ @JacksonSerialized
@Produces(MediaType.APPLICATION_JSON)
@Override
public Response getAllDashboardWidgets() {
- return ok(asContainer(getDashboardWidgetStorage().getAllDashboardWidgets()));
+ return ok(getDashboardWidgetStorage().getAllDashboardWidgets());
}
@GET
- @JsonLdSerialized
- @Produces(SpMediaType.JSONLD)
+ @JacksonSerialized
+ @Produces(MediaType.APPLICATION_JSON)
@Path("/{widgetId}")
@Override
public Response getDashboardWidget(@PathParam("widgetId") String widgetId) {
@@ -57,8 +49,8 @@ public class DashboardWidget extends AbstractRestInterface implements IDashboard
}
@PUT
- @JsonLdSerialized
- @Consumes(SpMediaType.JSONLD)
+ @JacksonSerialized
+ @Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/{widgetId}")
@Override
@@ -68,6 +60,7 @@ public class DashboardWidget extends AbstractRestInterface implements IDashboard
}
@DELETE
+ @JacksonSerialized
@Produces(MediaType.APPLICATION_JSON)
@Path("/{widgetId}")
@Override
@@ -77,9 +70,9 @@ public class DashboardWidget extends AbstractRestInterface implements IDashboard
}
@POST
- @JsonLdSerialized
- @Produces(SpMediaType.JSONLD)
- @Consumes(SpMediaType.JSONLD)
+ @JacksonSerialized
+ @Produces(MediaType.APPLICATION_JSON)
+ @Consumes(MediaType.APPLICATION_JSON)
@Override
public Response createDashboardWidget(DashboardWidgetModel dashboardWidgetModel) {
String widgetId = getDashboardWidgetStorage().storeDashboardWidget(dashboardWidgetModel);
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/VisualizablePipeline.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/VisualizablePipeline.java
index c74a904..ffb345b 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/VisualizablePipeline.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/VisualizablePipeline.java
@@ -20,33 +20,32 @@ package org.apache.streampipes.rest.impl.dashboard;
import org.apache.streampipes.rest.api.dashboard.IVisualizablePipeline;
import org.apache.streampipes.rest.impl.AbstractRestInterface;
-import org.apache.streampipes.rest.shared.annotation.JsonLdSerialized;
-import org.apache.streampipes.rest.shared.util.SpMediaType;
+import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
import org.apache.streampipes.storage.api.IVisualizablePipelineStorage;
-import java.util.List;
-import java.util.Optional;
-
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import java.util.List;
+import java.util.Optional;
-@Path("/v2/users/{username}/ld/pipelines")
+@Path("/v2/users/{username}/dashboard/pipelines")
public class VisualizablePipeline extends AbstractRestInterface implements IVisualizablePipeline {
@GET
- @JsonLdSerialized
- @Produces(SpMediaType.JSONLD)
+ @JacksonSerialized
+ @Produces(MediaType.APPLICATION_JSON)
@Override
public Response getVisualizablePipelines() {
- return ok(asContainer(getVisualizablePipelineStorage().getAllVisualizablePipelines()));
+ return ok(getVisualizablePipelineStorage().getAllVisualizablePipelines());
}
@GET
- @JsonLdSerialized
- @Produces(SpMediaType.JSONLD)
+ @JacksonSerialized
+ @Produces(MediaType.APPLICATION_JSON)
@Path("/{id}")
@Override
public Response getVisualizablePipeline(@PathParam("id") String id) {
@@ -55,8 +54,8 @@ public class VisualizablePipeline extends AbstractRestInterface implements IVisu
}
@GET
- @JsonLdSerialized
- @Produces(SpMediaType.JSONLD)
+ @JacksonSerialized
+ @Produces(MediaType.APPLICATION_JSON)
@Path("topic/{topic}")
@Override
public Response getVisualizablePipelineByTopic(@PathParam("topic") String topic) {
diff --git a/ui/src/app/connect/static-properties/input.validator.ts b/ui/src/app/connect/static-properties/input.validator.ts
index 62be3d9..2077d0e 100644
--- a/ui/src/app/connect/static-properties/input.validator.ts
+++ b/ui/src/app/connect/static-properties/input.validator.ts
@@ -42,8 +42,5 @@ export function ValidateString(control: AbstractControl) {
if(control.value == null){
return { validUrl: true };
}
- else if (!control.value.includes("@")) {
- return { validUrl: true };
- }
return null;
}
diff --git a/ui/src/app/core-model/gen/streampipes-model-client.ts b/ui/src/app/core-model/gen/streampipes-model-client.ts
index f36247b..568ed77 100644
--- a/ui/src/app/core-model/gen/streampipes-model-client.ts
+++ b/ui/src/app/core-model/gen/streampipes-model-client.ts
@@ -1,3 +1,21 @@
+/*
+ * 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
diff --git a/ui/src/app/core-model/gen/streampipes-model.ts b/ui/src/app/core-model/gen/streampipes-model.ts
index 4d383f7..fe939ab 100644
--- a/ui/src/app/core-model/gen/streampipes-model.ts
+++ b/ui/src/app/core-model/gen/streampipes-model.ts
@@ -1,10 +1,28 @@
+/*
+ * 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.23.603 on 2020-06-11 23:05:01.
+// Generated using typescript-generator version 2.23.603 on 2020-07-19 11:52:14.
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 [...]
+ "@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 [...]
static fromData(data: AbstractStreamPipesEntity, target?: AbstractStreamPipesEntity): AbstractStreamPipesEntity {
if (!data) {
@@ -17,7 +35,7 @@ export class AbstractStreamPipesEntity {
}
export class UnnamedStreamPipesEntity extends AbstractStreamPipesEntity {
- "@class": "org.apache.streampipes.model.base.UnnamedStreamPipesEntity" | "org.apache.streampipes.model.connect.guess.GuessSchema" | "org.apache.streampipes.model.connect.rules.TransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.value.ValueTransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.value.AddTimestampRuleDescription" | "org.apache.streampipes.model.connect.rules.value.AddValueTransformationRuleDescription" | "org.apache.streamp [...]
+ "@class": "org.apache.streampipes.model.base.UnnamedStreamPipesEntity" | "org.apache.streampipes.model.connect.guess.GuessSchema" | "org.apache.streampipes.model.connect.rules.TransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.value.ValueTransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.value.AddTimestampRuleDescription" | "org.apache.streampipes.model.connect.rules.value.AddValueTransformationRuleDescription" | "org.apache.streamp [...]
elementId: string;
static fromData(data: UnnamedStreamPipesEntity, target?: UnnamedStreamPipesEntity): UnnamedStreamPipesEntity {
@@ -169,9 +187,9 @@ export class AdapterDescription extends NamedStreamPipesEntity {
instance.config = __getCopyArrayFn(StaticProperty.fromDataUnion)(data.config);
instance.rules = __getCopyArrayFn(TransformationRuleDescription.fromDataUnion)(data.rules);
instance.category = __getCopyArrayFn(__identity<string>())(data.category);
- instance.schemaRules = __getCopyArrayFn(__identity<any>())(data.schemaRules);
- instance.streamRules = __getCopyArrayFn(__identity<any>())(data.streamRules);
instance.valueRules = __getCopyArrayFn(__identity<any>())(data.valueRules);
+ instance.streamRules = __getCopyArrayFn(__identity<any>())(data.streamRules);
+ instance.schemaRules = __getCopyArrayFn(__identity<any>())(data.schemaRules);
instance.couchDBId = data.couchDBId;
instance._rev = data._rev;
return instance;
@@ -705,6 +723,175 @@ export class CustomTransformOutputStrategy extends OutputStrategy {
}
}
+export class DashboardEntity extends UnnamedStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.dashboard.DashboardEntity" | "org.apache.streampipes.model.dashboard.DashboardWidgetModel" | "org.apache.streampipes.model.dashboard.VisualizablePipeline" | "org.apache.streampipes.model.datalake.DataExplorerWidgetModel";
+ _id: string;
+ _rev: string;
+
+ static fromData(data: DashboardEntity, target?: DashboardEntity): DashboardEntity {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new DashboardEntity();
+ super.fromData(data, instance);
+ instance._id = data._id;
+ instance._rev = data._rev;
+ return instance;
+ }
+
+ static fromDataUnion(data: DashboardEntityUnion): DashboardEntityUnion {
+ if (!data) {
+ return data;
+ }
+ switch (data["@class"]) {
+ case "org.apache.streampipes.model.dashboard.DashboardWidgetModel":
+ return DashboardWidgetModel.fromData(data);
+ case "org.apache.streampipes.model.dashboard.VisualizablePipeline":
+ return VisualizablePipeline.fromData(data);
+ case "org.apache.streampipes.model.datalake.DataExplorerWidgetModel":
+ return DataExplorerWidgetModel.fromData(data);
+ }
+ }
+}
+
+export class DashboardItem {
+ cols: number;
+ component: string;
+ id: string;
+ name: string;
+ rows: number;
+ settings: string[];
+ widgetType: string;
+ x: number;
+ y: number;
+
+ static fromData(data: DashboardItem, target?: DashboardItem): DashboardItem {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new DashboardItem();
+ instance.id = data.id;
+ instance.name = data.name;
+ instance.component = data.component;
+ instance.widgetType = data.widgetType;
+ instance.settings = __getCopyArrayFn(__identity<string>())(data.settings);
+ instance.cols = data.cols;
+ instance.rows = data.rows;
+ instance.x = data.x;
+ instance.y = data.y;
+ return instance;
+ }
+}
+
+export class DashboardModel {
+ _id: string;
+ _rev: string;
+ description: string;
+ displayHeader: boolean;
+ id: string;
+ name: string;
+ widgets: DashboardItem[];
+
+ static fromData(data: DashboardModel, target?: DashboardModel): DashboardModel {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new DashboardModel();
+ instance.id = data.id;
+ instance.name = data.name;
+ instance.description = data.description;
+ instance.displayHeader = data.displayHeader;
+ instance.widgets = __getCopyArrayFn(DashboardItem.fromData)(data.widgets);
+ instance._id = data._id;
+ instance._rev = data._rev;
+ return instance;
+ }
+}
+
+export class DashboardWidgetModel extends DashboardEntity {
+ "@class": "org.apache.streampipes.model.dashboard.DashboardWidgetModel";
+ dashboardWidgetSettings: DashboardWidgetSettings;
+ visualizablePipelineId: string;
+ visualizablePipelineTopic: string;
+ widgetId: string;
+
+ static fromData(data: DashboardWidgetModel, target?: DashboardWidgetModel): DashboardWidgetModel {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new DashboardWidgetModel();
+ super.fromData(data, instance);
+ instance.widgetId = data.widgetId;
+ instance.dashboardWidgetSettings = DashboardWidgetSettings.fromData(data.dashboardWidgetSettings);
+ instance.visualizablePipelineId = data.visualizablePipelineId;
+ instance.visualizablePipelineTopic = data.visualizablePipelineTopic;
+ return instance;
+ }
+}
+
+export class DashboardWidgetSettings extends UnnamedStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.dashboard.DashboardWidgetSettings";
+ config: StaticPropertyUnion[];
+ requiredSchema: EventSchema;
+ widgetDescription: string;
+ widgetIconName: string;
+ widgetLabel: string;
+ widgetName: string;
+
+ static fromData(data: DashboardWidgetSettings, target?: DashboardWidgetSettings): DashboardWidgetSettings {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new DashboardWidgetSettings();
+ super.fromData(data, instance);
+ instance.widgetLabel = data.widgetLabel;
+ instance.widgetName = data.widgetName;
+ instance.config = __getCopyArrayFn(StaticProperty.fromDataUnion)(data.config);
+ instance.requiredSchema = EventSchema.fromData(data.requiredSchema);
+ instance.widgetIconName = data.widgetIconName;
+ instance.widgetDescription = data.widgetDescription;
+ return instance;
+ }
+}
+
+export class DataExplorerWidgetModel extends DashboardEntity {
+ "@class": "org.apache.streampipes.model.datalake.DataExplorerWidgetModel";
+ dataLakeMeasure: DataLakeMeasure;
+ selectedKeys: string;
+ widgetId: string;
+ widgetType: string;
+
+ static fromData(data: DataExplorerWidgetModel, target?: DataExplorerWidgetModel): DataExplorerWidgetModel {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new DataExplorerWidgetModel();
+ super.fromData(data, instance);
+ instance.widgetId = data.widgetId;
+ instance.widgetType = data.widgetType;
+ instance.selectedKeys = data.selectedKeys;
+ instance.dataLakeMeasure = DataLakeMeasure.fromData(data.dataLakeMeasure);
+ return instance;
+ }
+}
+
+export class DataLakeMeasure extends UnnamedStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.datalake.DataLakeMeasure";
+ eventSchema: EventSchema;
+ measureName: string;
+
+ static fromData(data: DataLakeMeasure, target?: DataLakeMeasure): DataLakeMeasure {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new DataLakeMeasure();
+ super.fromData(data, instance);
+ instance.measureName = data.measureName;
+ instance.eventSchema = EventSchema.fromData(data.eventSchema);
+ return instance;
+ }
+}
+
export class InvocableStreamPipesEntity extends NamedStreamPipesEntity {
"@class": "org.apache.streampipes.model.base.InvocableStreamPipesEntity" | "org.apache.streampipes.model.graph.DataProcessorInvocation" | "org.apache.streampipes.model.graph.DataSinkInvocation";
belongsTo: string;
@@ -1025,7 +1212,6 @@ export class ErrorMessage extends Message {
export class EventGrounding extends UnnamedStreamPipesEntity {
"@class": "org.apache.streampipes.model.grounding.EventGrounding";
transportFormats: TransportFormat[];
- transportProtocol: TransportProtocolUnion;
transportProtocols: TransportProtocolUnion[];
static fromData(data: EventGrounding, target?: EventGrounding): EventGrounding {
@@ -1036,7 +1222,6 @@ export class EventGrounding extends UnnamedStreamPipesEntity {
super.fromData(data, instance);
instance.transportProtocols = __getCopyArrayFn(TransportProtocol.fromDataUnion)(data.transportProtocols);
instance.transportFormats = __getCopyArrayFn(TransportFormat.fromData)(data.transportFormats);
- instance.transportProtocol = TransportProtocol.fromDataUnion(data.transportProtocol);
return instance;
}
}
@@ -1378,9 +1563,9 @@ export class GenericAdapterSetDescription extends AdapterSetDescription implemen
}
const instance = target || new GenericAdapterSetDescription();
super.fromData(data, instance);
+ instance.eventSchema = EventSchema.fromData(data.eventSchema);
instance.formatDescription = FormatDescription.fromData(data.formatDescription);
instance.protocolDescription = ProtocolDescription.fromData(data.protocolDescription);
- instance.eventSchema = EventSchema.fromData(data.eventSchema);
return instance;
}
}
@@ -1397,9 +1582,9 @@ export class GenericAdapterStreamDescription extends AdapterStreamDescription im
}
const instance = target || new GenericAdapterStreamDescription();
super.fromData(data, instance);
+ instance.eventSchema = EventSchema.fromData(data.eventSchema);
instance.formatDescription = FormatDescription.fromData(data.formatDescription);
instance.protocolDescription = ProtocolDescription.fromData(data.protocolDescription);
- instance.eventSchema = EventSchema.fromData(data.eventSchema);
return instance;
}
}
@@ -2255,8 +2440,8 @@ export class SpDataSet extends SpDataStream {
instance.supportedGrounding = EventGrounding.fromData(data.supportedGrounding);
instance.datasetInvocationId = data.datasetInvocationId;
instance.correspondingPipeline = data.correspondingPipeline;
- instance.actualTopicName = data.actualTopicName;
instance.brokerHostname = data.brokerHostname;
+ instance.actualTopicName = data.actualTopicName;
return instance;
}
}
@@ -2475,6 +2660,29 @@ export class UserDefinedOutputStrategy extends OutputStrategy {
}
}
+export class VisualizablePipeline extends DashboardEntity {
+ "@class": "org.apache.streampipes.model.dashboard.VisualizablePipeline";
+ pipelineId: string;
+ pipelineName: string;
+ schema: EventSchema;
+ topic: string;
+ visualizationName: string;
+
+ static fromData(data: VisualizablePipeline, target?: VisualizablePipeline): VisualizablePipeline {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new VisualizablePipeline();
+ super.fromData(data, instance);
+ instance.pipelineId = data.pipelineId;
+ instance.schema = EventSchema.fromData(data.schema);
+ instance.visualizationName = data.visualizationName;
+ instance.topic = data.topic;
+ instance.pipelineName = data.pipelineName;
+ return instance;
+ }
+}
+
export class WildcardTopicDefinition extends TopicDefinition {
"@class": "org.apache.streampipes.model.grounding.WildcardTopicDefinition";
wildcardTopicMappings: WildcardTopicMapping[];
@@ -2519,6 +2727,8 @@ export type AdapterSetDescriptionUnion = GenericAdapterSetDescription | Specific
export type AdapterStreamDescriptionUnion = SpecificAdapterStreamDescription;
+export type DashboardEntityUnion = DashboardWidgetModel | VisualizablePipeline | DataExplorerWidgetModel;
+
export type EventPropertyQualityDefinitionUnion = Accuracy | MeasurementRange | Precision | Resolution;
export type EventPropertyUnion = EventPropertyList | EventPropertyNested | EventPropertyPrimitive;
diff --git a/ui/src/app/dashboard/components/grid/dashboard-grid.component.ts b/ui/src/app/dashboard/components/grid/dashboard-grid.component.ts
index 61109ee..1931085 100644
--- a/ui/src/app/dashboard/components/grid/dashboard-grid.component.ts
+++ b/ui/src/app/dashboard/components/grid/dashboard-grid.component.ts
@@ -33,7 +33,7 @@ import {ResizeService} from "../../services/resize.service";
import {GridsterItemComponent, GridType} from "angular-gridster2";
import {DashboardService} from "../../services/dashboard.service";
import {RefreshDashboardService} from "../../services/refresh-dashboard.service";
-import {DashboardWidget} from "../../../core-model/dashboard/DashboardWidget";
+import {DashboardWidgetModel} from "../../../core-model/gen/streampipes-model";
@Component({
selector: 'dashboard-grid',
@@ -46,7 +46,7 @@ export class DashboardGridComponent implements OnInit, OnChanges {
@Input() dashboard: Dashboard;
@Output() deleteCallback: EventEmitter<DashboardItem> = new EventEmitter<DashboardItem>();
- @Output() updateCallback: EventEmitter<DashboardWidget> = new EventEmitter<DashboardWidget>();
+ @Output() updateCallback: EventEmitter<DashboardWidgetModel> = new EventEmitter<DashboardWidgetModel>();
options: DashboardConfig;
loaded: boolean = false;
@@ -92,7 +92,7 @@ export class DashboardGridComponent implements OnInit, OnChanges {
this.deleteCallback.emit(widget);
}
- propagateItemUpdate(dashboardWidget: DashboardWidget) {
+ propagateItemUpdate(dashboardWidget: DashboardWidgetModel) {
this.updateCallback.emit(dashboardWidget);
}
diff --git a/ui/src/app/dashboard/components/panel/dashboard-panel.component.ts b/ui/src/app/dashboard/components/panel/dashboard-panel.component.ts
index 8b4895f..1795b22 100644
--- a/ui/src/app/dashboard/components/panel/dashboard-panel.component.ts
+++ b/ui/src/app/dashboard/components/panel/dashboard-panel.component.ts
@@ -21,9 +21,9 @@ import {Dashboard, DashboardItem} from "../../models/dashboard.model";
import {forkJoin, Observable, Subscription} from "rxjs";
import {MatDialog} from "@angular/material/dialog";
import {AddVisualizationDialogComponent} from "../../dialogs/add-widget/add-visualization-dialog.component";
-import {DashboardWidget} from "../../../core-model/dashboard/DashboardWidget";
import {DashboardService} from "../../services/dashboard.service";
import {RefreshDashboardService} from "../../services/refresh-dashboard.service";
+import {DashboardWidgetModel} from "../../../core-model/gen/streampipes-model";
@Component({
selector: 'dashboard-panel',
@@ -41,7 +41,7 @@ export class DashboardPanelComponent implements OnInit {
protected subscription: Subscription;
widgetIdsToRemove: Array<string> = [];
- widgetsToUpdate: Map<string, DashboardWidget> = new Map<string, DashboardWidget>();
+ widgetsToUpdate: Map<string, DashboardWidgetModel> = new Map<string, DashboardWidgetModel>();
constructor(private dashboardService: DashboardService,
public dialog: MatDialog,
@@ -66,7 +66,7 @@ export class DashboardPanelComponent implements OnInit {
});
}
- addWidgetToDashboard(widget: DashboardWidget) {
+ addWidgetToDashboard(widget: DashboardWidgetModel) {
let dashboardItem = {} as DashboardItem;
dashboardItem.widgetId = widget._id;
dashboardItem.id = widget._id;
@@ -116,7 +116,7 @@ export class DashboardPanelComponent implements OnInit {
this.widgetIdsToRemove.push(widget.id);
}
- updateAndQueueItemForDeletion(dashboardWidget: DashboardWidget) {
+ updateAndQueueItemForDeletion(dashboardWidget: DashboardWidgetModel) {
this.widgetsToUpdate.set(dashboardWidget._id, dashboardWidget);
}
diff --git a/ui/src/app/dashboard/components/widget/dashboard-widget.component.ts b/ui/src/app/dashboard/components/widget/dashboard-widget.component.ts
index ce6c408..f3a90d3 100644
--- a/ui/src/app/dashboard/components/widget/dashboard-widget.component.ts
+++ b/ui/src/app/dashboard/components/widget/dashboard-widget.component.ts
@@ -19,11 +19,13 @@
import {Component, EventEmitter, Input, OnInit, Output} from "@angular/core";
import {DashboardItem} from "../../models/dashboard.model";
import {DashboardService} from "../../services/dashboard.service";
-import {DashboardWidget} from "../../../core-model/dashboard/DashboardWidget";
import {GridsterItem, GridsterItemComponent} from "angular-gridster2";
import {AddVisualizationDialogComponent} from "../../dialogs/add-widget/add-visualization-dialog.component";
import {MatDialog} from "@angular/material/dialog";
-import {VisualizablePipeline} from "../../../core-model/dashboard/VisualizablePipeline";
+import {
+ DashboardWidgetModel,
+ VisualizablePipeline
+} from "../../../core-model/gen/streampipes-model";
@Component({
selector: 'dashboard-widget',
@@ -38,10 +40,10 @@ export class DashboardWidgetComponent implements OnInit {
@Input() gridsterItemComponent: GridsterItemComponent;
@Output() deleteCallback: EventEmitter<DashboardItem> = new EventEmitter<DashboardItem>();
- @Output() updateCallback: EventEmitter<DashboardWidget> = new EventEmitter<DashboardWidget>();
+ @Output() updateCallback: EventEmitter<DashboardWidgetModel> = new EventEmitter<DashboardWidgetModel>();
widgetLoaded: boolean = false;
- configuredWidget: DashboardWidget;
+ configuredWidget: DashboardWidgetModel;
widgetDataConfig: VisualizablePipeline;
pipelineNotRunning: boolean = false;
diff --git a/ui/src/app/dashboard/components/widgets/base/base-config.ts b/ui/src/app/dashboard/components/widgets/base/base-config.ts
index 10c4989..b4a00b8 100644
--- a/ui/src/app/dashboard/components/widgets/base/base-config.ts
+++ b/ui/src/app/dashboard/components/widgets/base/base-config.ts
@@ -16,8 +16,8 @@
*
*/
-import {DashboardWidgetSettings} from "../../../../core-model/dashboard/DashboardWidgetSettings";
import {Tuple2} from "../../../../core-model/base/Tuple2";
+import {DashboardWidgetSettings} from "../../../../core-model/gen/streampipes-model";
export abstract class WidgetConfig {
diff --git a/ui/src/app/dashboard/components/widgets/base/base-ngx-charts-widget.ts b/ui/src/app/dashboard/components/widgets/base/base-ngx-charts-widget.ts
index 7ab1578..e4525c0 100644
--- a/ui/src/app/dashboard/components/widgets/base/base-ngx-charts-widget.ts
+++ b/ui/src/app/dashboard/components/widgets/base/base-ngx-charts-widget.ts
@@ -19,8 +19,6 @@
import {BaseStreamPipesWidget} from "./base-widget";
import {RxStompService} from "@stomp/ng2-stompjs";
import {ResizeService} from "../../../services/resize.service";
-import {GridsterInfo} from "../../../models/gridster-info.model";
-import {GridsterItemComponent} from "angular-gridster2";
import {DashboardService} from "../../../services/dashboard.service";
export abstract class BaseNgxChartsStreamPipesWidget extends BaseStreamPipesWidget {
diff --git a/ui/src/app/dashboard/components/widgets/base/base-ngx-line-config.ts b/ui/src/app/dashboard/components/widgets/base/base-ngx-line-config.ts
index 3d098f4..74a24e0 100644
--- a/ui/src/app/dashboard/components/widgets/base/base-ngx-line-config.ts
+++ b/ui/src/app/dashboard/components/widgets/base/base-ngx-line-config.ts
@@ -17,10 +17,10 @@
*/
import {WidgetConfig} from "./base-config";
-import {DashboardWidgetSettings} from "../../../../core-model/dashboard/DashboardWidgetSettings";
import {WidgetConfigBuilder} from "../../../registry/widget-config-builder";
import {SchemaRequirementsBuilder} from "../../../sdk/schema-requirements-builder";
import {EpRequirements} from "../../../sdk/ep-requirements";
+import {DashboardWidgetSettings} from "../../../../core-model/gen/streampipes-model";
export abstract class BaseNgxLineConfig extends WidgetConfig {
diff --git a/ui/src/app/dashboard/components/widgets/base/base-widget.ts b/ui/src/app/dashboard/components/widgets/base/base-widget.ts
index 51b15c7..81a1289 100644
--- a/ui/src/app/dashboard/components/widgets/base/base-widget.ts
+++ b/ui/src/app/dashboard/components/widgets/base/base-widget.ts
@@ -18,22 +18,24 @@
import {Input, OnChanges, SimpleChanges} from "@angular/core";
import {DashboardItem} from "../../../models/dashboard.model";
-import {DashboardWidget} from "../../../../core-model/dashboard/DashboardWidget";
import {StaticPropertyExtractor} from "../../../sdk/extractor/static-property-extractor";
import {RxStompService} from "@stomp/ng2-stompjs";
import {Message} from "@stomp/stompjs";
import {Subscription} from "rxjs";
import {GridsterItem, GridsterItemComponent} from "angular-gridster2";
import {WidgetConfigBuilder} from "../../../registry/widget-config-builder";
-import {VisualizablePipeline} from "../../../../core-model/dashboard/VisualizablePipeline";
import {ResizeService} from "../../../services/resize.service";
import {GridsterInfo} from "../../../models/gridster-info.model";
import {DashboardService} from "../../../services/dashboard.service";
+import {
+ DashboardWidgetModel,
+ VisualizablePipeline
+} from "../../../../core-model/gen/streampipes-model";
export abstract class BaseStreamPipesWidget implements OnChanges {
@Input() widget: DashboardItem;
- @Input() widgetConfig: DashboardWidget;
+ @Input() widgetConfig: DashboardWidgetModel;
@Input() widgetDataConfig: VisualizablePipeline;
@Input() gridsterItem: GridsterItem;
@Input() gridsterItemComponent: GridsterItemComponent;
diff --git a/ui/src/app/dashboard/components/widgets/gauge/gauge-config.ts b/ui/src/app/dashboard/components/widgets/gauge/gauge-config.ts
index 7a4799e..d3139f2 100644
--- a/ui/src/app/dashboard/components/widgets/gauge/gauge-config.ts
+++ b/ui/src/app/dashboard/components/widgets/gauge/gauge-config.ts
@@ -17,10 +17,10 @@
*/
import {WidgetConfig} from "../base/base-config";
-import {DashboardWidgetSettings} from "../../../../core-model/dashboard/DashboardWidgetSettings";
import {WidgetConfigBuilder} from "../../../registry/widget-config-builder";
import {SchemaRequirementsBuilder} from "../../../sdk/schema-requirements-builder";
import {EpRequirements} from "../../../sdk/ep-requirements";
+import {DashboardWidgetSettings} from "../../../../core-model/gen/streampipes-model";
export class GaugeConfig extends WidgetConfig {
diff --git a/ui/src/app/dashboard/components/widgets/html/html-config.ts b/ui/src/app/dashboard/components/widgets/html/html-config.ts
index 675f3b9..cf45d3f 100644
--- a/ui/src/app/dashboard/components/widgets/html/html-config.ts
+++ b/ui/src/app/dashboard/components/widgets/html/html-config.ts
@@ -17,9 +17,9 @@
import {WidgetConfigBuilder} from "../../../registry/widget-config-builder";
import {SchemaRequirementsBuilder} from "../../../sdk/schema-requirements-builder";
-import {DashboardWidgetSettings} from "../../../../core-model/dashboard/DashboardWidgetSettings";
import {WidgetConfig} from "../base/base-config";
import {EpRequirements} from "../../../sdk/ep-requirements";
+import {DashboardWidgetSettings} from "../../../../core-model/gen/streampipes-model";
export class HtmlConfig extends WidgetConfig {
diff --git a/ui/src/app/dashboard/components/widgets/image/image-config.ts b/ui/src/app/dashboard/components/widgets/image/image-config.ts
index a7ef01c..eef875b 100644
--- a/ui/src/app/dashboard/components/widgets/image/image-config.ts
+++ b/ui/src/app/dashboard/components/widgets/image/image-config.ts
@@ -17,10 +17,10 @@
*/
import {WidgetConfig} from "../base/base-config";
-import {DashboardWidgetSettings} from "../../../../core-model/dashboard/DashboardWidgetSettings";
import {WidgetConfigBuilder} from "../../../registry/widget-config-builder";
import {SchemaRequirementsBuilder} from "../../../sdk/schema-requirements-builder";
import {EpRequirements} from "../../../sdk/ep-requirements";
+import {DashboardWidgetSettings} from "../../../../core-model/gen/streampipes-model";
export class ImageConfig extends WidgetConfig {
diff --git a/ui/src/app/dashboard/components/widgets/map/map-config.ts b/ui/src/app/dashboard/components/widgets/map/map-config.ts
index c5a902b..6c56f4d 100644
--- a/ui/src/app/dashboard/components/widgets/map/map-config.ts
+++ b/ui/src/app/dashboard/components/widgets/map/map-config.ts
@@ -18,8 +18,8 @@
import {WidgetConfigBuilder} from "../../../registry/widget-config-builder";
import {SchemaRequirementsBuilder} from "../../../sdk/schema-requirements-builder";
import {EpRequirements} from "../../../sdk/ep-requirements";
-import {DashboardWidgetSettings} from "../../../../core-model/dashboard/DashboardWidgetSettings";
import {WidgetConfig} from "../base/base-config";
+import {DashboardWidgetSettings} from "../../../../core-model/gen/streampipes-model";
export class MapConfig extends WidgetConfig {
diff --git a/ui/src/app/dashboard/components/widgets/number/number-config.ts b/ui/src/app/dashboard/components/widgets/number/number-config.ts
index 5a29d69..e4db085 100644
--- a/ui/src/app/dashboard/components/widgets/number/number-config.ts
+++ b/ui/src/app/dashboard/components/widgets/number/number-config.ts
@@ -19,8 +19,8 @@
import {WidgetConfigBuilder} from "../../../registry/widget-config-builder";
import {SchemaRequirementsBuilder} from "../../../sdk/schema-requirements-builder";
import {EpRequirements} from "../../../sdk/ep-requirements";
-import {DashboardWidgetSettings} from "../../../../core-model/dashboard/DashboardWidgetSettings";
import {WidgetConfig} from "../base/base-config";
+import {DashboardWidgetSettings} from "../../../../core-model/gen/streampipes-model";
export class NumberConfig extends WidgetConfig {
diff --git a/ui/src/app/dashboard/components/widgets/pallet/pallet-config.ts b/ui/src/app/dashboard/components/widgets/pallet/pallet-config.ts
index 0a008ce..d3e3e22 100644
--- a/ui/src/app/dashboard/components/widgets/pallet/pallet-config.ts
+++ b/ui/src/app/dashboard/components/widgets/pallet/pallet-config.ts
@@ -16,11 +16,11 @@
*
*/
-import { DashboardWidgetSettings } from '../../../../core-model/dashboard/DashboardWidgetSettings';
import { WidgetConfigBuilder } from '../../../registry/widget-config-builder';
import { EpRequirements } from '../../../sdk/ep-requirements';
import { SchemaRequirementsBuilder } from '../../../sdk/schema-requirements-builder';
import { WidgetConfig } from '../base/base-config';
+import {DashboardWidgetSettings} from "../../../../core-model/gen/streampipes-model";
export class PalletConfig extends WidgetConfig {
diff --git a/ui/src/app/dashboard/components/widgets/raw/raw-config.ts b/ui/src/app/dashboard/components/widgets/raw/raw-config.ts
index 164e66c..238292c 100644
--- a/ui/src/app/dashboard/components/widgets/raw/raw-config.ts
+++ b/ui/src/app/dashboard/components/widgets/raw/raw-config.ts
@@ -17,8 +17,8 @@
import {WidgetConfigBuilder} from "../../../registry/widget-config-builder";
import {SchemaRequirementsBuilder} from "../../../sdk/schema-requirements-builder";
-import {DashboardWidgetSettings} from "../../../../core-model/dashboard/DashboardWidgetSettings";
import {WidgetConfig} from "../base/base-config";
+import {DashboardWidgetSettings} from "../../../../core-model/gen/streampipes-model";
export class RawConfig extends WidgetConfig {
diff --git a/ui/src/app/dashboard/components/widgets/table/table-config.ts b/ui/src/app/dashboard/components/widgets/table/table-config.ts
index ced1199..7b60d95 100644
--- a/ui/src/app/dashboard/components/widgets/table/table-config.ts
+++ b/ui/src/app/dashboard/components/widgets/table/table-config.ts
@@ -17,10 +17,10 @@
*/
import {WidgetConfig} from "../base/base-config";
-import {DashboardWidgetSettings} from "../../../../core-model/dashboard/DashboardWidgetSettings";
import {WidgetConfigBuilder} from "../../../registry/widget-config-builder";
import {SchemaRequirementsBuilder} from "../../../sdk/schema-requirements-builder";
import {EpRequirements} from "../../../sdk/ep-requirements";
+import {DashboardWidgetSettings} from "../../../../core-model/gen/streampipes-model";
export class TableConfig extends WidgetConfig {
diff --git a/ui/src/app/dashboard/components/widgets/trafficlight/traffic-light-config.ts b/ui/src/app/dashboard/components/widgets/trafficlight/traffic-light-config.ts
index 52c1f8e..a2d5960 100644
--- a/ui/src/app/dashboard/components/widgets/trafficlight/traffic-light-config.ts
+++ b/ui/src/app/dashboard/components/widgets/trafficlight/traffic-light-config.ts
@@ -17,9 +17,9 @@
import {WidgetConfigBuilder} from "../../../registry/widget-config-builder";
import {SchemaRequirementsBuilder} from "../../../sdk/schema-requirements-builder";
-import {DashboardWidgetSettings} from "../../../../core-model/dashboard/DashboardWidgetSettings";
import {WidgetConfig} from "../base/base-config";
import {EpRequirements} from "../../../sdk/ep-requirements";
+import {DashboardWidgetSettings} from "../../../../core-model/gen/streampipes-model";
export class TrafficLightConfig extends WidgetConfig {
diff --git a/ui/src/app/dashboard/dialogs/add-widget/add-visualization-dialog.component.html b/ui/src/app/dashboard/dialogs/add-widget/add-visualization-dialog.component.html
index 633adec..2d0d8a9 100644
--- a/ui/src/app/dashboard/dialogs/add-widget/add-visualization-dialog.component.html
+++ b/ui/src/app/dashboard/dialogs/add-widget/add-visualization-dialog.component.html
@@ -68,7 +68,8 @@
[staticProperties]="selectedWidget.config"
[eventSchemas]="[selectedPipeline.schema]"
[fieldName]="config.internalName"
- (validateEmitter)="validConfiguration($event)"></app-static-property>
+ [parentForm]="parentForm">
+ </app-static-property>
</div>
</div>
@@ -86,7 +87,7 @@
Back
</button>
<button mat-button mat-raised-button color="primary" (click)="next()" [disabled]="'configure-widget' === page
- && !configValid">
+ && !formValid">
<span *ngIf="!data && 'configure-widget' === page">Create</span>
<span *ngIf="data && 'configure-widget' === page">Save</span>
<span *ngIf="data == null && !('configure-widget' === page)">Next</span>
diff --git a/ui/src/app/dashboard/dialogs/add-widget/add-visualization-dialog.component.ts b/ui/src/app/dashboard/dialogs/add-widget/add-visualization-dialog.component.ts
index 0b9ed79..a4f2e21 100644
--- a/ui/src/app/dashboard/dialogs/add-widget/add-visualization-dialog.component.ts
+++ b/ui/src/app/dashboard/dialogs/add-widget/add-visualization-dialog.component.ts
@@ -16,29 +16,32 @@
*
*/
-import { Component, Inject } from '@angular/core';
+import {AfterViewInit, ChangeDetectorRef, Component, Inject, OnInit} from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
-import { FreeTextStaticProperty } from '../../../connect/model/FreeTextStaticProperty';
-import { MappingPropertyNary } from '../../../connect/model/MappingPropertyNary';
-import { MappingPropertyUnary } from '../../../connect/model/MappingPropertyUnary';
-import { EventProperty } from '../../../connect/schema-editor/model/EventProperty';
-import { EventSchema } from '../../../connect/schema-editor/model/EventSchema';
-import { DashboardWidget } from '../../../core-model/dashboard/DashboardWidget';
-import { DashboardWidgetSettings } from '../../../core-model/dashboard/DashboardWidgetSettings';
-import { VisualizablePipeline } from '../../../core-model/dashboard/VisualizablePipeline';
import { ElementIconText } from '../../../services/get-element-icon-text.service';
import { Dashboard } from '../../models/dashboard.model';
import { WidgetConfigBuilder } from '../../registry/widget-config-builder';
import { WidgetRegistry } from '../../registry/widget-registry';
import { MappingPropertyGenerator } from '../../sdk/matching/mapping-property-generator';
import { DashboardService } from '../../services/dashboard.service';
+import {
+ DashboardWidgetModel,
+ DashboardWidgetSettings,
+ EventPropertyUnion, EventSchema,
+ FreeTextStaticProperty,
+ MappingPropertyNary,
+ MappingPropertyUnary,
+ VisualizablePipeline
+} from "../../../core-model/gen/streampipes-model";
+import {PipelineService} from "../../../platform-services/apis/pipeline.service";
+import {FormBuilder, FormGroup} from "@angular/forms";
@Component({
selector: 'add-visualization-dialog-component',
templateUrl: './add-visualization-dialog.component.html',
styleUrls: ['./add-visualization-dialog.component.scss']
})
-export class AddVisualizationDialogComponent {
+export class AddVisualizationDialogComponent implements OnInit, AfterViewInit {
pages = [{
type: 'select-pipeline',
@@ -66,23 +69,33 @@ export class AddVisualizationDialogComponent {
page: any = 'select-pipeline';
dialogTitle: string;
- configValid: boolean;
+ parentForm: FormGroup;
+
+ formValid: boolean = false;
+ viewInitialized: boolean = false;
constructor(
public dialogRef: MatDialogRef<AddVisualizationDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
private dashboardService: DashboardService,
- public elementIconText: ElementIconText) {
+ private pipelineService: PipelineService,
+ public elementIconText: ElementIconText,
+ private fb: FormBuilder,
+ private changeDetectorRef: ChangeDetectorRef) {
}
ngOnInit() {
+ this.parentForm = this.fb.group({});
+ this.parentForm.statusChanges.subscribe(status => {
+ this.formValid = this.viewInitialized && this.parentForm.valid;
+ });
if (!this.data) {
this.dialogTitle = 'Add widget';
this.dashboardService.getVisualizablePipelines().subscribe(visualizations => {
this.visualizablePipelines = [];
visualizations.forEach(vis => {
- this.dashboardService.getPipelineById(vis.pipelineId).subscribe(pipeline => {
+ this.pipelineService.getPipelineById(vis.pipelineId).subscribe(pipeline => {
vis.pipelineName = pipeline.name;
this.visualizablePipelines.push(vis);
this.sortPipeline();
@@ -97,6 +110,12 @@ export class AddVisualizationDialogComponent {
}
}
+ ngAfterViewInit() {
+ this.viewInitialized = true;
+ this.formValid = this.viewInitialized && this.parentForm.valid;
+ this.changeDetectorRef.detectChanges();
+ }
+
sortPipeline() {
this.visualizablePipelines.sort((a, b) => {
return a.pipelineName < b.pipelineName ? -1 : 1;
@@ -136,7 +155,7 @@ export class AddVisualizationDialogComponent {
this.selectedWidget = widget;
this.selectedWidget.config.forEach(sp => {
if (sp instanceof MappingPropertyUnary || sp instanceof MappingPropertyNary) {
- const requirement: EventProperty = this.findRequirement(this.selectedWidget.requiredSchema, sp.internalName);
+ const requirement: EventPropertyUnion = this.findRequirement(this.selectedWidget.requiredSchema, sp.internalName);
sp.mapsFromOptions = new MappingPropertyGenerator(requirement, this.selectedPipeline.schema.eventProperties).computeMatchingProperties();
}
if (sp instanceof FreeTextStaticProperty && sp.internalName === WidgetConfigBuilder.TITLE_KEY) {
@@ -160,8 +179,10 @@ export class AddVisualizationDialogComponent {
} else if (this.page == 'select-widget') {
this.page = 'configure-widget';
} else {
- const configuredWidget: DashboardWidget = new DashboardWidget();
+ const configuredWidget: DashboardWidgetModel = new DashboardWidgetModel();
+ configuredWidget["@class"] = "org.apache.streampipes.model.dashboard.DashboardWidgetModel";
configuredWidget.dashboardWidgetSettings = this.selectedWidget;
+ configuredWidget.dashboardWidgetSettings["@class"] = "org.apache.streampipes.model.dashboard.DashboardWidgetSettings";
configuredWidget.visualizablePipelineId = this.selectedPipeline._id;
configuredWidget.visualizablePipelineTopic = this.selectedPipeline.topic;
if (!this.data) {
@@ -170,7 +191,7 @@ export class AddVisualizationDialogComponent {
});
} else {
configuredWidget._id = this.data.widget._id;
- configuredWidget._ref = this.data.widget._ref;
+ configuredWidget._rev = this.data.widget._rev;
configuredWidget.widgetId = this.data.widget.widgetId;
this.dialogRef.close(configuredWidget);
}
@@ -188,11 +209,4 @@ export class AddVisualizationDialogComponent {
iconText(s) {
return this.elementIconText.getElementIconText(s);
}
-
- validConfiguration(valid: boolean) {
- setTimeout(() => {
- this.configValid = this.selectedWidget.config.every(sp => sp.isValid);
- });
- }
-
}
diff --git a/ui/src/app/dashboard/registry/widget-config-builder.ts b/ui/src/app/dashboard/registry/widget-config-builder.ts
index 7619483..2a22a7d 100644
--- a/ui/src/app/dashboard/registry/widget-config-builder.ts
+++ b/ui/src/app/dashboard/registry/widget-config-builder.ts
@@ -16,15 +16,14 @@
*
*/
-import {FreeTextStaticProperty} from "../../connect/model/FreeTextStaticProperty";
import {CollectedSchemaRequirements} from "../sdk/collected-schema-requirements";
-import {DashboardWidgetSettings} from "../../core-model/dashboard/DashboardWidgetSettings";
import {Datatypes} from "../sdk/model/datatypes";
-import {ColorPickerStaticProperty} from "../../connect/model/ColorPickerStaticProperty";
-import {OneOfStaticProperty} from "../../connect/model/OneOfStaticProperty";
-import {StaticProperty} from "../../connect/model/StaticProperty";
-import {Option} from "../../connect/model/Option";
import {Tuple2} from "../../core-model/base/Tuple2";
+import {
+ ColorPickerStaticProperty,
+ DashboardWidgetSettings,
+ FreeTextStaticProperty, OneOfStaticProperty, StaticProperty, Option
+} from "../../core-model/gen/streampipes-model";
export class WidgetConfigBuilder {
@@ -85,6 +84,7 @@ export class WidgetConfigBuilder {
requiredColorParameter(id: string, label: string, description: string, defaultColor?: string): WidgetConfigBuilder {
let csp = new ColorPickerStaticProperty();
+ csp["@class"] = "org.apache.streampipes.model.staticproperty.ColorPickerStaticProperty";
csp.internalName = id;
csp.label = label;
csp.description = description;
@@ -134,6 +134,7 @@ export class WidgetConfigBuilder {
sp.internalName = id;
sp.label = label;
sp.description = description;
+ sp["@class"] = "org.apache.streampipes.model.staticproperty.FreeTextStaticProperty";
}
prepareFreeTextStaticProperty(id: string, label: string, description: string, datatype: string) {
diff --git a/ui/src/app/dashboard/registry/widget-registry.ts b/ui/src/app/dashboard/registry/widget-registry.ts
index d7900f0..17fea83 100644
--- a/ui/src/app/dashboard/registry/widget-registry.ts
+++ b/ui/src/app/dashboard/registry/widget-registry.ts
@@ -16,9 +16,6 @@
*
*/
-import { EventSchema } from '../../connect/schema-editor/model/EventSchema';
-import { DashboardWidgetSettings } from '../../core-model/dashboard/DashboardWidgetSettings';
-import { VisualizablePipeline } from '../../core-model/dashboard/VisualizablePipeline';
import { AreaConfig } from '../components/widgets/area/area-config';
import { WidgetConfig } from '../components/widgets/base/base-config';
import { GaugeConfig } from '../components/widgets/gauge/gauge-config';
@@ -32,6 +29,10 @@ import { RawConfig } from '../components/widgets/raw/raw-config';
import { TableConfig } from '../components/widgets/table/table-config';
import { TrafficLightConfig } from '../components/widgets/trafficlight/traffic-light-config';
import { SchemaMatch } from '../sdk/matching/schema-match';
+import {
+ DashboardWidgetSettings, EventSchema,
+ VisualizablePipeline
+} from "../../core-model/gen/streampipes-model";
export class WidgetRegistry {
diff --git a/ui/src/app/dashboard/sdk/collected-schema-requirements.ts b/ui/src/app/dashboard/sdk/collected-schema-requirements.ts
index da96d05..f9d3ff8 100644
--- a/ui/src/app/dashboard/sdk/collected-schema-requirements.ts
+++ b/ui/src/app/dashboard/sdk/collected-schema-requirements.ts
@@ -16,23 +16,27 @@
*
*/
-import {StaticProperty} from "../../connect/model/StaticProperty";
-import {EventProperty} from "../../connect/schema-editor/model/EventProperty";
-import {EventSchema} from "../../connect/schema-editor/model/EventSchema";
+
+import {
+ EventPropertyUnion,
+ EventSchema,
+ StaticPropertyUnion
+} from "../../core-model/gen/streampipes-model";
export class CollectedSchemaRequirements {
- constructor(private requiredEventProperties: Array<EventProperty>, private requiredMappingProperties: Array<StaticProperty>) {
+ constructor(private requiredEventProperties: Array<EventPropertyUnion>, private requiredMappingProperties: Array<StaticPropertyUnion>) {
}
getEventSchema(): EventSchema {
let eventSchema = new EventSchema();
+ eventSchema["@class"] = "org.apache.streampipes.model.schema.EventSchema";
eventSchema.eventProperties = this.requiredEventProperties;
return eventSchema;
}
- getRequiredMappingProperties(): Array<StaticProperty> {
+ getRequiredMappingProperties(): Array<StaticPropertyUnion> {
return this.requiredMappingProperties;
}
}
\ No newline at end of file
diff --git a/ui/src/app/dashboard/sdk/ep-requirements.ts b/ui/src/app/dashboard/sdk/ep-requirements.ts
index 5a2174f..3a075bf 100644
--- a/ui/src/app/dashboard/sdk/ep-requirements.ts
+++ b/ui/src/app/dashboard/sdk/ep-requirements.ts
@@ -16,62 +16,66 @@
*
*/
-import {EventProperty} from "../../connect/schema-editor/model/EventProperty";
-import {EventPropertyPrimitive} from "../../connect/schema-editor/model/EventPropertyPrimitive";
import {Datatypes} from "./model/datatypes";
import {Vocabulary} from "./model/vocabulary";
+import {
+ EventPropertyPrimitive,
+ EventPropertyUnion
+} from "../../core-model/gen/streampipes-model";
export class EpRequirements {
private static ep(): EventPropertyPrimitive {
- let ep = new EventPropertyPrimitive(undefined, undefined);
+ // TODO factories for properties
+ let ep = new EventPropertyPrimitive();
+ ep["@class"] = "org.apache.streampipes.model.schema.EventPropertyPrimitive";
return ep;
}
- static anyProperty(): EventProperty {
+ static anyProperty(): EventPropertyUnion {
return EpRequirements.ep();
}
- static imageReq(): EventProperty {
+ static imageReq(): EventPropertyUnion {
return EpRequirements.domainPropertyReq("https://image.com");
}
- static latitudeReq(): EventProperty {
+ static latitudeReq(): EventPropertyUnion {
return EpRequirements.domainPropertyReq(Vocabulary.GEO + "lat");
}
- static longitudeReq(): EventProperty {
+ static longitudeReq(): EventPropertyUnion {
return EpRequirements.domainPropertyReq(Vocabulary.GEO + "long")
}
- static timestampReq(): EventProperty {
+ static timestampReq(): EventPropertyUnion {
return EpRequirements.domainPropertyReq("http://schema.org/DateTime");
}
- static numberReq(): EventProperty {
+ static numberReq(): EventPropertyUnion {
return EpRequirements.datatypeReq(Datatypes.Number);
}
- static stringReq(): EventProperty {
+ static stringReq(): EventPropertyUnion {
return EpRequirements.datatypeReq(Datatypes.String);
}
- static integerReq(): EventProperty {
+ static integerReq(): EventPropertyUnion {
return EpRequirements.datatypeReq(Datatypes.Integer);
}
static domainPropertyReq(domainProperty: string): EventPropertyPrimitive {
let eventProperty = EpRequirements.ep();
- eventProperty.setDomainProperty(domainProperty);
+ eventProperty.domainProperties = [domainProperty];
return eventProperty;
}
static datatypeReq(datatype: Datatypes): EventPropertyPrimitive {
let eventProperty = EpRequirements.ep();
- eventProperty.setRuntimeType(datatype.toUri());
+ eventProperty.runtimeType = datatype.toUri();
return eventProperty;
-}
+ }
}
\ No newline at end of file
diff --git a/ui/src/app/dashboard/sdk/extractor/static-property-extractor.ts b/ui/src/app/dashboard/sdk/extractor/static-property-extractor.ts
index ef52c75..00fcb14 100644
--- a/ui/src/app/dashboard/sdk/extractor/static-property-extractor.ts
+++ b/ui/src/app/dashboard/sdk/extractor/static-property-extractor.ts
@@ -16,19 +16,18 @@
*
*/
-import {EventSchema} from "../../../connect/schema-editor/model/EventSchema";
-import {StaticProperty} from "../../../connect/model/StaticProperty";
-import {MappingPropertyUnary} from "../../../connect/model/MappingPropertyUnary";
-import {FreeTextStaticProperty} from "../../../connect/model/FreeTextStaticProperty";
-import {ColorPickerStaticProperty} from "../../../connect/model/ColorPickerStaticProperty";
-import {MappingPropertyNary} from "../../../connect/model/MappingPropertyNary";
-import {OneOfStaticProperty} from "../../../connect/model/OneOfStaticProperty";
-import {EventProperty} from "../../../connect/schema-editor/model/EventProperty";
+
+import {
+ ColorPickerStaticProperty, EventPropertyUnion,
+ EventSchema, FreeTextStaticProperty, MappingPropertyNary,
+ MappingPropertyUnary, OneOfStaticProperty,
+ StaticPropertyUnion
+} from "../../../core-model/gen/streampipes-model";
export class StaticPropertyExtractor {
constructor(private inputSchema: EventSchema,
- private staticProperties: Array<StaticProperty>) {
+ private staticProperties: Array<StaticPropertyUnion>) {
}
@@ -80,11 +79,11 @@ export class StaticPropertyExtractor {
return this.singleValueParameter(internalId) as number;
}
- getStaticPropertyByName(internalId: string): StaticProperty {
+ getStaticPropertyByName(internalId: string): StaticPropertyUnion {
return this.staticProperties.find(sp => (sp.internalName == internalId));
}
- getEventPropertyByName(runtimeName: string): EventProperty {
+ getEventPropertyByName(runtimeName: string): EventPropertyUnion {
return this.inputSchema.eventProperties.find(ep => ep.runtimeName === runtimeName);
}
diff --git a/ui/src/app/dashboard/sdk/matching/domain-property-match.ts b/ui/src/app/dashboard/sdk/matching/domain-property-match.ts
index 836df01..b0041cd 100644
--- a/ui/src/app/dashboard/sdk/matching/domain-property-match.ts
+++ b/ui/src/app/dashboard/sdk/matching/domain-property-match.ts
@@ -18,11 +18,15 @@
export class DomainPropertyMatch {
- match(domainPropertyRequirement: string, domainPropertyOffer: string) {
- if (domainPropertyRequirement == undefined) {
+ match(domainPropertyRequirements: Array<string>, domainPropertyOffers: Array<string>) {
+ if (domainPropertyRequirements == undefined || domainPropertyRequirements.length == 0) {
return true;
} else {
- return domainPropertyRequirement == domainPropertyOffer;
+ if (!domainPropertyOffers) {
+ return false;
+ } else {
+ return domainPropertyRequirements[0] == domainPropertyOffers[0];
+ }
}
}
}
\ No newline at end of file
diff --git a/ui/src/app/dashboard/sdk/matching/mapping-property-generator.ts b/ui/src/app/dashboard/sdk/matching/mapping-property-generator.ts
index 3f47e1c..9640ac1 100644
--- a/ui/src/app/dashboard/sdk/matching/mapping-property-generator.ts
+++ b/ui/src/app/dashboard/sdk/matching/mapping-property-generator.ts
@@ -18,13 +18,15 @@
import {EventProperty} from "../../../connect/schema-editor/model/EventProperty";
import {PropertyMatch} from "./property-match";
+import {EventPropertyUnion} from "../../../core-model/gen/streampipes-model";
export class MappingPropertyGenerator {
private selector: string = "s0";
private separator: string = "::";
- constructor(private requiredEventProperty: EventProperty, private providedEventProperties: Array<EventProperty>) {
+ constructor(private requiredEventProperty: EventPropertyUnion,
+ private providedEventProperties: Array<EventPropertyUnion>) {
}
diff --git a/ui/src/app/dashboard/sdk/matching/primitive-property-match.ts b/ui/src/app/dashboard/sdk/matching/primitive-property-match.ts
index 6fadf06..be42e17 100644
--- a/ui/src/app/dashboard/sdk/matching/primitive-property-match.ts
+++ b/ui/src/app/dashboard/sdk/matching/primitive-property-match.ts
@@ -16,16 +16,16 @@
*
*/
-import {EventPropertyPrimitive} from "../../../connect/schema-editor/model/EventPropertyPrimitive";
import {DatatypeMatch} from "./datatype-match";
import {DomainPropertyMatch} from "./domain-property-match";
+import {EventPropertyPrimitive} from "../../../core-model/gen/streampipes-model";
export class PrimitivePropertyMatch {
match(requirement: EventPropertyPrimitive, offer: EventPropertyPrimitive) {
if (requirement != undefined) {
return new DatatypeMatch().match(requirement.runtimeType, offer.runtimeType) &&
- new DomainPropertyMatch().match(requirement.domainProperty, offer.domainProperty);
+ new DomainPropertyMatch().match(requirement.domainProperties, offer.domainProperties);
} else {
return true;
}
diff --git a/ui/src/app/dashboard/sdk/matching/property-match.ts b/ui/src/app/dashboard/sdk/matching/property-match.ts
index 29e145c..f8f9365 100644
--- a/ui/src/app/dashboard/sdk/matching/property-match.ts
+++ b/ui/src/app/dashboard/sdk/matching/property-match.ts
@@ -16,13 +16,15 @@
*
*/
-import {EventProperty} from "../../../connect/schema-editor/model/EventProperty";
-import {EventPropertyPrimitive} from "../../../connect/schema-editor/model/EventPropertyPrimitive";
import {PrimitivePropertyMatch} from "./primitive-property-match";
+import {
+ EventPropertyPrimitive,
+ EventPropertyUnion
+} from "../../../core-model/gen/streampipes-model";
export class PropertyMatch {
- match(requirement: EventProperty, offer: EventProperty): boolean {
+ match(requirement: EventPropertyUnion, offer: EventPropertyUnion): boolean {
if (requirement instanceof EventPropertyPrimitive && offer instanceof EventPropertyPrimitive) {
return new PrimitivePropertyMatch().match(requirement, offer);
} else {
diff --git a/ui/src/app/dashboard/sdk/matching/schema-match.ts b/ui/src/app/dashboard/sdk/matching/schema-match.ts
index f24ea54..cec46bf 100644
--- a/ui/src/app/dashboard/sdk/matching/schema-match.ts
+++ b/ui/src/app/dashboard/sdk/matching/schema-match.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import {EventSchema} from "../../../connect/schema-editor/model/EventSchema";
+import {EventSchema} from "../../../core-model/gen/streampipes-model";
import {PropertyMatch} from "./property-match";
export class SchemaMatch {
diff --git a/ui/src/app/dashboard/sdk/schema-requirements-builder.ts b/ui/src/app/dashboard/sdk/schema-requirements-builder.ts
index 8e0c3d2..a957b46 100644
--- a/ui/src/app/dashboard/sdk/schema-requirements-builder.ts
+++ b/ui/src/app/dashboard/sdk/schema-requirements-builder.ts
@@ -16,16 +16,17 @@
*
*/
-import {EventProperty} from "../../connect/schema-editor/model/EventProperty";
-import {StaticProperty} from "../../connect/model/StaticProperty";
import {CollectedSchemaRequirements} from "./collected-schema-requirements";
-import {MappingPropertyUnary} from "../../connect/model/MappingPropertyUnary";
-import {MappingPropertyNary} from "../../connect/model/MappingPropertyNary";
+import {
+ EventPropertyUnion, MappingPropertyNary,
+ MappingPropertyUnary, StaticPropertyType,
+ StaticPropertyUnion
+} from "../../core-model/gen/streampipes-model";
export class SchemaRequirementsBuilder {
- private requiredEventProperties: Array<EventProperty>;
- private staticProperties: Array<StaticProperty>;
+ private requiredEventProperties: Array<EventPropertyUnion>;
+ private staticProperties: Array<StaticPropertyUnion>;
private constructor() {
this.requiredEventProperties = [];
@@ -36,9 +37,13 @@ export class SchemaRequirementsBuilder {
return new SchemaRequirementsBuilder();
}
- requiredPropertyWithUnaryMapping(internalId: string, label: string, description: string, eventProperty: EventProperty): SchemaRequirementsBuilder {
- eventProperty.setRuntimeName(internalId);
- let mp = this.makeMappingProperty(internalId, label, description, new MappingPropertyUnary());
+ requiredPropertyWithUnaryMapping(internalId: string, label: string, description: string, eventProperty: EventPropertyUnion): SchemaRequirementsBuilder {
+ eventProperty.runtimeName = internalId;
+ let mp = this.makeMappingProperty(internalId,
+ label,
+ description,
+ new MappingPropertyUnary(),
+ "org.apache.streampipes.model.staticproperty.MappingPropertyUnary");
this.staticProperties.push(mp);
this.requiredEventProperties.push(eventProperty);
@@ -46,9 +51,13 @@ export class SchemaRequirementsBuilder {
return this;
}
- requiredPropertyWithNaryMapping(internalId: string, label: string, description: string, eventProperty: EventProperty): SchemaRequirementsBuilder {
- eventProperty.setRuntimeName(internalId);
- let mp = this.makeMappingProperty(internalId, label, description, new MappingPropertyNary());
+ requiredPropertyWithNaryMapping(internalId: string, label: string, description: string, eventProperty: EventPropertyUnion): SchemaRequirementsBuilder {
+ eventProperty.runtimeName = internalId;
+ let mp = this.makeMappingProperty(internalId,
+ label,
+ description,
+ new MappingPropertyNary(),
+ "org.apache.streampipes.model.staticproperty.MappingPropertyNary");
this.staticProperties.push(mp);
this.requiredEventProperties.push(eventProperty);
@@ -56,10 +65,11 @@ export class SchemaRequirementsBuilder {
return this;
}
- makeMappingProperty(internalId: string, label: string, description: string, sp: StaticProperty): StaticProperty {
+ makeMappingProperty(internalId: string, label: string, description: string, sp: StaticPropertyUnion, className: any): StaticPropertyUnion {
sp.internalName = internalId;
sp.label = label;
sp.description = description;
+ sp["@class"] = className;
return sp;
}
diff --git a/ui/src/app/dashboard/services/dashboard.service.ts b/ui/src/app/dashboard/services/dashboard.service.ts
index e9f6200..defa4fe 100644
--- a/ui/src/app/dashboard/services/dashboard.service.ts
+++ b/ui/src/app/dashboard/services/dashboard.service.ts
@@ -23,9 +23,8 @@ import {from, Observable} from "rxjs";
import {AuthStatusService} from "../../services/auth-status.service";
import {Dashboard} from "../models/dashboard.model";
import {TsonLdSerializerService} from "../../platform-services/tsonld-serializer.service";
-import {DashboardWidget} from "../../core-model/dashboard/DashboardWidget";
-import {VisualizablePipeline} from "../../core-model/dashboard/VisualizablePipeline";
import {MeasurementUnit} from "../../core-model/measurement-unit/MeasurementUnit";
+import {DashboardWidgetModel, VisualizablePipeline} from "../../core-model/gen/streampipes-model";
@Injectable()
export class DashboardService {
@@ -36,11 +35,6 @@ export class DashboardService {
private tsonLdSerializerService: TsonLdSerializerService) {
}
- getPipelines(): Observable<Array<any>> {
- return this.http.get(this.pipelinesUrl + "/own").map(data => {
- return data as any[];
- })
- }
getPipelineById(id: string): Observable<any> {
return this.http.get(this.pipelinesUrl + "/" +id).map(data => {
@@ -51,25 +45,25 @@ export class DashboardService {
getVisualizablePipelines(): Observable<Array<VisualizablePipeline>> {
return this.http
.get(this.visualizablePipelineUrl)
- .map(data => {
- return this.tsonLdSerializerService.fromJsonLdContainer(data, 'sp:VisualizablePipeline')
- });
+ .pipe(map(data => {
+ return (data as []).map(p => VisualizablePipeline.fromData(p as VisualizablePipeline));
+ }));
}
getVisualizablePipelineById(id: string): Observable<VisualizablePipeline> {
return this.http
.get(this.visualizablePipelineUrl + "/" + id)
- .map(data => {
- return this.tsonLdSerializerService.fromJsonLd(data, 'sp:VisualizablePipeline')
- });
+ .pipe(map(data => {
+ return VisualizablePipeline.fromData(data as VisualizablePipeline);
+ }));
}
getVisualizablePipelineByTopic(topic: string): Observable<VisualizablePipeline> {
return this.http
.get(this.visualizablePipelineUrl + "/topic/" + topic)
- .map(data => {
- return this.tsonLdSerializerService.fromJsonLd(data, 'sp:VisualizablePipeline')
- });
+ .pipe(map(data => {
+ return VisualizablePipeline.fromData(data as VisualizablePipeline);
+ }));
}
getDashboards(): Observable<Array<Dashboard>> {
@@ -113,7 +107,7 @@ export class DashboardService {
}
private get dashboardUrl() {
- return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/ld/dashboards'
+ return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/dashboard/dashboards'
}
private get pipelinesUrl() {
@@ -121,61 +115,30 @@ export class DashboardService {
}
private get dashboardWidgetUrl() {
- return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/ld/widgets'
+ return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/dashboard/widgets'
}
private get visualizablePipelineUrl() {
- return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/ld/pipelines'
- }
-
- getWidget(widgetId: string): Observable<DashboardWidget> {
- let promise = new Promise<DashboardWidget>((resolve, reject) => {
- this.http.get(this.dashboardWidgetUrl + "/" +widgetId).subscribe(response => {
- let dashboardWidget: DashboardWidget = this.tsonLdSerializerService.fromJsonLd(response, "sp:DashboardWidgetModel");
- dashboardWidget.dashboardWidgetSettings.config.sort((a, b) => {
- return a.index - b.index;
- });
- resolve(dashboardWidget);
- });
- });
- return from(promise);
+ return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/dashboard/pipelines'
}
- saveWidget(widget: DashboardWidget): Observable<DashboardWidget> {
- return this.serializeAndPost(this.dashboardWidgetUrl, widget);
+ getWidget(widgetId: string): Observable<DashboardWidgetModel> {
+ return this.http.get(this.dashboardWidgetUrl + "/" +widgetId).pipe(map(d => {
+ return DashboardWidgetModel.fromData(d as DashboardWidgetModel)
+ }));
}
- deleteWidget(widgetId: string): Observable<any> {
- return this.http.delete(this.dashboardWidgetUrl + "/" +widgetId);
+ saveWidget(widget: DashboardWidgetModel): Observable<DashboardWidgetModel> {
+ return this.http.post(this.dashboardWidgetUrl, widget).pipe(map(response => {
+ return DashboardWidgetModel.fromData(response as DashboardWidgetModel);
+ }));
}
- updateWidget(widget: DashboardWidget): Observable<any> {
- let promise = new Promise<DashboardWidget>((resolve, reject) => {
- this.tsonLdSerializerService.toJsonLd(widget).subscribe(serialized => {
- this.http.put(this.dashboardWidgetUrl + "/" +widget._id, serialized, this.jsonLdHeaders()).subscribe(result => {
- resolve();
- })
- });
- });
- return from(promise);
- }
-
- serializeAndPost(url: string, object: any): Observable<DashboardWidget> {
- let promise = new Promise<DashboardWidget>((resolve, reject) => {
- this.tsonLdSerializerService.toJsonLd(object).subscribe(serialized => {
- this.http.post(url, serialized, this.jsonLdHeaders()).pipe(map(response => {
- resolve(this.tsonLdSerializerService.fromJsonLd(response, "sp:DashboardWidgetModel"));
- })).subscribe();
- });
- });
- return from(promise);
+ deleteWidget(widgetId: string): Observable<any> {
+ return this.http.delete(this.dashboardWidgetUrl + "/" +widgetId);
}
- jsonLdHeaders(): any {
- return {
- headers: new HttpHeaders({
- 'Content-Type': 'application/ld+json',
- }),
- };
+ updateWidget(widget: DashboardWidgetModel): Observable<any> {
+ return this.http.put(this.dashboardWidgetUrl + "/" +widget._id, widget);
}
}
\ No newline at end of file
diff --git a/ui/src/app/platform-services/apis/pipeline.service.ts b/ui/src/app/platform-services/apis/pipeline.service.ts
index 91637bc..0b6bc12 100644
--- a/ui/src/app/platform-services/apis/pipeline.service.ts
+++ b/ui/src/app/platform-services/apis/pipeline.service.ts
@@ -51,22 +51,23 @@ export class PipelineService {
return this.http.get(this.platformServicesCommons.authUserBasePath() + "/pipelines/" + pipelineId + "/stop");
}
- getPipelineById(pipelineId) {
- return this.http.get(this.platformServicesCommons.authUserBasePath() + "/pipelines/" + pipelineId);
+ getPipelineById(pipelineId): Observable<Pipeline> {
+ return this.http.get(this.platformServicesCommons.authUserBasePath() + "/pipelines/" + pipelineId)
+ .pipe(map(response => Pipeline.fromData(response as Pipeline)));
}
getPipelineStatusById(pipelineId) {
return this.http.get(this.platformServicesCommons.authUserBasePath() + "/pipelines/" + pipelineId + "/status");
}
- storePipeline(pipeline): Observable<Message> {
+ storePipeline(pipeline: Pipeline): Observable<Message> {
return this.http.post(this.platformServicesCommons.authUserBasePath() + "/pipelines", pipeline)
.pipe(map(response => {
return Message.fromData(response as Message);
}));
}
- updatePipeline(pipeline): Observable<Message> {
+ updatePipeline(pipeline: Pipeline): Observable<Message> {
var pipelineId = pipeline._id;
return this.http.put(this.platformServicesCommons.authUserBasePath() + "/pipelines/" + pipelineId, pipeline)
.pipe(map(response => {