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. Semantic tag class annotations are removed. Semantic tag classes are now created at runtime. Classes Locations, Equipments, Points and Properties are removed Static methods SemanticTags.add removed The adding of semantic tag classes is now managed only by the tag registry. Avoids calling static method SemanticTags.getById when possible SemanticsMetadataProvider service now requires semanticTagRegistry to start. Signed-off-by: Laurent Garnier <[email protected]>
- Loading branch information
Showing
159 changed files
with
1,736 additions
and
4,334 deletions.
There are no files selected for viewing
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
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.