2023-03-20 22:55:11 +01:00
|
|
|
package stirling.software.SPDF.config;
|
|
|
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
|
|
|
@Configuration
|
2023-04-22 13:51:01 +02:00
|
|
|
public class AppConfig {
|
2023-04-01 22:02:54 +02:00
|
|
|
@Bean(name = "appName")
|
|
|
|
public String appName() {
|
2023-04-02 12:51:07 +02:00
|
|
|
String appName = System.getProperty("APP_HOME_NAME");
|
2023-04-22 13:51:01 +02:00
|
|
|
if (appName == null)
|
2023-04-02 12:51:07 +02:00
|
|
|
appName = System.getenv("APP_HOME_NAME");
|
2023-04-01 22:02:54 +02:00
|
|
|
return (appName != null) ? appName : "Stirling PDF";
|
|
|
|
}
|
2023-04-22 13:51:01 +02:00
|
|
|
|
|
|
|
@Bean(name = "appVersion")
|
|
|
|
public String appVersion() {
|
|
|
|
String version = getClass().getPackage().getImplementationVersion();
|
|
|
|
return (version != null) ? version : "0.3.3";
|
2023-04-02 12:51:07 +02:00
|
|
|
}
|
2023-04-22 13:51:01 +02:00
|
|
|
|
2023-04-02 12:51:07 +02:00
|
|
|
@Bean(name = "homeText")
|
|
|
|
public String homeText() {
|
|
|
|
String homeText = System.getProperty("APP_HOME_DESCRIPTION");
|
2023-04-22 13:51:01 +02:00
|
|
|
if (homeText == null)
|
|
|
|
homeText = System.getenv("APP_HOME_DESCRIPTION");
|
2023-04-02 12:51:07 +02:00
|
|
|
return (homeText != null) ? homeText : "null";
|
|
|
|
}
|
2023-04-22 13:51:01 +02:00
|
|
|
|
|
|
|
@Bean(name = "navBarText")
|
|
|
|
public String navBarText() {
|
|
|
|
String navBarText = System.getProperty("APP_NAVBAR_NAME");
|
|
|
|
if (navBarText == null)
|
|
|
|
navBarText = System.getenv("APP_NAVBAR_NAME");
|
|
|
|
if (navBarText == null)
|
|
|
|
navBarText = System.getProperty("APP_HOME_NAME");
|
|
|
|
if (navBarText == null)
|
|
|
|
navBarText = System.getenv("APP_HOME_NAME");
|
|
|
|
|
|
|
|
return (navBarText != null) ? navBarText : "Stirling PDF";
|
|
|
|
}
|
2023-03-20 22:55:11 +01:00
|
|
|
}
|