You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by se...@apache.org on 2021/10/18 06:25:08 UTC

[openmeetings] 01/01: OPENMEETINGS-2692 Update manifest to get webapp name from base URL config.

This is an automated email from the ASF dual-hosted git repository.

sebawagner pushed a commit to branch feature/OPENMEETINGS-2692-update-webapp-path-for-manifest-references
in repository https://gitbox.apache.org/repos/asf/openmeetings.git

commit 92e19ec9d4705c0124a28ed5a3467e1e54d0ce2c
Author: Sebastian Wagner <se...@gmail.com>
AuthorDate: Mon Oct 18 19:24:51 2021 +1300

    OPENMEETINGS-2692 Update manifest to get webapp name from base URL config.
---
 .../org/apache/openmeetings/installation/ImportInitvalues.java |  2 +-
 .../org/apache/openmeetings/util/OpenmeetingsVariables.java    |  8 ++++++++
 .../org/apache/openmeetings/webservice/InfoWebService.java     | 10 ++++------
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java b/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
index 507b4c4..2a045ba 100644
--- a/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
+++ b/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
@@ -271,7 +271,7 @@ public class ImportInitvalues {
 						+ "It makes no sense to make this(%s) 'true' while "
 						+ "%s is 'false' cause you need to send a EMail.", CONFIG_EMAIL_VERIFICATION, CONFIG_EMAIL_AT_REGISTER), VER_2_0);
 
-		addCfg(list, CONFIG_APPLICATION_BASE_URL, cfg.getBaseUrl(), Configuration.Type.STRING, "Base URL your OPenmeetings installation will be accessible at.", "3.0.2");
+		addCfg(list, CONFIG_APPLICATION_BASE_URL, cfg.getBaseUrl(), Configuration.Type.STRING, "Base URL your Openmeetings installation will be accessible at.", "3.0.2");
 
 		// ***************************************
 		// ***************************************
diff --git a/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java b/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
index 20b7e48..cad96b9 100644
--- a/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
+++ b/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
@@ -248,6 +248,14 @@ public class OpenmeetingsVariables {
 		return baseUrl;
 	}
 
+	public static String getWebappPath() {
+		String webappPath = baseUrl;
+		if (webappPath.endsWith("/")) {
+			webappPath = webappPath.substring(0, webappPath.length() - 1);
+		}
+		return webappPath.substring(webappPath.lastIndexOf("/") + 1);
+	}
+
 	public static void setBaseUrl(String url) {
 		baseUrl = url;
 	}
diff --git a/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/InfoWebService.java b/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/InfoWebService.java
index a80fbdf..7967e1d 100644
--- a/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/InfoWebService.java
+++ b/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/InfoWebService.java
@@ -20,8 +20,6 @@ package org.apache.openmeetings.webservice;
 
 import static org.apache.openmeetings.webservice.Constants.TNS;
 
-import java.util.Locale;
-
 import javax.jws.WebMethod;
 import javax.jws.WebService;
 import javax.ws.rs.GET;
@@ -49,9 +47,9 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 
 /**
  *
- * The Service contains methods to get info about the system
+ * The Service contains methods to get info about the system and manifest
  *
- * @author solomax
+ * @author solomax, sebawagner
  *
  */
 @Service("infoWebService")
@@ -108,7 +106,7 @@ public class InfoWebService {
 		manifest.put("name", OpenmeetingsVariables.getApplicationName() + " " + Version.getVersion());
 		manifest.put("short_name", OpenmeetingsVariables.getApplicationName() + " " + Version.getVersion());
 		manifest.put("description", "Openmeetings provides video conferencing, instant messaging, white board, collaborative document editing and other groupware tools.");
-		manifest.put("start_url", "/" + OpenmeetingsVariables.getApplicationName().toLowerCase(Locale.getDefault()) + "/?pwa=true");
+		manifest.put("start_url", "/" + OpenmeetingsVariables.getWebappPath() + "/?pwa=true");
 		manifest.put("scope", "/");
 		manifest.put("background_color", "#ffffff");
 		manifest.put("theme_color", "#ffffff");
@@ -125,7 +123,7 @@ public class InfoWebService {
 
 	private JSONObject generateIcon(String name, String dimension, String purpose) {
 		JSONObject icon = new JSONObject();
-		icon.put("src", "/" + OpenmeetingsVariables.getApplicationName().toLowerCase(Locale.getDefault()) + "/images/icons/" + name);
+		icon.put("src", "/" + OpenmeetingsVariables.getWebappPath() + "/images/icons/" + name);
 		icon.put("type", "image/png");
 		icon.put("sizes", dimension);
 		icon.put("purpose", purpose);