forked from openhab/openhab-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add semantic tag registry + REST API to manage user tags
Related to openhab#3619 New registry for semantic tags. New default semantic tags provider for all built-in semantic tags. New managed provider to add/remove/update user semantic tags. Storage of user semantic tags in a JSON DB file. New REST API to add/remove/update user tags in the semantic model. New REST API to get a sub-tree of the semantic tags. Tag label/description/synonyms are now in the registry, no more as part of the semantic class annotation. Signed-off-by: Laurent Garnier <[email protected]>
- Loading branch information
Showing
150 changed files
with
1,672 additions
and
418 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...core/src/main/java/org/openhab/core/io/rest/core/internal/tag/EnrichedSemanticTagDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright (c) 2010-2023 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.core.io.rest.core.internal.tag; | ||
|
||
import java.util.List; | ||
|
||
import org.openhab.core.semantics.SemanticTag; | ||
|
||
/** | ||
* A DTO representing a {@link SemanticTag}. | ||
* | ||
* @author Jimmy Tanagra - initial contribution | ||
* @author Laurent Garnier - Class renamed and members uid, description and editable added | ||
*/ | ||
public class EnrichedSemanticTagDTO { | ||
String uid; | ||
String name; | ||
String label; | ||
String description; | ||
List<String> synonyms; | ||
boolean editable; | ||
|
||
public EnrichedSemanticTagDTO(SemanticTag tag, boolean editable) { | ||
this.uid = tag.getUID(); | ||
this.name = tag.getUID().substring(tag.getUID().lastIndexOf("_") + 1); | ||
this.label = tag.getLabel(); | ||
this.description = tag.getDescription(); | ||
this.synonyms = tag.getSynonyms(); | ||
this.editable = editable; | ||
} | ||
} |
38 changes: 0 additions & 38 deletions
38
...ab.core.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/tag/TagDTO.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.