Refator page tite to app title

improvement/fix-task-deletion^2
Mohamed Rashd 2 years ago
parent 78546125bc
commit eb061f9450

@ -21,7 +21,6 @@ package org.wso2.carbon.device.mgt.jaxrs.service.impl.util;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.EnumUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpStatus;
@ -35,7 +34,6 @@ import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.exceptions.DeviceTypeNotFoundException;
import org.wso2.carbon.device.mgt.common.metadata.mgt.Metadata;
import org.wso2.carbon.device.mgt.common.metadata.mgt.WhiteLabelImage;
import org.wso2.carbon.device.mgt.common.metadata.mgt.WhiteLabelImageRequestPayload;
import org.wso2.carbon.device.mgt.common.notification.mgt.Notification;
import org.wso2.carbon.device.mgt.core.common.util.HttpUtil;
@ -689,7 +687,7 @@ public class RequestValidationUtil {
new ErrorResponse.ErrorResponseBuilder()
.setCode(HttpStatus.SC_BAD_REQUEST).setMessage(msg).build());
}
if (whiteLabelThemeCreateRequest.getPageTitle() == null) {
if (whiteLabelThemeCreateRequest.getAppTitle() == null) {
String msg = "Page title is required to whitelabel";
log.error(msg);
throw new InputValidationException(

@ -22,7 +22,7 @@ public class WhiteLabelTheme {
private WhiteLabelImage faviconImage;
private WhiteLabelImage logoImage;
private String footerText;
private String pageTitle;
private String appTitle;
public String getFooterText() {
return footerText;
@ -48,11 +48,11 @@ public class WhiteLabelTheme {
this.logoImage = logoImage;
}
public String getPageTitle() {
return pageTitle;
public String getAppTitle() {
return appTitle;
}
public void setPageTitle(String pageTitle) {
this.pageTitle = pageTitle;
public void setAppTitle(String appTitle) {
this.appTitle = appTitle;
}
}

@ -22,7 +22,7 @@ public class WhiteLabelThemeCreateRequest {
private WhiteLabelImageRequestPayload favicon;
private WhiteLabelImageRequestPayload logo;
private String footerText;
private String pageTitle;
private String appTitle;
public WhiteLabelImageRequestPayload getFavicon() {
return favicon;
@ -48,11 +48,11 @@ public class WhiteLabelThemeCreateRequest {
this.footerText = footerText;
}
public String getPageTitle() {
return pageTitle;
public String getAppTitle() {
return appTitle;
}
public void setPageTitle(String pageTitle) {
this.pageTitle = pageTitle;
public void setAppTitle(String appTitle) {
this.appTitle = appTitle;
}
}

@ -24,7 +24,7 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "WhiteLabelConfiguration")
public class WhiteLabelConfiguration {
private String footerText;
private String pageTitle;
private String appTitle;
private WhiteLabelImages whiteLabelImages;
@XmlElement(name = "FooterText", required = true)
@ -45,12 +45,12 @@ public class WhiteLabelConfiguration {
this.whiteLabelImages = whiteLabelImages;
}
@XmlElement(name = "PageTitle", required = true)
public String getPageTitle() {
return pageTitle;
@XmlElement(name = "AppTitle", required = true)
public String getAppTitle() {
return appTitle;
}
public void setPageTitle(String pageTitle) {
this.pageTitle = pageTitle;
public void setAppTitle(String appTitle) {
this.appTitle = appTitle;
}
}

@ -38,7 +38,6 @@ import org.wso2.carbon.device.mgt.common.metadata.mgt.WhiteLabelImageRequestPayl
import org.wso2.carbon.device.mgt.common.metadata.mgt.WhiteLabelManagementService;
import org.wso2.carbon.device.mgt.common.metadata.mgt.WhiteLabelTheme;
import org.wso2.carbon.device.mgt.common.metadata.mgt.WhiteLabelThemeCreateRequest;
import org.wso2.carbon.device.mgt.core.common.util.FileUtil;
import org.wso2.carbon.device.mgt.core.common.util.HttpUtil;
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
import org.wso2.carbon.device.mgt.core.config.metadata.mgt.MetaDataConfiguration;
@ -165,12 +164,12 @@ public class WhiteLabelManagementServiceImpl implements WhiteLabelManagementServ
*/
private WhiteLabelTheme getDefaultWhiteLabelTheme() {
String footerText = getDefaultFooterText();
String pageTitle = getDefaultPageTitle();
String appTitle = getDefaultAppTitle();
WhiteLabelImage favicon = constructDefaultFaviconImage();
WhiteLabelImage logo = constructDefaultLogoImage();
WhiteLabelTheme defaultTheme = new WhiteLabelTheme();
defaultTheme.setFooterText(footerText);
defaultTheme.setPageTitle(pageTitle);
defaultTheme.setAppTitle(appTitle);
defaultTheme.setLogoImage(logo);
defaultTheme.setFaviconImage(favicon);
return defaultTheme;
@ -179,11 +178,11 @@ public class WhiteLabelManagementServiceImpl implements WhiteLabelManagementServ
/**
* Get default whitelabel label page title from config
*/
private String getDefaultPageTitle() {
private String getDefaultAppTitle() {
MetaDataConfiguration metaDataConfiguration = DeviceConfigurationManager.getInstance().
getDeviceManagementConfig().getMetaDataConfiguration();
WhiteLabelConfiguration whiteLabelConfiguration = metaDataConfiguration.getWhiteLabelConfiguration();
return whiteLabelConfiguration.getPageTitle();
return whiteLabelConfiguration.getAppTitle();
}
/**
@ -331,7 +330,7 @@ public class WhiteLabelManagementServiceImpl implements WhiteLabelManagementServ
whiteLabelTheme.setFaviconImage(faviconImage);
whiteLabelTheme.setLogoImage(logoImage);
whiteLabelTheme.setFooterText(whiteLabelThemeCreateRequest.getFooterText());
whiteLabelTheme.setPageTitle(whiteLabelThemeCreateRequest.getPageTitle());
whiteLabelTheme.setAppTitle(whiteLabelThemeCreateRequest.getAppTitle());
return whiteLabelTheme;
}

@ -187,7 +187,7 @@
IoT Server 5.0.0 | © 2022
, All Rights Reserved.
</FooterText>
<PageTitle>Entgra Endpoint Management</PageTitle>
<AppTitle>Entgra</AppTitle>
<WhiteLabelImages>
<StoragePath>repository/resources/whitelabel</StoragePath>
<DefaultFaviconName>favicon.png</DefaultFaviconName>

@ -320,7 +320,7 @@
IoT Server 5.0.0 | &#169; 2022
, All Rights Reserved.
</FooterText>
<PageTitle>Entgra Endpoint Management</PageTitle>
<AppTitle>Entgra</AppTitle>
<WhiteLabelImages>
<StoragePath>repository/resources/whitelabel</StoragePath>
<DefaultFaviconName>favicon.png</DefaultFaviconName>

Loading…
Cancel
Save