Upgrade Karaf from 4.4.9 to 4.4.10.
This includes upgrades for the following libraries:
* pax-logging from 2.3.1 to 2.3.2
* xbean from 4.28 to 4.29
Reverts downgrade of karaf-maven-plugin to 4.4.8.
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* Add support for short-form YAML semantic tags
Implemented hybrid mapping for YamlSemanticTagDTO to allow tags to be defined as either a simple string (label) or a detailed object (label, description, synonyms). Includes Jackson creator/value logic for round-trip serialization.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Co-authored-by: Laurent Garnier <lg.hc@free.fr>
The enhancement consists in just getting the UID of the elements to be removed rather than building a full object.
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* Add utility method to cast profile configurations to specific classes
* Replace ProfileContext implementation in ScriptProfileTest by a mock
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Move YAML test files in sub-folders
Tests for YamlThingProvider moved in a separate class.
Also test that a thing change listener is properly called when loading a YAML file containing things.
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* change groovycsv to jackson csv library
groovycsv caused an error in Groovy 5.x, even in its "latest" version 1.3.
Rerun the script which fixed a few errors in the manually generated tags (Property_Price, Equipment_HVAC_AirConditioner)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
* Add Property_StateOfCharge semantic tag
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
* add readValues guard
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
---------
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
The ThingUID portion of a ChannelUID was previously only validated
lazily when getThingUID() was called. This could lead to
ChannelUID objects existing in an invalid state.
This change moves validation to the constructor to ensure
fail-fast behavior and provides a more descriptive error
message if the ThingUID part is malformed.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
* [REST] API /file-format/parse: do not extend thing/channel config
The /file-format/parse API does no more extend the thing and channel configuration with parameters having a default value. The output will contain hte thing/channel configuration parameters provided in the input.
It is fixed for YAML and DSL formats.
Unit tests added for YAML models containing Thing
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* Support deserializing short-form metadata in YamlMetadataDTO
So we can set
`metadata: value`
instead of
```
metadata:
value: value
```
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Catch IAE during Thing configuration loading to prevent
the entire file from failing. Errors are now logged as warnings
instead of throwing a full stack trace.
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
- 'config' in RootUIComponent/UIComponent was of the wrong type in openapi spec
- getType accessor in UIComponent generated a property
- Updated the naming of data structures in openapi spec w/o the internal DTO nomenclature for consistency and simplicity
Also-by: Florian Hotze <dev@florianhotze.com>
Also-by: Wouter Born <github@maindrain.net>
Signed-off-by: Jeff James <jeff@james-online.com>
When a client disconnected while receiving the icon byte stream response,
an error and a warning were logged, making users worried:
```
2022-08-15 20:09:31.387 [ERROR] [ab.core.ui.icon.internal.IconServlet] - Failed sending the icon byte stream as a response: null
2022-08-15 20:09:31.390 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /icon/autarky
java.lang.IllegalStateException: ABORTED
at org.eclipse.jetty.server.HttpChannelState.sendError(HttpChannelState.java:915) ~[?:?]
...
```
IMO, there is no need to log at ERROR or WARN level in such cases,
so I decided to reduce to DEBUG logging.
The following script can be used to reproduce the above case:
```python
import socket
import struct
host = 'localhost'
port = 8080
path = '/icon/BatteryLevel?format=svg&anyFormat=true&state=94+%25&iconset=classic'
request = f"GET {path} HTTP/1.1\r\nHost: {host}\r\nConnection: keep-alive\r\n\r\n"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
# Send the request
s.sendall(request.encode())
# FORCE an immediate hard reset (RST)
# This ensures the server sees a connection failure while it's inside doGet
s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack('ii', 1, 0))
s.close()
```
Signed-off-by: Florian Hotze <dev@florianhotze.com>
* SimpleRule: Improve code wrt null handling & annotations
* SimpleRule: Fix adding type and source config throws validation error in RuleRegistryImpl
Define those two as "default" config description as the UI uses those fields to display the source.
Fixes#5268.
Signed-off-by: Florian Hotze <dev@florianhotze.com>
* [YAML provider] Add INFO log for config TEXT param value not parsed as string
Related to openhab/openhab-webui#3696
Follow-up #5248
A log at level INFO is now displayed when a YAML file is loaded and contains a thing or channel configuration parameter of type TEXT whose value is not parsed as a string. This occurs when an unquoted number is provided. The log recommends enclosing the value in double quotes to prevent conversion.
For better consistency, the YAML provider is now also processing any BigDecimal value to convert it into a String type when the config paramater is of type TEXT.
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* Upgrade pdfbox from to 3.0.1
Upgrade Apache pdfbox from 2.0.27 to 3.0.1.
* Exclude junit due to launcher incompatibility
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Fixes#4395.
The issue was noticed for Rules DSL, but not for JS Scripting, because JS Scripting is loaded at a point where the rule engine is already started.
Signed-off-by: Florian Hotze <dev@florianhotze.com>
This PR normalizes thing/channel configuration before producing the response.
It allows having proper types for config parameters in the JSON response of the API.
Signed-off-by: Laurent Garnier <lg.hc@free.fr>