You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by bo...@apache.org on 2023/10/19 15:58:01 UTC

[streampipes-website] branch update-adapter-docu updated (ac070345 -> 7a4b9a29)

This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a change to branch update-adapter-docu
in repository https://gitbox.apache.org/repos/asf/streampipes-website.git


    from ac070345 docs: describe first steps of adapter creation
     new 2072fe60 docs: change heading
     add d79a09b5 Bump @babel/traverse from 7.22.5 to 7.23.2 in /website-v2 (#121)
     new aaa2fcbd Merge remote-tracking branch 'origin/dev' into update-adapter-docu
     new 7a4b9a29 small update

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 docs/06_extend-tutorial-adapters.md |  30 ++++---
 website-v2/package-lock.json        | 167 +++++++++++++++++++++++++-----------
 2 files changed, 133 insertions(+), 64 deletions(-)


[streampipes-website] 03/03: small update

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a commit to branch update-adapter-docu
in repository https://gitbox.apache.org/repos/asf/streampipes-website.git

commit 7a4b9a2962ce87e626308480f9ac962f162de039
Author: bossenti <bo...@posteo.de>
AuthorDate: Thu Oct 19 17:57:29 2023 +0200

    small update
---
 docs/06_extend-tutorial-adapters.md | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/docs/06_extend-tutorial-adapters.md b/docs/06_extend-tutorial-adapters.md
index eac1bc1d..1d06f470 100644
--- a/docs/06_extend-tutorial-adapters.md
+++ b/docs/06_extend-tutorial-adapters.md
@@ -53,7 +53,7 @@ that [Apache Maven](https://maven.apache.org/install.html) isinstalled):
 mvn archetype:generate \
 -DarchetypeGroupId=org.apache.streampipes -DarchetypeArtifactId=streampipes-archetype-extensions-jvm \
 -DarchetypeVersion=0.93.0-SNAPSHOT -DgroupId=org.apache.streampipes \
--DartifactId=streampipes-archetype-extensions-jvm -DclassNamePrefix=ParcelControlStation -DpackageName=parcel-control
+-DartifactId=streampipes-archetype-extensions-jvm -DclassNamePrefix=ParcelControlStation -DpackageName=parcelcontrol
 ```
 
 This command will ask you for input twice, you can just skip both of them by hitting *enter*.
@@ -82,26 +82,26 @@ Note that you can customize the parameters of the mvn command to affect the file
 |-- src
 |   |-- main
 |   |   |-- java.org.apache.streampipes  # name after .java. is determined by '-DgroupId'
-|   |   |   |-- pe.parcel-control  # name after .pe. is determined by '-DpackageName'
+|   |   |   |-- pe.parcelcontrol  # name after .pe. is determined by '-DpackageName'
 |   |   |   |   |-- ParcelControlStationDataProcessor.java  # class name is determined by '-DclassNamePrefix'
 |   |   |   |   |-- ParcelControlStationDataSink.java
 |   |   |   |   |-- ParcelControlStationGenericAdapter.java
 |   |   |   |   |-- ParcelControlStationSpecificAdapter.java
 |   |   |   |-- Init.java
 |   |   |-- resources
-|   |   |   |-- org.apache.streampipes.pe.parcel-control.genericadapter
+|   |   |   |-- org.apache.streampipes.pe.parcelcontrol.genericadapter
 |   |   |   |   |-- documentation.md
 |   |   |   |   |-- icon.png
 |   |   |   |   |-- strings.en
-|   |   |   |-- org.apache.streampipes.pe.parcel-control.processor
+|   |   |   |-- org.apache.streampipes.pe.parcelcontrol.processor
 |   |   |   |   |-- documentation.md
 |   |   |   |   |-- icon.png
 |   |   |   |   |-- strings.en
-|   |   |   |-- org.apache.streampipes.pe.parcel-control.sink
+|   |   |   |-- org.apache.streampipes.pe.parcelcontrol.sink
 |   |   |   |   |-- documentation.md
 |   |   |   |   |-- icon.png
 |   |   |   |   |-- strings.en
-|   |   |   |-- org.apache.streampipes.pe.parcel-control.specificadapter
+|   |   |   |-- org.apache.streampipes.pe.parcelcontrol.specificadapter
 |   |   |   |   |-- documentation.md
 |   |   |   |   |-- icon.png
 |   |   |   |   |-- strings.en
@@ -131,7 +131,7 @@ First, let us take a look at the `ParcelControlStationSpecificAdapter.java` file
 archetype.
 
 ```java jsx showLineNumbers
-package org.apache.streampipes.pe.parcel-control;
+package org.apache.streampipes.pe.parcelcontrol;
 
 import org.apache.streampipes.commons.exceptions.connect.AdapterException;
 import org.apache.streampipes.extensions.api.connect.IAdapterConfiguration;
@@ -160,7 +160,7 @@ public class ParcelControlStationSpecificAdapter implements StreamPipesAdapter {
   @Override
   public IAdapterConfiguration declareConfig() {
     return AdapterConfigurationBuilder.create(
-        "org.apache.streampipes.pe.parcel-control.specificadapter",
+        "org.apache.streampipes.pe.parcelcontrol.specificadapter",
         ParcelControlStationSpecificAdapter::new
       )
       .withAssets(Assets.DOCUMENTATION, Assets.ICON)
@@ -238,7 +238,7 @@ So let's have a quick look at the important aspects:
   @Override
   public IAdapterConfiguration declareConfig() {
     return AdapterConfigurationBuilder.create(
-        "org.apache.streampipes.pe.parcel-control.specificadapter",
+        "org.apache.streampipes.pe.parcelcontrol.specificadapter",
         ParcelControlStationSpecificAdapter::new
       )
       .withAssets(Assets.DOCUMENTATION, Assets.ICON)
@@ -252,8 +252,8 @@ Before we continue, let's quickly have a look at the `strings.en` file that defi
 Here we can define a meaningful and human-readable adapter tile in the first line and a short description:
 
 ```text
-org.apache.streampipes.pe.parcel-control.specificadapter.title=Parcel Control Station (simple)
-org.apache.streampipes.pe.parcel-control.specificadapter.description=This adapter simulates data coming from a parcel control station in a logistics center.
+org.apache.streampipes.pe.parcelcontrol.specificadapter.title=Parcel Control Station (simple)
+org.apache.streampipes.pe.parcelcontrol.specificadapter.description=This adapter simulates data coming from a parcel control station in a logistics center.
 ```
 
 Now we have successfully configured our adapter and prepared all descriptive elements, we can focus on the actual logic.
@@ -362,7 +362,11 @@ more in the [Advanced section](#advanced)).
 But in our case, we already know the event schema, and it never changes, so we can just define it:
 
 ```java jsx {3,13-20} showLineNumbers
-public static GuessSchema getFlowrateSchema() {
+@Override
+public GuessSchema onSchemaRequested(IAdapterParameterExtractor extractor,
+                                     IAdapterGuessSchemaContext adapterGuessSchemaContext) throws AdapterException {
+
+  // build the schema by adding properties to the schema builder and a preview if possible
   return GuessSchemaBuilder.create()
           .property(timestampProperty("timestamp"))
           .sample("timestamp", System.currentTimeMillis())


[streampipes-website] 01/03: docs: change heading

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a commit to branch update-adapter-docu
in repository https://gitbox.apache.org/repos/asf/streampipes-website.git

commit 2072fe6097e0a39468d560828ef851c65cac745f
Author: bossenti <bo...@posteo.de>
AuthorDate: Thu Oct 19 16:49:10 2023 +0200

    docs: change heading
---
 docs/06_extend-tutorial-adapters.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/06_extend-tutorial-adapters.md b/docs/06_extend-tutorial-adapters.md
index 350538c6..eac1bc1d 100644
--- a/docs/06_extend-tutorial-adapters.md
+++ b/docs/06_extend-tutorial-adapters.md
@@ -1,6 +1,6 @@
 ---
 id: extend-tutorial-adapters
-title: "Tutorial: Adapters"
+title: "Tutorial: Build Custom Adapters"
 sidebar_label: "Tutorial: Adapters"
 ---
 


[streampipes-website] 02/03: Merge remote-tracking branch 'origin/dev' into update-adapter-docu

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a commit to branch update-adapter-docu
in repository https://gitbox.apache.org/repos/asf/streampipes-website.git

commit aaa2fcbde7f797bdfb06cd4a61a4706a266968b8
Merge: 2072fe60 d79a09b5
Author: bossenti <bo...@posteo.de>
AuthorDate: Thu Oct 19 16:49:23 2023 +0200

    Merge remote-tracking branch 'origin/dev' into update-adapter-docu

 website-v2/package-lock.json | 167 ++++++++++++++++++++++++++++++-------------
 1 file changed, 116 insertions(+), 51 deletions(-)