From ca7c63c7d7d2f235eb85b184ffc85dab5f1fe817 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Sun, 27 Aug 2023 00:38:17 +0100 Subject: [PATCH] name changes --- .../software/SPDF/config/AppConfig.java | 8 +- .../SPDF/model/ApplicationProperties.java | 78 +++++++++---------- src/main/resources/application.properties | 6 +- src/main/resources/settings.yml.template | 21 +++-- .../templates/fragments/errorBanner.html | 4 +- 5 files changed, 58 insertions(+), 59 deletions(-) diff --git a/src/main/java/stirling/software/SPDF/config/AppConfig.java b/src/main/java/stirling/software/SPDF/config/AppConfig.java index 9645c820..d75ef8e1 100644 --- a/src/main/java/stirling/software/SPDF/config/AppConfig.java +++ b/src/main/java/stirling/software/SPDF/config/AppConfig.java @@ -1,14 +1,12 @@ package stirling.software.SPDF.config; -import java.util.Arrays; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; -import stirling.software.SPDF.utils.PropertyConfigs; + import stirling.software.SPDF.model.ApplicationProperties; @Configuration public class AppConfig { @@ -24,7 +22,7 @@ public class AppConfig { @Bean(name = "appName") public String appName() { - String homeTitle = applicationProperties.getUi().getHomeName(); + String homeTitle = applicationProperties.getUi().getAppName(); return (homeTitle != null) ? homeTitle : "Stirling PDF"; } @@ -42,7 +40,7 @@ public class AppConfig { @Bean(name = "navBarText") public String navBarText() { - String defaultNavBar = applicationProperties.getUi().getNavbarName() != null ? applicationProperties.getUi().getNavbarName() : applicationProperties.getUi().getHomeName(); + String defaultNavBar = applicationProperties.getUi().getAppNameNavbar() != null ? applicationProperties.getUi().getAppNameNavbar() : applicationProperties.getUi().getAppName(); return (defaultNavBar != null) ? defaultNavBar : "Stirling PDF"; } diff --git a/src/main/java/stirling/software/SPDF/model/ApplicationProperties.java b/src/main/java/stirling/software/SPDF/model/ApplicationProperties.java index e49fbee1..b5e78a6b 100644 --- a/src/main/java/stirling/software/SPDF/model/ApplicationProperties.java +++ b/src/main/java/stirling/software/SPDF/model/ApplicationProperties.java @@ -174,8 +174,8 @@ public class ApplicationProperties { public static class System { private String defaultLocale; private Boolean googlevisibility; - private String rootPath; - private String customstaticFilePath; + private String rootURIPath; + private String customStaticFilePath; private Integer maxFileSize; public String getDefaultLocale() { @@ -194,20 +194,20 @@ public class ApplicationProperties { this.googlevisibility = googlevisibility; } - public String getRootPath() { - return rootPath; + public String getRootURIPath() { + return rootURIPath; } - public void setRootPath(String rootPath) { - this.rootPath = rootPath; + public void setRootURIPath(String rootURIPath) { + this.rootURIPath = rootURIPath; } - public String getCustomstaticFilePath() { - return customstaticFilePath; + public String getCustomStaticFilePath() { + return customStaticFilePath; } - public void setCustomstaticFilePath(String customstaticFilePath) { - this.customstaticFilePath = customstaticFilePath; + public void setCustomStaticFilePath(String customStaticFilePath) { + this.customStaticFilePath = customStaticFilePath; } public Integer getMaxFileSize() { @@ -220,8 +220,8 @@ public class ApplicationProperties { @Override public String toString() { - return "System [defaultLocale=" + defaultLocale + ", googlevisibility=" + googlevisibility + ", rootPath=" - + rootPath + ", customstaticFilePath=" + customstaticFilePath + ", maxFileSize=" + maxFileSize + return "System [defaultLocale=" + defaultLocale + ", googlevisibility=" + googlevisibility + ", rootURIPath=" + + rootURIPath + ", customStaticFilePath=" + customStaticFilePath + ", maxFileSize=" + maxFileSize + "]"; } @@ -229,43 +229,41 @@ public class ApplicationProperties { } public static class Ui { - private String homeName; - private String homeDescription; - private String navbarName; + private String appName; + private String homeDescription; + private String appNameNavbar; - public String getHomeName() { - return homeName; - } + public String getAppName() { + return appName; + } - public void setHomeName(String homeName) { - this.homeName = homeName; - } + public void setAppName(String appName) { + this.appName = appName; + } - public String getHomeDescription() { - return homeDescription; - } + public String getHomeDescription() { + return homeDescription; + } - public void setHomeDescription(String homeDescription) { - this.homeDescription = homeDescription; - } + public void setHomeDescription(String homeDescription) { + this.homeDescription = homeDescription; + } - public String getNavbarName() { - return navbarName; - } + public String getAppNameNavbar() { + return appNameNavbar; + } - public void setNavbarName(String navbarName) { - this.navbarName = navbarName; - } + public void setAppNameNavbar(String appNameNavbar) { + this.appNameNavbar = appNameNavbar; + } - @Override - public String toString() { - return "Ui [homeName=" + homeName + ", homeDescription=" + homeDescription + ", navbarName=" + navbarName - + "]"; - } - - + @Override + public String toString() { + return "UserInterface [appName=" + appName + ", homeDescription=" + homeDescription + ", appNameNavbar=" + appNameNavbar + "]"; + } } + public static class Endpoints { private List toRemove; private List groupsToRemove; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index da508e20..ebf97ec2 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -22,15 +22,15 @@ server.error.include-message=always server.servlet.session.tracking-modes=cookie -server.servlet.context-path=${APP_ROOT_PATH:/} +server.servlet.context-path=${SYSTEM_ROOTURIPATH:/} spring.devtools.restart.enabled=true spring.devtools.livereload.enabled=true spring.thymeleaf.encoding=UTF-8 -server.connection-timeout=${CONNECTION_TIMEOUT:5m} -spring.mvc.async.request-timeout=${ASYNC_CONNECTION_TIMEOUT:300000} +server.connection-timeout=${SYSTEM_CONNECTIONTIMEOUTMINUTES:5m} +spring.mvc.async.request-timeout=${SYSTEM_CONNECTIONTIMEOUTMILLISECONDS:300000} spring.resources.static-locations=file:customFiles/static/ #spring.thymeleaf.prefix=file:/customFiles/templates/,classpath:/templates/ diff --git a/src/main/resources/settings.yml.template b/src/main/resources/settings.yml.template index da5dd8d1..4cac795b 100644 --- a/src/main/resources/settings.yml.template +++ b/src/main/resources/settings.yml.template @@ -1,3 +1,7 @@ +# Welcome to settings file +# Remove comment marker # if on start of line to enable the configuration +# If you want to override with environment parameter follow parameter naming SECURITY_INITIALLOGIN_USERNAME + security: enableLogin: false # set to 'true' to enable login initialLogin: @@ -8,14 +12,16 @@ security: system: defaultLocale: 'en-US' # Set the default language (e.g. 'de-DE', 'fr-FR', etc) googlevisibility: false # 'true' to allow Google visibility, 'false' to disallow - rootPath: / # Set the application's root URI (e.g. /pdf-app) - customstaticFilePath: '/customFiles/static/' # Directory path for custom static files + rootURIPath: / # Set the application's root URI (e.g. /pdf-app) + customStaticFilePath: '/customFiles/static/' # Directory path for custom static files maxFileSize: 2000 # Set the maximum file size in MB - -ui: - homeName: # Application's visible name - homeDescription: # Short description or tagline. - navbarName: # Name displayed on the navigation bar + connectionTimeoutMinutes: 5m + connectionTimeoutMilliSeconds: 300000 + +#ui: +# appName: exampleAppName # Application's visible name +# homeDescription: I am a description # Short description or tagline shown on homepage. +# appNameNavbar: navbarName # Name displayed on the navigation bar endpoints: toRemove: [] # List endpoints to disable (e.g. ['img-to-pdf', 'remove-pages']) @@ -23,4 +29,3 @@ endpoints: metrics: enabled: true # 'true' to enable metric API endpoints, 'false' to disable - diff --git a/src/main/resources/templates/fragments/errorBanner.html b/src/main/resources/templates/fragments/errorBanner.html index 1d2153ab..cdba311a 100644 --- a/src/main/resources/templates/fragments/errorBanner.html +++ b/src/main/resources/templates/fragments/errorBanner.html @@ -24,9 +24,7 @@

- +