Fixes#2510.
This changes the placeholder syntax used by the reference resolver notably
used in rule templates from `${reference}` to `{{reference}}`.
The former syntax is also used by other languages, notably JavaScript's
template strings, and therefore writing rule templates including JavaScript
code with template strings wouldn't behave as expected.
This also fixes a bug identified in #2510 where you couldn't have a
single closing brace before the start of the first placeholder - which
could more easily happen than having two closing braces.
Signed-off-by: Yannick Schaus <github@schaus.net>
* [marketplace] add a 3rd Party compatible marketplace
This adds a new marketplace addon provider which allows to add marketplaces maintained by 3rd party organizations (similar to alternative app stores on your smartphone). The configuration allows one or multiple marketplaces which provide their addons via JSON files (instead of a topic in the community forum).
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Related to https://github.com/openhab/openhab-webui/pull/1225.
This add-on handler supports installing block libraries in the
UIComponentRegistry, `ui:blocks` namespace.
It is very similar to the CommunityUIWidgetAddonHandler, as the format
is the same, so are the features and implementation, the only
differences being:
- Supported content type: `application/vnd.openhab.uicomponent;type=blocks`
(vs. `application/vnd.openhab.uicomponent;type=widget`)
- Discourse category nb.: 76 (vs. 75)
- Inferred Add-on type: "automation" (vs. "ui")
Signed-off-by: Yannick Schaus <github@schaus.net>
It causes unneccessary bundle refreshes whenever add-ons are installed/uninstalled.
As a result the UI does not get properly notified of installation changes.
Fixes#2580
Reverts the Aries JAX-RS Whiteboard upgrade of #2532
Signed-off-by: Wouter Born <github@maindrain.net>
When the plugin dependency is managed you can also use the plugin without adding GAV parameters to commands.
E.g. it allows for using it with:
```
mvn i18n:generate-default-translations
```
Related to #2544
Signed-off-by: Wouter Born <github@maindrain.net>
* Add i18n-maven-plugin to make internationalization easier
This plugin simplifies generating the default translation .properties files from the add-on XML information files.
It reuses the same XStream parsing classes that are used by openhab-core for parsing the binding/config/thing XML files.
It will also keep any existing default translations already present in property files for translations using `@text/`.
Furthermore it will nicely group and sort the translations.
After building this Maven plugin you can use it on add-ons using:
`mvn org.openhab.core.tools:i18n-maven-plugin:3.2.0-SNAPSHOT:generate-default-translations`
Signed-off-by: Wouter Born <github@maindrain.net>
The issue occurs when expired entries are removed from the cache.
Also adds some unit tests in which the same issue could be reproduced.
Fixes#2528
Signed-off-by: Wouter Born <github@maindrain.net>
* [marketplace] avoid collisions with multiple AddonProviders
The current implementation could result in collision of file-path and failed in determining the installation status if other AddonProviders re-use the marketplace addon handlers.
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
* New translations audio.properties (Hungarian)
* New translations DefaultSystemChannels.properties (German)
* New translations inbox.properties (Hungarian)
* New translations magic.properties (Hebrew)
* New translations magic.properties (Hungarian)
* New translations magic.properties (Italian)
* New translations marketplace.properties (Hungarian)
* New translations sitemap.properties (Hungarian)
* Fixed unit tests
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Looks like only the POM dependencies are used by the indexer, so the JAR is unused and useless as this warning correctly indicates when you build them:
```
[WARNING] JAR will be empty - no content was marked for inclusion!
```
Signed-off-by: Wouter Born <github@maindrain.net>
* Add ser2net mDNS USB serial discovery
* Add support for using multiple UsbSerialDiscovery services
* Add Ser2NetUsbSerialDiscovery that can use mDNS to discover ser2net RFC2217 serial ports
* Use discovered USB ports in SerialConfigOptionProvider
mDNS discovery is supported in ser2net 4.3.0 and newer.
E.g. you can install a ser2net version that provides this using APT in Ubuntu 21.04 and Debian 11.
Example ser2net YAML configuration that allows a serial port to be discovered using mDNS discovery:
%YAML 1.1
---
connection: &con01
accepter: telnet(rfc2217),tcp,2222
connector: serialdev,/dev/ttyUSB0
options:
mdns: true
mdns-sysattrs: true
mdns-name: devicename
Closes#1511
Signed-off-by: Wouter Born <github@maindrain.net>
* New exception class that incorporates support for internationalization
* Add ConnectionException, CommunicationException and ConfigurationException
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Ignores warnings like:
```
Warning: /home/runner/work/openhab-addons/openhab-addons/bom/runtime-index/pom.xml [0:0]: Unused Export-Package instructions: [org.openhab.*]
Warning: /home/runner/work/openhab-addons/openhab-addons/bom/runtime-index/pom.xml [0:0]: Unused Import-Package instructions: [io.swagger.v3.oas.annotations.*,
```
These are safe to ignore because the import/export packages are globally defined and not every bundle imports/exports all these packages.
The `skipIfEmpty` configuration furthermore prevents warnings when the bnd-maven-plugin runs on projects that don't have any code like BOMs.
More important compiler/SAT warnings standout more when there are there are fewer useless warnings.
Signed-off-by: Wouter Born <github@maindrain.net>
* Checkout merged branches for pull requests
* Echo the mvn command used for builds
* Use more functions in maven-build so it is similar to what will be used for add-on builds
Signed-off-by: Wouter Born <github@maindrain.net>
Update the WebClientFactoryImpl so it no longer uses a deprecated WebSocketClient constructor.
Use a workaround so WebClientFactoryImplTest.tearDown() cannot block forever when the commonWebSocketClient is stopped when it has not yet been fully started.
Signed-off-by: Wouter Born <github@maindrain.net>
There should only be one SLF4J binding used for logging and we already use slf4j-simple.
This fixes the following warning when running unit tests:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/wouter/.m2/repository/org/slf4j/slf4j-simple/1.7.32/slf4j-simple-1.7.32.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/wouter/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
Signed-off-by: Wouter Born <github@maindrain.net>
This helps to identify what tests cause builds to fail and it will more quickly end builds.
For instance the WebClientFactoryImplTest currently often hangs on my local builds.
With this configuration in place it is easy to see and it will timeout after 15 minutes:
[ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 4, Time elapsed: 900.207 s <<< FAILURE! - in org.openhab.core.io.net.http.internal.WebClientFactoryImplTest
[ERROR] org.openhab.core.io.net.http.internal.WebClientFactoryImplTest.testGetClients Time elapsed: 900.194 s <<< ERROR!
java.util.concurrent.TimeoutException: tearDown() timed out after 15 minutes
See: https://junit.org/junit5/docs/current/user-guide/#writing-tests-declarative-timeouts
Signed-off-by: Wouter Born <github@maindrain.net>
This PR adds a CI build using GitHub Actions.
Besides having a backup for Jenkins, it will also make it easy for contributors to use a GitHub Actions build with their fork.
It features the following:
* Uncluttered simple build progress like we used with Travis CI
* Uploads the full build log and SAT summary report so they can be downloaded for further analysis
* Uses a Maven repository cache to speed up builds (first build takes a bit longer)
* Has some maven.wagon configuration options to prevent Maven Central artifact download issues from Azure
* Uses a matrix so we can easily add builds for other OS-es or newer Java LTS versions in the future
Signed-off-by: Wouter Born <github@maindrain.net>