Skip to content

Commit 5f72e38

Browse files
authored
[cometvisu] adding rest api for cometvisu manager (openhab#231)
Signed-off-by: Tobias Bräutigam <[email protected]>
1 parent 6d12fe9 commit 5f72e38

File tree

117 files changed

+4687
-18675
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+4687
-18675
lines changed

bundles/org.openhab.ui.cometvisu/.classpath

+14-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<attribute name="maven.pomderived" value="true"/>
1919
</attributes>
2020
</classpathentry>
21-
<classpathentry kind="src" path="src/gen/java"/>
2221
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
2322
<attributes>
2423
<attribute name="maven.pomderived" value="true"/>
@@ -29,5 +28,19 @@
2928
<attribute name="maven.pomderived" value="true"/>
3029
</attributes>
3130
</classpathentry>
31+
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
32+
<attributes>
33+
<attribute name="optional" value="true"/>
34+
<attribute name="maven.pomderived" value="true"/>
35+
<attribute name="ignore_optional_problems" value="true"/>
36+
<attribute name="m2e-apt" value="true"/>
37+
<attribute name="test" value="true"/>
38+
</attributes>
39+
</classpathentry>
40+
<classpathentry kind="src" path="src/gen/java">
41+
<attributes>
42+
<attribute name="optional" value="true"/>
43+
</attributes>
44+
</classpathentry>
3245
<classpathentry kind="output" path="target/classes"/>
3346
</classpath>

bundles/org.openhab.ui.cometvisu/README.md

+31-3
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,33 @@ The list of icons in the CometVisu is available at:
7575
http://<openhab-server>:8080/<webAlias>/icon/knx-uf-iconset/showicons.php
7676
```
7777

78+
You can also customize the mounted folders in the CometVisu manager. The CometVisu manager can only access
79+
files/folders in the resource/config folder. In order to make other files of the CometVisu available mount points
80+
are used and this feature is used in order to make the demo config folder accessible.
81+
You can add further mount points if you need to access other resources in the cometvisu. Please keep in mind that
82+
only subfolders of the CometVisu installation can be mounted, you cannot access paths outside this folder.
83+
84+
Default setting is:
85+
86+
```
87+
mount>demo=resource/demo
88+
```
89+
90+
This mounts the `resource/demo` subfolder as `demo`-folder in the manager. By default these mounted folders
91+
are not writeable, which means that you cannot create/edit files and folders in there. You can add some flags to
92+
the mount entry to customize some settings, the available flags are:
93+
94+
```
95+
w: mounted content is writeable
96+
s: show subfolders in the mounted folder
97+
```
98+
99+
A complete mount entry with these flags looks like this:
100+
101+
```
102+
mount>designs=resource/designs:ws
103+
```
104+
78105
### Override CometVisu files
79106

80107
You can create a folder called 'cometvisu' in openHAB's 'conf/' folder and create files there which should be used instead of CometVisu's own. For example, you can put all your customizations there (e.g. you config, custom.css, etc.).
@@ -251,10 +278,11 @@ If you get an 403 - Access Denied error, when you try to open the CometVisu in y
251278

252279
### Hints for development
253280

254-
For every change in the CometVisu XSD-schema the JAXB auto-generation job must be executed:
281+
Source file are automatically generated from CometVisu's visu_config.xsd and openapi.yaml files.
282+
For a manual update of these files copy them to the src/main/resources folder and run
283+
`mvn clean generated-sources`.
255284

256-
* Copy the new visu_config.xsd to src/main/resources/
257-
* and call `mvn jaxb2:xjc`
285+
If the library version changes the value must be updated in `org.openhab.ui.cometvisu.internal.backend.model.config.LibVersion`.
258286

259287
## TODO
260288

+141-93
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,148 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24

3-
<modelVersion>4.0.0</modelVersion>
5+
<modelVersion>4.0.0</modelVersion>
46

5-
<parent>
6-
<groupId>org.openhab.ui.bundles</groupId>
7-
<artifactId>org.openhab.ui.reactor.bundles</artifactId>
8-
<version>3.0.0-SNAPSHOT</version>
9-
</parent>
7+
<parent>
8+
<groupId>org.openhab.ui.bundles</groupId>
9+
<artifactId>org.openhab.ui.reactor.bundles</artifactId>
10+
<version>3.0.0-SNAPSHOT</version>
11+
</parent>
1012

11-
<artifactId>org.openhab.ui.cometvisu</artifactId>
13+
<artifactId>org.openhab.ui.cometvisu</artifactId>
1214

13-
<name>openHAB UI :: Bundles :: CometVisu :: Backend</name>
15+
<name>openHAB UI :: Bundles :: CometVisu :: Backend</name>
1416

15-
<dependencies>
16-
<dependency>
17-
<groupId>com.sun.xml.bind</groupId>
18-
<artifactId>jaxb-core</artifactId>
19-
<version>2.2.11</version>
20-
<scope>provided</scope>
21-
</dependency>
22-
<dependency>
23-
<groupId>com.sun.xml.bind</groupId>
24-
<artifactId>jaxb-impl</artifactId>
25-
<version>2.2.11</version>
26-
<scope>provided</scope>
27-
</dependency>
28-
<dependency>
29-
<groupId>javax.activation</groupId>
30-
<artifactId>activation</artifactId>
31-
<version>1.1.1</version>
32-
<scope>provided</scope>
33-
</dependency>
34-
<dependency>
35-
<groupId>javax.xml.bind</groupId>
36-
<artifactId>jaxb-api</artifactId>
37-
<version>2.2.12</version>
38-
<scope>provided</scope>
39-
</dependency>
40-
<dependency>
41-
<groupId>org.openhab.core.bundles</groupId>
42-
<artifactId>org.openhab.core.boot</artifactId>
43-
<version>${project.version}</version>
44-
</dependency>
45-
<dependency>
46-
<groupId>org.openhab.core.bundles</groupId>
47-
<artifactId>org.openhab.core</artifactId>
48-
<version>${project.version}</version>
49-
</dependency>
50-
<dependency>
51-
<groupId>org.openhab.core.bundles</groupId>
52-
<artifactId>org.openhab.core.model.sitemap</artifactId>
53-
<version>${project.version}</version>
54-
</dependency>
55-
<dependency>
56-
<groupId>org.openhab.core.bundles</groupId>
57-
<artifactId>org.openhab.core.ui</artifactId>
58-
<version>${project.version}</version>
59-
</dependency>
60-
<dependency>
61-
<groupId>org.openhab.core.bundles</groupId>
62-
<artifactId>org.openhab.core.ui.icon</artifactId>
63-
<version>${project.version}</version>
64-
</dependency>
65-
<dependency>
66-
<groupId>org.rrd4j</groupId>
67-
<artifactId>rrd4j</artifactId>
68-
<version>3.4</version>
69-
</dependency>
70-
</dependencies>
71-
72-
<build>
73-
<plugins>
74-
<plugin>
75-
<groupId>org.apache.maven.plugins</groupId>
76-
<artifactId>maven-compiler-plugin</artifactId>
77-
<configuration>
78-
<generatedSourcesDirectory>src/gen/java</generatedSourcesDirectory>
79-
</configuration>
80-
</plugin>
81-
<plugin>
82-
<groupId>org.codehaus.mojo</groupId>
83-
<artifactId>jaxb2-maven-plugin</artifactId>
84-
<version>2.2</version>
85-
<configuration>
86-
<!-- The package of your generated sources -->
87-
<packageName>org.openhab.ui.cometvisu.internal.config.beans</packageName>
88-
<sources>
89-
<source>src/main/resources/visu_config.xsd</source>
90-
</sources>
91-
<outputDirectory>src/gen/java</outputDirectory>
92-
<locale>en</locale>
93-
<clearOutputDir>false</clearOutputDir>
94-
<generateEpisode>false</generateEpisode>
95-
</configuration>
96-
</plugin>
97-
</plugins>
98-
</build>
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.apache.servicemix.bundles</groupId>
20+
<artifactId>org.apache.servicemix.bundles.jaxb-impl</artifactId>
21+
<version>2.2.11_1</version>
22+
<scope>provided</scope>
23+
</dependency>
24+
<dependency>
25+
<groupId>org.apache.servicemix.specs</groupId>
26+
<artifactId>org.apache.servicemix.specs.activation-api-1.1</artifactId>
27+
<version>2.9.0</version>
28+
<scope>provided</scope>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.apache.servicemix.specs</groupId>
32+
<artifactId>org.apache.servicemix.specs.jaxb-api-2.2</artifactId>
33+
<version>2.9.0</version>
34+
<scope>provided</scope>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.openhab.core.bundles</groupId>
38+
<artifactId>org.openhab.core.boot</artifactId>
39+
<version>${project.version}</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.openhab.core.bundles</groupId>
43+
<artifactId>org.openhab.core</artifactId>
44+
<version>${project.version}</version>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.openhab.core.bundles</groupId>
48+
<artifactId>org.openhab.core.model.sitemap</artifactId>
49+
<version>${project.version}</version>
50+
</dependency>
51+
<dependency>
52+
<groupId>org.openhab.core.bundles</groupId>
53+
<artifactId>org.openhab.core.ui</artifactId>
54+
<version>${project.version}</version>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.openhab.core.bundles</groupId>
58+
<artifactId>org.openhab.core.ui.icon</artifactId>
59+
<version>${project.version}</version>
60+
</dependency>
61+
<dependency>
62+
<groupId>org.rrd4j</groupId>
63+
<artifactId>rrd4j</artifactId>
64+
<version>3.4</version>
65+
</dependency>
66+
<dependency>
67+
<groupId>com.fasterxml.jackson.core</groupId>
68+
<artifactId>jackson-annotations</artifactId>
69+
<version>2.9.10</version>
70+
</dependency>
71+
<dependency>
72+
<groupId>org.glassfish.jersey.media</groupId>
73+
<artifactId>jersey-media-multipart</artifactId>
74+
<version>2.22.2</version>
75+
</dependency>
76+
</dependencies>
9977

78+
<build>
79+
<plugins>
80+
<plugin>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-compiler-plugin</artifactId>
83+
<configuration>
84+
<generatedSourcesDirectory>src/gen/java</generatedSourcesDirectory>
85+
</configuration>
86+
</plugin>
87+
<plugin>
88+
<groupId>org.codehaus.mojo</groupId>
89+
<artifactId>jaxb2-maven-plugin</artifactId>
90+
<version>2.5.0</version>
91+
<executions>
92+
<execution>
93+
<goals>
94+
<goal>xjc</goal>
95+
</goals>
96+
<configuration>
97+
<!-- The package of your generated sources -->
98+
<packageName>org.openhab.ui.cometvisu.internal.backend.model.config</packageName>
99+
<sources>
100+
<source>src/main/resources/visu_config.xsd</source>
101+
</sources>
102+
<outputDirectory>src-gen/</outputDirectory>
103+
<locale>en</locale>
104+
<clearOutputDir>false</clearOutputDir>
105+
<generateEpisode>false</generateEpisode>
106+
</configuration>
107+
</execution>
108+
</executions>
109+
</plugin>
110+
<plugin>
111+
<groupId>org.openapitools</groupId>
112+
<artifactId>openapi-generator-maven-plugin</artifactId>
113+
<!-- RELEASE_VERSION -->
114+
<version>4.3.0</version>
115+
<!-- /RELEASE_VERSION -->
116+
<executions>
117+
<execution>
118+
<goals>
119+
<goal>generate</goal>
120+
</goals>
121+
<configuration>
122+
<inputSpec>${project.basedir}/src/main/resources/openapi.yaml</inputSpec>
123+
<generatorName>jaxrs-spec</generatorName>
124+
<output>${project.basedir}</output>
125+
<addCompileSourceRoot>false</addCompileSourceRoot>
126+
<packageName>org.openhab.ui.cometvisu.backend.rest</packageName>
127+
<apiPackage>org.openhab.ui.cometvisu.backend.rest.api</apiPackage>
128+
<generateApis>false</generateApis>
129+
<modelPackage>org.openhab.ui.cometvisu.internal.backend.model.rest</modelPackage>
130+
<generateAliasAsModel>true</generateAliasAsModel>
131+
<generateSupportingFiles>false</generateSupportingFiles>
132+
<configOptions>
133+
<sourceFolder>src-gen</sourceFolder>
134+
<interfaceOnly>true</interfaceOnly>
135+
<java8>true</java8>
136+
<dateLibrary>java8</dateLibrary>
137+
<generatePom>false</generatePom>
138+
<useSwaggerAnnotations>false</useSwaggerAnnotations>
139+
<useBeanValidation>false</useBeanValidation>
140+
<hideGenerationTimestamp>true</hideGenerationTimestamp>
141+
</configOptions>
142+
</configuration>
143+
</execution>
144+
</executions>
145+
</plugin>
146+
</plugins>
147+
</build>
100148
</project>

0 commit comments

Comments
 (0)