Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 25cce5c

Browse files
committed
Pass version from pom.xml to index.html
1 parent ef9be52 commit 25cce5c

6 files changed

Lines changed: 37 additions & 6 deletions

File tree

pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@
1818
</properties>
1919

2020
<build>
21+
<resources>
22+
<resource>
23+
<directory>src/main/resources</directory>
24+
<filtering>true</filtering>
25+
<includes>
26+
<include>*.properties</include>
27+
</includes>
28+
</resource>
29+
<resource>
30+
<directory>src/main/resources</directory>
31+
<filtering>false</filtering>
32+
<excludes>
33+
<exclude>*.properties</exclude>
34+
</excludes>
35+
</resource>
36+
</resources>
2137
<plugins>
2238
<plugin>
2339
<artifactId>maven-clean-plugin</artifactId>

src/main/java/de/linkvt/ontobench/web/GeneratorController.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.semanticweb.owlapi.model.OWLOntology;
1919
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
2020
import org.springframework.beans.factory.annotation.Autowired;
21+
import org.springframework.beans.factory.annotation.Value;
2122
import org.springframework.context.ApplicationContext;
2223
import org.springframework.web.bind.annotation.PathVariable;
2324
import org.springframework.web.bind.annotation.RequestMapping;
@@ -39,6 +40,9 @@ public class GeneratorController {
3940
public static final String ONTOLOGY_PATH_WITHOUT_SLASH = "ontology";
4041
public static final String ONTOLOGY_PATH = ONTOLOGY_PATH_WITHOUT_SLASH + "/";
4142

43+
@Value("${ontobench.version}")
44+
private String version;
45+
4246
private ApplicationContext applicationContext;
4347
private FeatureParameterMapping featureMapping;
4448
private StoredGenerationRepository repository;
@@ -107,32 +111,37 @@ public OWLOntology ontologyFromIdWithFilename(HttpServletResponse response, @Pat
107111
}
108112

109113

110-
@RequestMapping("/features")
114+
@RequestMapping("features")
111115
public List<FeatureDto> features() {
112116
List<Feature> features = featureMapping.getAll();
113117

114118
return features.stream().map(FeatureDto::new).collect(Collectors.toList());
115119
}
116120

117-
@RequestMapping("/formats")
121+
@RequestMapping("formats")
118122
public List<FormatDto> formats() {
119123
List<OntologySyntax> syntaxes = Arrays.asList(OntologySyntax.values());
120124

121125
return syntaxes.stream().map(FormatDto::new).collect(Collectors.toList());
122126
}
123127

124-
@RequestMapping("/categories")
128+
@RequestMapping("categories")
125129
public List<FeatureCategoryDto> categories() {
126130
List<FeatureCategory> categories = Arrays.asList(FeatureCategory.values());
127131

128132
return categories.stream().map(FeatureCategoryDto::new).collect(Collectors.toList());
129133
}
130134

131-
@RequestMapping("/presets")
135+
@RequestMapping("presets")
132136
public List<PresetDto> presets() {
133137
Collection<Preset> presets = applicationContext.getBeansOfType(Preset.class).values();
134138

135139
return presets.stream().map(PresetDto::new).collect(Collectors.toList());
136140
}
137141

142+
@RequestMapping("version")
143+
public String version() {
144+
return version;
145+
}
146+
138147
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
spring.jpa.hibernate.ddl-auto=update
2+
ontobench.version=${project.version}

src/main/web/app/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Ui from "./Ui";
22
import FeatureContainer from "./FeatureContainer";
3-
import Generator from "./Generator";
3+
4+
$.ajax({url: "version", dataType: "text"}).done((version) => $("#version").text("v" + version));
45

56
Ui.initializeDefaults();
67

src/main/web/app/assets/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<body>
99
<div class="ui container">
1010
<h1 class="ui header page">
11-
OntoBench <span style="font-size: 45%">v0.99</span>
11+
OntoBench <span id="version"></span>
1212
<div class="sub header">Ontology Benchmark Generator</div>
1313
</h1>
1414

src/main/web/app/styles/style.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
.page.header {
44
padding-top: 1rem;
5+
6+
#version {
7+
font-size: 45%;
8+
}
59
}
610

711
#feature-container .ui.medium.header {

0 commit comments

Comments
 (0)