You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by te...@apache.org on 2020/01/08 14:44:07 UTC
[incubator-streampipes-extensions] 01/01: [STREAMPIPES-17] WIP
Connect Assets - create endpoints for assets - Connect-UI gets icon from
connect-container - support locals for Adapter/Protocols - starts to update
Adapters/Protocol with assets and locals
This is an automated email from the ASF dual-hosted git repository.
tex pushed a commit to branch connect_assets
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes-extensions.git
commit 81bc9689400209f4845b2098eaeafabf05f53775
Author: tex <te...@fzi.de>
AuthorDate: Wed Jan 8 15:43:30 2020 +0100
[STREAMPIPES-17] WIP Connect Assets
- create endpoints for assets
- Connect-UI gets icon from connect-container
- support locals for Adapter/Protocols
- starts to update Adapters/Protocol with assets and locals
---
.../streampipes/connect/ConnectAdapterInit.java | 14 ++---
.../connect/adapters/ros/RosBridgeAdapter.java | 18 +++----
.../connect/protocol/set/FileProtocol.java | 3 +-
.../connect/protocol/set/HttpProtocol.java | 3 +-
.../documentation.md | 58 +++++++++++++++++++++
.../icon.png | Bin 0 -> 4838 bytes
.../strings.en | 11 ++++
7 files changed, 89 insertions(+), 18 deletions(-)
diff --git a/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/ConnectAdapterInit.java b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/ConnectAdapterInit.java
index 00d2572..75bef15 100644
--- a/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/ConnectAdapterInit.java
+++ b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/ConnectAdapterInit.java
@@ -56,15 +56,15 @@ public class ConnectAdapterInit extends AdapterWorkerContainer {
// Protocols
.add(new FileProtocol())
.add(new HttpProtocol())
- .add(new FileStreamProtocol())
+ /* .add(new FileStreamProtocol())
.add(new HDFSProtocol())
.add(new KafkaProtocol())
.add(new MqttProtocol())
.add(new HttpStreamProtocol())
- .add(new PulsarProtocol())
+ .add(new PulsarProtocol()) */
// Specific Adapters
- .add(new GdeltAdapter())
+ /* .add(new GdeltAdapter())
.add(new CoindeskBitcoinAdapter())
.add(new IexCloudNewsAdapter())
.add(new IexCloudStockAdapter())
@@ -74,13 +74,13 @@ public class ConnectAdapterInit extends AdapterWorkerContainer {
.add(new RandomDataStreamAdapter())
.add(new SlackAdapter())
.add(new WikipediaEditedArticlesAdapter())
- .add(new WikipediaNewArticlesAdapter())
- .add(new RosBridgeAdapter())
- .add(new OpcUaAdapter())
+ .add(new WikipediaNewArticlesAdapter()) */
+ .add(new RosBridgeAdapter());
+ /* .add(new OpcUaAdapter())
.add(new InfluxDbStreamAdapter())
.add(new InfluxDbSetAdapter())
.add(new TISensorTag())
- .add(new Plc4xS7Adapter());
+ .add(new Plc4xS7Adapter()); */
String workerUrl = ConnectWorkerConfig.INSTANCE.getConnectContainerWorkerUrl();
String masterUrl = ConnectWorkerConfig.INSTANCE.getConnectContainerMasterUrl();
diff --git a/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/adapters/ros/RosBridgeAdapter.java b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/adapters/ros/RosBridgeAdapter.java
index 1d22372..eb624a8 100644
--- a/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/adapters/ros/RosBridgeAdapter.java
+++ b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/adapters/ros/RosBridgeAdapter.java
@@ -46,6 +46,8 @@ import org.apache.streampipes.model.staticproperty.Option;
import org.apache.streampipes.sdk.builder.adapter.SpecificDataStreamAdapterBuilder;
import org.apache.streampipes.sdk.extractor.StaticPropertyExtractor;
import org.apache.streampipes.sdk.helpers.Labels;
+import org.apache.streampipes.sdk.helpers.Locales;
+import org.apache.streampipes.sdk.utils.Assets;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
@@ -55,7 +57,7 @@ import java.util.stream.Collectors;
public class RosBridgeAdapter extends SpecificDataStreamAdapter implements ResolvesContainerProvidedOptions {
- public static final String ID = "http://streampipes.org/adapter/specific/ros";
+ public static final String ID = "org.apache.streampipes.adapters.specific.ros";
private static final String ROS_HOST_KEY = "ROS_HOST_KEY";
private static final String ROS_PORT_KEY = "ROS_PORT_KEY";
@@ -82,19 +84,17 @@ public class RosBridgeAdapter extends SpecificDataStreamAdapter implements Reso
@Override
public SpecificAdapterStreamDescription declareModel() {
- SpecificAdapterStreamDescription description = SpecificDataStreamAdapterBuilder.create(ID, "ROS Bridge", "Connect Robots running on ROS")
- .iconUrl("ros.png")
+ SpecificAdapterStreamDescription description = SpecificDataStreamAdapterBuilder.create(ID)
+ .withLocales(Locales.EN)
+ .withAssets(Assets.DOCUMENTATION, Assets.ICON)
.category(AdapterType.Manufacturing)
- .requiredTextParameter(Labels.from(ROS_HOST_KEY, "Ros Bridge", "Example: test-server.com (No protocol) "))
- .requiredTextParameter(Labels.from(ROS_PORT_KEY, "Port", "Example: 9090"))
- .requiredSingleValueSelectionFromContainer(Labels.from(TOPIC_KEY, "Topic",
- "Example: /battery (Starts with /) "), Arrays.asList(ROS_HOST_KEY,
+ .requiredTextParameter(Labels.withId(ROS_HOST_KEY))
+ .requiredTextParameter(Labels.withId(ROS_PORT_KEY))
+ .requiredSingleValueSelectionFromContainer(Labels.withId(TOPIC_KEY), Arrays.asList(ROS_HOST_KEY,
ROS_PORT_KEY))
// .requiredTextParameter(Labels.from(TOPIC_KEY, "Topic", "Example: /battery " +
// "(Starts with /) "))
.build();
- description.setAppId(ID);
-
return description;
}
diff --git a/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/protocol/set/FileProtocol.java b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/protocol/set/FileProtocol.java
index 2fb6706..4ff8056 100644
--- a/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/protocol/set/FileProtocol.java
+++ b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/protocol/set/FileProtocol.java
@@ -47,7 +47,8 @@ public class FileProtocol extends Protocol {
private static Logger logger = LoggerFactory.getLogger(FileProtocol.class);
- public static final String ID = "https://streampipes.org/vocabulary/v1/protocol/set/file";
+ // public static final String ID = "https://streampipes.org/vocabulary/v1/protocol/set/file";
+ public static final String ID = "org.apache.streampipes.protocol.set.file";
private String fileUri;
diff --git a/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/protocol/set/HttpProtocol.java b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/protocol/set/HttpProtocol.java
index 4a24186..b07ab72 100644
--- a/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/protocol/set/HttpProtocol.java
+++ b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/java/org/apache/streampipes/connect/protocol/set/HttpProtocol.java
@@ -47,7 +47,8 @@ public class HttpProtocol extends Protocol {
Logger logger = LoggerFactory.getLogger(Protocol.class);
- public static final String ID = "https://streampipes.org/vocabulary/v1/protocol/set/http";
+ //public static final String ID = "https://streampipes.org/vocabulary/v1/protocol/set/http";
+ public static final String ID = "org.apache.streampipes.protocol.set.http";
private String url;
diff --git a/streampipes-connect-adapters/streampipes-connect-adapter/src/main/resources/org.apache.streampipes.adapters.specific.ros/documentation.md b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/resources/org.apache.streampipes.adapters.specific.ros/documentation.md
new file mode 100644
index 0000000..1fb5573
--- /dev/null
+++ b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/resources/org.apache.streampipes.adapters.specific.ros/documentation.md
@@ -0,0 +1,58 @@
+<!--
+ ~ 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.
+ ~
+ -->
+
+## Ros Bridge
+
+<p align="center">
+ <img src="icon.png" width="150px;" class="pe-image-documentation"/>
+</p>
+
+***
+
+## Description
+
+Connect Robots running on ROS
+
+
+***
+
+## Required input
+
+This sink does not have any requirements and works with any incoming event type.
+
+***
+
+## Configuration
+
+Describe the configuration parameters here
+
+### Ros Bridge
+
+Example: test-server.com (No protocol)
+
+### Port
+
+The port of the ROS instance.
+
+### Topic
+
+Example: /battery (Starts with /)
+
+
+## Output
+
diff --git a/streampipes-connect-adapters/streampipes-connect-adapter/src/main/resources/org.apache.streampipes.adapters.specific.ros/icon.png b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/resources/org.apache.streampipes.adapters.specific.ros/icon.png
new file mode 100644
index 0000000..ae0e943
Binary files /dev/null and b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/resources/org.apache.streampipes.adapters.specific.ros/icon.png differ
diff --git a/streampipes-connect-adapters/streampipes-connect-adapter/src/main/resources/org.apache.streampipes.adapters.specific.ros/strings.en b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/resources/org.apache.streampipes.adapters.specific.ros/strings.en
new file mode 100644
index 0000000..25e4e0a
--- /dev/null
+++ b/streampipes-connect-adapters/streampipes-connect-adapter/src/main/resources/org.apache.streampipes.adapters.specific.ros/strings.en
@@ -0,0 +1,11 @@
+org.apache.streampipes.adapters.specific.ros.title=ROS Bridge
+org.apache.streampipes.adapters.specific.ros.description=Connect Robots running on ROS.
+
+ROS_HOST_KEY.title=Ros Bridge
+ROS_HOST_KEY.description=Example: test-server.com (No protocol)
+
+ROS_PORT_KEY.title=Port
+ROS_PORT_KEY.description=Example: 9090
+
+TOPIC_KEY.title=Topic
+TOPIC_KEY.description=Example: /battery (Starts with /)
\ No newline at end of file