You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2022/07/28 14:21:57 UTC

[incubator-streampipes] branch STREAMPIPES-545 updated: [hotfix] Add method for default text parameters

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

zehnder pushed a commit to branch STREAMPIPES-545
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git


The following commit(s) were added to refs/heads/STREAMPIPES-545 by this push:
     new 5cee46da6 [hotfix] Add method for default text parameters
5cee46da6 is described below

commit 5cee46da6555f8f9bc35b318b9e0d0600c9f48fe
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Thu Jul 28 16:20:32 2022 +0200

    [hotfix] Add method for default text parameters
---
 .idea/runConfigurations/all_extensions_jvm.xml      |  9 +++++----
 .idea/runConfigurations/backend.xml                 | 16 ++++++++--------
 .../NumericalTextFilterProcessor.java               |  2 +-
 .../processor/textfilter/TextFilterProcessor.java   |  2 +-
 .../AbstractConfigurablePipelineElementBuilder.java | 21 +++++++++++++++++++--
 5 files changed, 34 insertions(+), 16 deletions(-)

diff --git a/.idea/runConfigurations/all_extensions_jvm.xml b/.idea/runConfigurations/all_extensions_jvm.xml
index 20063d047..80d3aa0f6 100644
--- a/.idea/runConfigurations/all_extensions_jvm.xml
+++ b/.idea/runConfigurations/all_extensions_jvm.xml
@@ -1,14 +1,15 @@
 <component name="ProjectRunConfigurationManager">
   <configuration default="false" name="all-extensions-jvm" type="Application" factoryName="Application">
     <envs>
-      <env name="SP_PORT" value="7023" />
-      <env name="SP_DEBUG" value="true" />
       <env name="SP_COUCHDB_HOST" value="localhost" />
-      <env name="SP_JMS_HOST" value="localhost" />
-      <env name="SP_JMS_PORT" value="61616" />
       <env name="SP_DATA_LAKE_HOST" value="localhost" />
       <env name="SP_DATA_LAKE_PORT" value="8086" />
+      <env name="SP_DEBUG" value="true" />
       <env name="SP_IMAGE_STORAGE_LOCATION" value=".streampipes/spImages/" />
+      <env name="SP_JMS_HOST" value="localhost" />
+      <env name="SP_JMS_PORT" value="61616" />
+      <env name="SP_PORT" value="7023" />
+      <env name="SP_HOST" value="141.21.12.92" />
     </envs>
     <option name="MAIN_CLASS_NAME" value="org.apache.streampipes.extensions.all.jvm.AllExtensionsInit" />
     <module name="streampipes-extensions-all-jvm" />
diff --git a/.idea/runConfigurations/backend.xml b/.idea/runConfigurations/backend.xml
index ff3c77297..15857e895 100644
--- a/.idea/runConfigurations/backend.xml
+++ b/.idea/runConfigurations/backend.xml
@@ -1,20 +1,20 @@
 <component name="ProjectRunConfigurationManager">
   <configuration default="false" name="backend" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
-    <module name="streampipes-backend" />
-    <option name="SPRING_BOOT_MAIN_CLASS" value="org.apache.streampipes.backend.StreamPipesBackendApplication" />
-    <option name="ALTERNATIVE_JRE_PATH" />
-    <option name="SHORTEN_COMMAND_LINE" value="NONE" />
+    <option name="ACTIVE_PROFILES" />
     <envs>
-      <env name="SP_COUCHDB_HOST" value="localhost" />
       <env name="SP_BACKEND_HOST" value="localhost" />
+      <env name="SP_COUCHDB_HOST" value="localhost" />
+      <env name="SP_DEBUG" value="true " />
       <env name="SP_INFLUX_HOST" value="localhost" />
-      <env name="SP_KAFKA_HOST" value="localhost" />
       <env name="SP_INFLUX_PORT" value="8086" />
-      <env name="SP_KAFKA_PORT" value="9094" />
       <env name="SP_JMS_HOST" value="localhost" />
-      <env name="SP_DEBUG" value="true " />
+      <env name="SP_KAFKA_HOST" value="localhost" />
+      <env name="SP_KAFKA_PORT" value="9094" />
       <env name="SP_PRIORITIZED_PROTOCOL" value="kafka" />
+      <env name="SP_HOST" value="141.21.12.92" />
     </envs>
+    <module name="streampipes-backend" />
+    <option name="SPRING_BOOT_MAIN_CLASS" value="org.apache.streampipes.backend.StreamPipesBackendApplication" />
     <method v="2">
       <option name="Make" enabled="true" />
     </method>
