Reeng in progress

This commit is contained in:
Claude Brisson
2023-10-23 14:53:01 +02:00
parent 58afd61f43
commit 905ccda7c9
26 changed files with 163 additions and 39 deletions

View File

@@ -101,15 +101,18 @@
<httpConnector>
<port>8080</port>
</httpConnector>
<!--
<systemProperties>
<pairgoth.api.url>http://localhost:8085/api/</pairgoth.api.url>
<pairgoth.env>dev</pairgoth.env>
<pairgoth.api.url>${webapp.url}</pairgoth.api.url>
<pairgoth.env>${webapp.env}</pairgoth.env>
</systemProperties>
-->
<webApp>
<resourceBases>${project.basedir}/src/main/webapp,${project.build.directory}/generated-resources/</resourceBases>
</webApp>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
@@ -125,6 +128,10 @@
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<dependencyManagement>

View File

@@ -132,7 +132,7 @@ class Translator private constructor(private val iso: String) {
get() = textAccessor[this] as String
set(value: String) { textAccessor[this] = value }
private val saveMissingTranslations = System.getProperty("pairgoth.env") == "dev"
private val saveMissingTranslations = System.getProperty("pairgoth.webapp.env") == "dev"
private val missingTranslations: MutableSet<String> = ConcurrentSkipListSet()
private fun reportMissingTranslation(enText: String) {

View File

@@ -53,7 +53,6 @@ class WebappManager : ServletContextListener, ServletContextAttributeListener, H
override fun contextInitialized(sce: ServletContextEvent) {
context = sce.servletContext
logger.info("---------- Starting $WEBAPP_NAME ----------")
context.setAttribute("manager", this)
webappRoot = context.getRealPath("/")
try {
// load default properties
@@ -64,7 +63,11 @@ class WebappManager : ServletContextListener, ServletContextAttributeListener, H
properties[(key as String).removePrefix(PAIRGOTH_PROPERTIES_PREFIX)] = value
}
logger.info("Using profile {}", properties.getProperty("webapp.env"))
val env = properties.getProperty("webapp.env")
logger.info("Using profile {}", )
// let the view be aware of the environment
context.setAttribute("webapp.env", env)
// set system user agent string to empty string
System.setProperty("http.agent", "")

View File

@@ -11,6 +11,7 @@
<script type="text/javascript" src="/js/domhelper.js"></script>
</head>
<body class="vert flex">
#foreach($attr in $application.getAttributeNames())$attr #end
<div id="header" class="horz flex">
<div id="logo">
<img src="/img/logov2.svg"/>

View File

@@ -1,5 +1,5 @@
# webapp
env = dev
webapp.env = dev
webapp.url = https://localhost:8080
api.url = https://localhost:8085/api