public FreeTextStaticProperty(FreeTextStaticProperty other) { super(other); this.requiredDomainProperty = other.getRequiredDomainProperty(); this.requiredDatatype = other.getRequiredDatatype(); if (other.getValueSpecification() != null) this.valueSpecification = new PropertyValueSpecification(other.getValueSpecification()); this.value = other.getValue(); this.htmlAllowed = other.isHtmlAllowed(); this.multiLine = other.isMultiLine(); this.placeholdersSupported = other.isPlaceholdersSupported(); this.mapsTo = other.getMapsTo(); }
private FreeTextStaticProperty prepareFreeTextStaticProperty(String internalId, String label, String description, String type) { return new FreeTextStaticProperty(internalId, label, description, URI.create(type)); }
/** * Defines a number-based configuration parameter of type integer provided by pipeline developers at pipeline * authoring time and initializes the parameter with a default value. * @param label The {@link org.streampipes.sdk.helpers.Label} that describes why this parameter is needed in a * user-friendly manner. * @param defaultValue The default integer value. * @return this */ public BU requiredIntegerParameter(Label label, Integer defaultValue) { FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(label, XSD._integer.toString()); fsp.setValue(String.valueOf(defaultValue)); this.staticProperties.add(fsp); return me(); }
public static FreeTextStaticProperty freeTextProperty(String internalName, String label, String description, URI datatype) { FreeTextStaticProperty fsp = new FreeTextStaticProperty(internalName, label, description); fsp.setRequiredDatatype(datatype); return fsp; }
/** * Defines a text-based configuration parameter provided by pipeline developers at pipeline authoring time. The * input field generated in the StreamPipes UI allows to enter HTML content (and an HTML Wysiwyg editor will be * rendered). * @param label The {@link org.streampipes.sdk.helpers.Label} that describes why this parameter is needed in a * user-friendly manner. * @return this */ public BU requiredHtmlInputParameter(Label label) { FreeTextStaticProperty fsp = new FreeTextStaticProperty(label.getInternalId(), label.getLabel(), label.getDescription()); fsp.setMultiLine(true); fsp.setHtmlAllowed(true); fsp.setPlaceholdersSupported(true); this.staticProperties.add(fsp); return me(); }
public String singleValue(String internalName) { return (((FreeTextStaticProperty) getStaticPropertyByName(internalName)) .getValue()); }
public String singleValue(String internalName) { return (((FreeTextStaticProperty) getStaticPropertyByName(internalName)) .getValue()); }
@Override public FormatDescription declareModel() { FormatDescription description = new FormatDescription(ID, "XML", "This is the description " + "for the XML format"); FreeTextStaticProperty tagProperty = new FreeTextStaticProperty("tag" , "Tag", "The Tag name of the events"); description.addConfig(tagProperty); return description; }
public RosBridgeAdapter(SpecificAdapterStreamDescription adapterDescription) { super(adapterDescription); List<StaticProperty> all = adapterDescription.getConfig(); for (StaticProperty sp : all) { if (sp.getInternalName().equals(ROS_HOST_KEY)) { this.host = ((FreeTextStaticProperty) sp).getValue(); } else { this.topic = ((FreeTextStaticProperty) sp).getValue(); } } this.jsonObjectParser = new JsonObjectParser(); }
/** * Defines a number-based configuration parameter of type float provided by pipeline developers at pipeline * authoring time and initializes the parameter with a default value. * @param label The {@link org.streampipes.sdk.helpers.Label} that describes why this parameter is needed in a * user-friendly manner. * @param defaultValue The default integer value. * @return this */ public BU requiredFloatParameter(Label label, Float defaultValue) { FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(label, XSD._double.toString()); fsp.setValue(String.valueOf(defaultValue)); this.staticProperties.add(fsp); return me(); }
@Override public FormatDescription declareModel() { FormatDescription fd = new FormatDescription(ID, "Json Array Key", "This is the description" + "for json format"); FreeTextStaticProperty keyProperty = new FreeTextStaticProperty("key", "key", "Key of the json part that should be parsed"); fd.addConfig(keyProperty); return fd; }
public <V> V singleValueParameter(String internalName, Class<V> targetClass) { return typeParser.parse(getStaticPropertyByName(internalName, FreeTextStaticProperty.class) .getValue(), targetClass); }
public BoundPipelineElementBuilder withPredefinedFreeTextValue(String internalStaticPropertyId, String value) { this.streamPipesEntity.getStaticProperties().stream().filter(sp -> sp instanceof FreeTextStaticProperty).forEach(sp -> { if (sp.getInternalName().equals(internalStaticPropertyId)) { sp.setPredefined(true); ((FreeTextStaticProperty) sp).setValue(value); } }); return this; }
@Override public FormatDescription declareModel() { FormatDescription description = new FormatDescription(ID, "XML", "This is the description " + "for the XML format"); FreeTextStaticProperty tagProperty = new FreeTextStaticProperty("tag" , "Tag", "The Tag name of the events"); description.addConfig(tagProperty); return description; }
/** * @deprecated Use {@link #requiredIntegerParameter(Label, Integer)} instead * @param internalId * @param label * @param description * @param defaultValue * @return */ public BU requiredIntegerParameter(String internalId, String label, String description, Integer defaultValue) { FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(internalId, label, description, XSD._integer.toString()); fsp.setValue(String.valueOf(defaultValue)); this.staticProperties.add(fsp); return me(); }
@Override public ProtocolDescription declareModel() { ProtocolDescription pd = new ProtocolDescription(ID,"File","This is the " + "description for the File Stream protocol"); FreeTextStaticProperty urlProperty = new FreeTextStaticProperty("filePath", "File Path", "This property defines the path to the file."); pd.setSourceType("STREAM"); FreeTextStaticProperty intervalProperty = new FreeTextStaticProperty("interval", "Interval", "This property " + "defines the pull interval in seconds."); pd.setIconUrl("file.png"); pd.addConfig(urlProperty); pd.addConfig(intervalProperty); return pd; }
private EventProperty modifyEventProperty(EventProperty eventProperty, StaticProperty staticProperty, TransformOperationType transformOperationType) { if (staticProperty instanceof SelectionStaticProperty) { return modifyEventProperty(eventProperty, transformOperationType, findSelected(((SelectionStaticProperty) staticProperty).getOptions()).getInternalName()); } else if (staticProperty instanceof FreeTextStaticProperty) { return modifyEventProperty(eventProperty, transformOperationType, ((FreeTextStaticProperty) staticProperty) .getValue ()); } return eventProperty; }
private DataProcessorInvocation updateStreamStoppedSepa(DataProcessorInvocation newSEPA, PipelineModificationMessage message) { List<StaticProperty> properties = message.getPipelineModifications().get(0).getStaticProperties(); List<StaticProperty> newStaticProperties = new ArrayList<>(); for (StaticProperty p : properties) { if (p instanceof FreeTextStaticProperty) { if (p.getInternalName().equals("topic")) ((FreeTextStaticProperty) p).setValue(String.valueOf(streamUri)); } newStaticProperties.add(p); } newSEPA.setStaticProperties(newStaticProperties); return newSEPA; }
@Override public ProtocolDescription declareModel() { ProtocolDescription pd = new ProtocolDescription(ID, "MQTT", "This is the " + "description for the MQTT protocol"); FreeTextStaticProperty broker = new FreeTextStaticProperty("broker_url", "Broker URL", "This property defines the URL of the MQTT broker."); pd.setSourceType("STREAM"); pd.setIconUrl("mqtt.png"); FreeTextStaticProperty topic = new FreeTextStaticProperty("topic", "Topic", "Topic in the broker"); pd.addConfig(broker); pd.addConfig(topic); return pd; }