diff --git a/streampipes-extensions/streampipes-processors-filters-jvm/src/main/java/org/apache/streampipes/processors/filters/jvm/processor/numericaltextfilter/NumericalTextFilterProcessor.java b/streampipes-extensions/streampipes-processors-filters-jvm/src/main/java/org/apache/streampipes/processors/filters/jvm/processor/numericaltextfilter/NumericalTextFilterProcessor.java
index a41ef2df7..dad2e6a6b 100644
--- a/streampipes-extensions/streampipes-processors-filters-jvm/src/main/java/org/apache/streampipes/processors/filters/jvm/processor/numericaltextfilter/NumericalTextFilterProcessor.java
+++ b/streampipes-extensions/streampipes-processors-filters-jvm/src/main/java/org/apache/streampipes/processors/filters/jvm/processor/numericaltextfilter/NumericalTextFilterProcessor.java
@@ -71,7 +71,7 @@ public class NumericalTextFilterProcessor extends StreamPipesDataProcessor {
             .requiredFloatParameter(Labels.withId(NUMBER_VALUE), NUMBER_MAPPING)
             .requiredSingleValueSelection(Labels.withId(TEXT_OPERATION), Options.from("MATCHES",
                     "CONTAINS"))
-            .requiredTextParameter(Labels.withId(TEXT_KEYWORD), "text")
+            .requiredTextParameterWithLink(Labels.withId(TEXT_KEYWORD), "text")
             .outputStrategy(OutputStrategies.keep())
             .build();
 
diff --git a/streampipes-extensions/streampipes-processors-filters-jvm/src/main/java/org/apache/streampipes/processors/filters/jvm/processor/textfilter/TextFilterProcessor.java b/streampipes-extensions/streampipes-processors-filters-jvm/src/main/java/org/apache/streampipes/processors/filters/jvm/processor/textfilter/TextFilterProcessor.java
index 855fba98f..8e29c45e3 100644
--- a/streampipes-extensions/streampipes-processors-filters-jvm/src/main/java/org/apache/streampipes/processors/filters/jvm/processor/textfilter/TextFilterProcessor.java
+++ b/streampipes-extensions/streampipes-processors-filters-jvm/src/main/java/org/apache/streampipes/processors/filters/jvm/processor/textfilter/TextFilterProcessor.java
@@ -59,7 +59,7 @@ public class TextFilterProcessor extends StreamPipesDataProcessor {
                     .build())
             .requiredSingleValueSelection(Labels.withId(OPERATION_ID), Options.from("MATCHES",
                     "CONTAINS"))
-            .requiredTextParameter(Labels.withId(KEYWORD_ID), "text")
+            .requiredTextParameterWithLink(Labels.withId(KEYWORD_ID), "text")
             .outputStrategy(OutputStrategies.keep())
             .build();
   }
diff --git a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractConfigurablePipelineElementBuilder.java b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractConfigurablePipelineElementBuilder.java
index b3b4cfb77..5665fce75 100644
--- a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractConfigurablePipelineElementBuilder.java
+++ b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractConfigurablePipelineElementBuilder.java
@@ -260,7 +260,7 @@ public abstract class AbstractConfigurablePipelineElementBuilder<BU extends
   }
 
   /**
-   * @deprecated Use {@link #requiredTextParameter(Label, String)}
+   * @deprecated Use {@link #requiredTextParameterWithLink(Label, String)}
    * @param internalId
    * @param label
    * @param description
@@ -279,6 +279,23 @@ public abstract class AbstractConfigurablePipelineElementBuilder<BU extends
     return me();
   }
 
+  /**
+   * Defines a text-based configuration parameter provided by pipeline developers at pipeline authoring time. The
+   * value range of the parameter is restricted to the value specification of a selected input event property.
+   * @param label The {@link org.apache.streampipes.sdk.helpers.Label} that describes why this parameter is needed in a
+   *              user-friendly manner.
+   * @param defaultValue The default value is displayed to the user in the input field
+   * @return this
+   */
+  public BU requiredTextParameter(Label label,
+                                  String defaultValue) {
+    FreeTextStaticProperty fsp = StaticProperties.stringFreeTextProperty(label, defaultValue);
+
+    this.staticProperties.add(fsp);
+    return me();
+  }
+
+
   /**
    * Defines a text-based configuration parameter provided by pipeline developers at pipeline authoring time. The
    * value range of the parameter is restricted to the value specification of a selected input event property.
@@ -287,7 +304,7 @@ public abstract class AbstractConfigurablePipelineElementBuilder<BU extends
    * @param linkedMappingPropertyInternalName The inernalId of the {@link org.apache.streampipes.model.staticproperty.MappingProperty}
    * @return this
    */
-  public BU requiredTextParameter(Label label, String
+  public BU requiredTextParameterWithLink(Label label, String
           linkedMappingPropertyInternalName) {
     FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(label, XSD._string.toString());