|
|
@ -26,9 +26,11 @@ import org.apache.http.HttpResponse;
|
|
|
|
import org.apache.http.client.methods.HttpGet;
|
|
|
|
import org.apache.http.client.methods.HttpGet;
|
|
|
|
import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
|
import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
|
import org.apache.http.impl.client.HttpClients;
|
|
|
|
import org.apache.http.impl.client.HttpClients;
|
|
|
|
|
|
|
|
import org.wso2.carbon.context.CarbonContext;
|
|
|
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
|
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
|
|
import org.wso2.carbon.device.mgt.common.Base64File;
|
|
|
|
import org.wso2.carbon.device.mgt.common.Base64File;
|
|
|
|
import org.wso2.carbon.device.mgt.common.FileResponse;
|
|
|
|
import org.wso2.carbon.device.mgt.common.FileResponse;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.exceptions.MetadataManagementException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.exceptions.MetadataManagementException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.exceptions.NotFoundException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.exceptions.NotFoundException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.exceptions.TransactionManagementException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.exceptions.TransactionManagementException;
|
|
|
@ -48,6 +50,8 @@ import org.wso2.carbon.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOExc
|
|
|
|
import org.wso2.carbon.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOFactory;
|
|
|
|
import org.wso2.carbon.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOFactory;
|
|
|
|
import org.wso2.carbon.device.mgt.core.metadata.mgt.dao.util.MetadataConstants;
|
|
|
|
import org.wso2.carbon.device.mgt.core.metadata.mgt.dao.util.MetadataConstants;
|
|
|
|
import org.wso2.carbon.device.mgt.core.metadata.mgt.util.WhiteLabelStorageUtil;
|
|
|
|
import org.wso2.carbon.device.mgt.core.metadata.mgt.util.WhiteLabelStorageUtil;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.io.InputStream;
|
|
|
@ -67,38 +71,62 @@ public class WhiteLabelManagementServiceImpl implements WhiteLabelManagementServ
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public FileResponse getWhiteLabelFavicon() throws MetadataManagementException, NotFoundException {
|
|
|
|
public FileResponse getWhiteLabelFavicon(String tenantDomain) throws MetadataManagementException, NotFoundException {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
WhiteLabelTheme whiteLabelTheme = getWhiteLabelTheme();
|
|
|
|
WhiteLabelTheme whiteLabelTheme = getWhiteLabelTheme(tenantDomain);
|
|
|
|
return getImageFileResponse(whiteLabelTheme.getFaviconImage(), WhiteLabelImage.ImageName.FAVICON);
|
|
|
|
return getImageFileResponse(whiteLabelTheme.getFaviconImage(), WhiteLabelImage.ImageName.FAVICON, tenantDomain);
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
String msg = "Error occurred while getting byte content of favicon";
|
|
|
|
String msg = "Error occurred while getting byte content of favicon";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MetadataManagementException(msg, e);
|
|
|
|
throw new MetadataManagementException(msg, e);
|
|
|
|
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
|
|
|
|
String msg = "Error occurred while getting tenant details of favicon";
|
|
|
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
throw new MetadataManagementException(msg, e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public FileResponse getWhiteLabelLogo(String tenantDomain) throws MetadataManagementException, NotFoundException {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
WhiteLabelTheme whiteLabelTheme = getWhiteLabelTheme(tenantDomain);
|
|
|
|
|
|
|
|
return getImageFileResponse(whiteLabelTheme.getLogoImage(), WhiteLabelImage.ImageName.LOGO, tenantDomain);
|
|
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
|
|
|
String msg = "Error occurred while getting byte content of logo";
|
|
|
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
throw new MetadataManagementException(msg, e);
|
|
|
|
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
|
|
|
|
String msg = "Error occurred while getting tenant details of logo";
|
|
|
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
throw new MetadataManagementException(msg, e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public FileResponse getWhiteLabelLogo() throws MetadataManagementException, NotFoundException {
|
|
|
|
public FileResponse getWhiteLabelLogoIcon(String tenantDomain) throws MetadataManagementException, NotFoundException {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
WhiteLabelTheme whiteLabelTheme = getWhiteLabelTheme();
|
|
|
|
WhiteLabelTheme whiteLabelTheme = getWhiteLabelTheme(tenantDomain);
|
|
|
|
return getImageFileResponse(whiteLabelTheme.getLogoImage(), WhiteLabelImage.ImageName.LOGO);
|
|
|
|
return getImageFileResponse(whiteLabelTheme.getLogoIconImage(), WhiteLabelImage.ImageName.LOGO_ICON, tenantDomain);
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
String msg = "Error occurred while getting byte content of logo";
|
|
|
|
String msg = "Error occurred while getting byte content of logo";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MetadataManagementException(msg, e);
|
|
|
|
throw new MetadataManagementException(msg, e);
|
|
|
|
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
|
|
|
|
String msg = "Error occurred while getting tenant details of icon";
|
|
|
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
throw new MetadataManagementException(msg, e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Useful to get white label image file response for provided {@link WhiteLabelImage.ImageName}
|
|
|
|
* Useful to get white label image file response for provided {@link WhiteLabelImage.ImageName}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private FileResponse getImageFileResponse(WhiteLabelImage image, WhiteLabelImage.ImageName imageName) throws
|
|
|
|
private FileResponse getImageFileResponse(WhiteLabelImage image, WhiteLabelImage.ImageName imageName, String tenantDomain) throws
|
|
|
|
IOException, MetadataManagementException, NotFoundException {
|
|
|
|
IOException, MetadataManagementException, NotFoundException, DeviceManagementException {
|
|
|
|
if (image.getImageLocationType() == WhiteLabelImage.ImageLocationType.URL) {
|
|
|
|
if (image.getImageLocationType() == WhiteLabelImage.ImageLocationType.URL) {
|
|
|
|
return getImageFileResponseFromUrl(image.getImageLocation());
|
|
|
|
return getImageFileResponseFromUrl(image.getImageLocation());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return WhiteLabelStorageUtil.getWhiteLabelImageStream(image, imageName);
|
|
|
|
return WhiteLabelStorageUtil.getWhiteLabelImageStream(image, imageName, tenantDomain);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -169,10 +197,12 @@ public class WhiteLabelManagementServiceImpl implements WhiteLabelManagementServ
|
|
|
|
String appTitle = getDefaultAppTitle();
|
|
|
|
String appTitle = getDefaultAppTitle();
|
|
|
|
WhiteLabelImage favicon = constructDefaultFaviconImage();
|
|
|
|
WhiteLabelImage favicon = constructDefaultFaviconImage();
|
|
|
|
WhiteLabelImage logo = constructDefaultLogoImage();
|
|
|
|
WhiteLabelImage logo = constructDefaultLogoImage();
|
|
|
|
|
|
|
|
WhiteLabelImage logoIcon = constructDefaultLogoIconImage();
|
|
|
|
WhiteLabelTheme defaultTheme = new WhiteLabelTheme();
|
|
|
|
WhiteLabelTheme defaultTheme = new WhiteLabelTheme();
|
|
|
|
defaultTheme.setFooterText(footerText);
|
|
|
|
defaultTheme.setFooterText(footerText);
|
|
|
|
defaultTheme.setAppTitle(appTitle);
|
|
|
|
defaultTheme.setAppTitle(appTitle);
|
|
|
|
defaultTheme.setLogoImage(logo);
|
|
|
|
defaultTheme.setLogoImage(logo);
|
|
|
|
|
|
|
|
defaultTheme.setLogoIconImage(logoIcon);
|
|
|
|
defaultTheme.setFaviconImage(favicon);
|
|
|
|
defaultTheme.setFaviconImage(favicon);
|
|
|
|
return defaultTheme;
|
|
|
|
return defaultTheme;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -227,6 +257,21 @@ public class WhiteLabelManagementServiceImpl implements WhiteLabelManagementServ
|
|
|
|
return logo;
|
|
|
|
return logo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* This is useful to construct and get the default logo whitelabel image
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return {@link WhiteLabelImage}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private WhiteLabelImage constructDefaultLogoIconImage() {
|
|
|
|
|
|
|
|
MetaDataConfiguration metaDataConfiguration = DeviceConfigurationManager.getInstance().
|
|
|
|
|
|
|
|
getDeviceManagementConfig().getMetaDataConfiguration();
|
|
|
|
|
|
|
|
WhiteLabelConfiguration whiteLabelConfiguration = metaDataConfiguration.getWhiteLabelConfiguration();
|
|
|
|
|
|
|
|
WhiteLabelImage logoIcon = new WhiteLabelImage();
|
|
|
|
|
|
|
|
logoIcon.setImageLocation(whiteLabelConfiguration.getWhiteLabelImages().getDefaultLogoIconName());
|
|
|
|
|
|
|
|
setDefaultWhiteLabelImageCommonProperties(logoIcon);
|
|
|
|
|
|
|
|
return logoIcon;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This is useful to set common properties such as DEFAULT_FILE type for {@link WhiteLabelImage.ImageLocationType}
|
|
|
|
* This is useful to set common properties such as DEFAULT_FILE type for {@link WhiteLabelImage.ImageLocationType}
|
|
|
|
* for default white label image bean{@link WhiteLabelImage}
|
|
|
|
* for default white label image bean{@link WhiteLabelImage}
|
|
|
@ -242,18 +287,24 @@ public class WhiteLabelManagementServiceImpl implements WhiteLabelManagementServ
|
|
|
|
log.debug("Creating Metadata : [" + createWhiteLabelTheme.toString() + "]");
|
|
|
|
log.debug("Creating Metadata : [" + createWhiteLabelTheme.toString() + "]");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
|
|
|
|
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(true);
|
|
|
|
File existingFaviconImage = null;
|
|
|
|
File existingFaviconImage = null;
|
|
|
|
File existingLogoImage = null;
|
|
|
|
File existingLogoImage = null;
|
|
|
|
|
|
|
|
File existingLogoIconImage = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
WhiteLabelTheme theme = getWhiteLabelTheme();
|
|
|
|
WhiteLabelTheme theme = getWhiteLabelTheme(tenantDomain);
|
|
|
|
if (theme.getFaviconImage().getImageLocationType() == WhiteLabelImage.ImageLocationType.CUSTOM_FILE) {
|
|
|
|
if (theme.getFaviconImage().getImageLocationType() == WhiteLabelImage.ImageLocationType.CUSTOM_FILE) {
|
|
|
|
existingFaviconImage = WhiteLabelStorageUtil.getWhiteLabelImageFile(theme.getFaviconImage(), WhiteLabelImage.ImageName.FAVICON);
|
|
|
|
existingFaviconImage = WhiteLabelStorageUtil.getWhiteLabelImageFile(theme.getFaviconImage(), WhiteLabelImage.ImageName.FAVICON, tenantDomain);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (theme.getLogoImage().getImageLocationType() == WhiteLabelImage.ImageLocationType.CUSTOM_FILE) {
|
|
|
|
if (theme.getLogoImage().getImageLocationType() == WhiteLabelImage.ImageLocationType.CUSTOM_FILE) {
|
|
|
|
existingLogoImage = WhiteLabelStorageUtil.getWhiteLabelImageFile(theme.getLogoImage(), WhiteLabelImage.ImageName.LOGO);
|
|
|
|
existingLogoImage = WhiteLabelStorageUtil.getWhiteLabelImageFile(theme.getLogoImage(), WhiteLabelImage.ImageName.LOGO, tenantDomain);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (theme.getLogoIconImage().getImageLocationType() == WhiteLabelImage.ImageLocationType.CUSTOM_FILE) {
|
|
|
|
|
|
|
|
existingLogoIconImage = WhiteLabelStorageUtil.getWhiteLabelImageFile(theme.getLogoIconImage(), WhiteLabelImage.ImageName.LOGO_ICON, tenantDomain);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
storeWhiteLabelImageIfRequired(createWhiteLabelTheme.getFavicon(), WhiteLabelImage.ImageName.FAVICON, tenantId);
|
|
|
|
storeWhiteLabelImageIfRequired(createWhiteLabelTheme.getFavicon(), WhiteLabelImage.ImageName.FAVICON, tenantId);
|
|
|
|
storeWhiteLabelImageIfRequired(createWhiteLabelTheme.getLogo(), WhiteLabelImage.ImageName.LOGO, tenantId);
|
|
|
|
storeWhiteLabelImageIfRequired(createWhiteLabelTheme.getLogo(), WhiteLabelImage.ImageName.LOGO, tenantId);
|
|
|
|
|
|
|
|
storeWhiteLabelImageIfRequired(createWhiteLabelTheme.getLogoIcon(), WhiteLabelImage.ImageName.LOGO_ICON, tenantId);
|
|
|
|
WhiteLabelTheme whiteLabelTheme = constructWhiteLabelTheme(createWhiteLabelTheme);
|
|
|
|
WhiteLabelTheme whiteLabelTheme = constructWhiteLabelTheme(createWhiteLabelTheme);
|
|
|
|
Metadata metadataWhiteLabelTheme = constructWhiteLabelThemeMetadata(whiteLabelTheme);
|
|
|
|
Metadata metadataWhiteLabelTheme = constructWhiteLabelThemeMetadata(whiteLabelTheme);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -266,12 +317,12 @@ public class WhiteLabelManagementServiceImpl implements WhiteLabelManagementServ
|
|
|
|
return whiteLabelTheme;
|
|
|
|
return whiteLabelTheme;
|
|
|
|
} catch (MetadataManagementDAOException e) {
|
|
|
|
} catch (MetadataManagementDAOException e) {
|
|
|
|
MetadataManagementDAOFactory.rollbackTransaction();
|
|
|
|
MetadataManagementDAOFactory.rollbackTransaction();
|
|
|
|
restoreWhiteLabelImages(existingFaviconImage, existingLogoImage, tenantId);
|
|
|
|
restoreWhiteLabelImages(existingFaviconImage, existingLogoImage, existingLogoIconImage, tenantId);
|
|
|
|
String msg = "Error occurred while creating the metadata entry. " + createWhiteLabelTheme;
|
|
|
|
String msg = "Error occurred while creating the metadata entry. " + createWhiteLabelTheme;
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MetadataManagementException(msg, e);
|
|
|
|
throw new MetadataManagementException(msg, e);
|
|
|
|
} catch (TransactionManagementException e) {
|
|
|
|
} catch (TransactionManagementException e) {
|
|
|
|
restoreWhiteLabelImages(existingFaviconImage, existingLogoImage, tenantId);
|
|
|
|
restoreWhiteLabelImages(existingFaviconImage, existingLogoImage, existingLogoIconImage, tenantId);
|
|
|
|
String msg = "Error occurred while opening a connection to the data source";
|
|
|
|
String msg = "Error occurred while opening a connection to the data source";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MetadataManagementException("Error occurred while creating metadata record", e);
|
|
|
|
throw new MetadataManagementException("Error occurred while creating metadata record", e);
|
|
|
@ -282,6 +333,11 @@ public class WhiteLabelManagementServiceImpl implements WhiteLabelManagementServ
|
|
|
|
String msg = "Error occurred while retrieving existing white label theme";
|
|
|
|
String msg = "Error occurred while retrieving existing white label theme";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new MetadataManagementException(msg, e);
|
|
|
|
throw new MetadataManagementException(msg, e);
|
|
|
|
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
|
|
|
|
String msg = "Error occurred while getting tenant details of white label";
|
|
|
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
throw new MetadataManagementException(msg, e);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -294,7 +350,7 @@ public class WhiteLabelManagementServiceImpl implements WhiteLabelManagementServ
|
|
|
|
* @param existingFavicon existing favicon image file
|
|
|
|
* @param existingFavicon existing favicon image file
|
|
|
|
* @param existingLogo existing logo image file
|
|
|
|
* @param existingLogo existing logo image file
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void restoreWhiteLabelImages(File existingFavicon, File existingLogo, int tenantId)
|
|
|
|
private void restoreWhiteLabelImages(File existingFavicon, File existingLogo, File existingLogoIcon, int tenantId)
|
|
|
|
throws MetadataManagementException {
|
|
|
|
throws MetadataManagementException {
|
|
|
|
WhiteLabelStorageUtil.deleteWhiteLabelImageForTenantIfExists(tenantId);
|
|
|
|
WhiteLabelStorageUtil.deleteWhiteLabelImageForTenantIfExists(tenantId);
|
|
|
|
if (existingFavicon != null) {
|
|
|
|
if (existingFavicon != null) {
|
|
|
@ -303,6 +359,9 @@ public class WhiteLabelManagementServiceImpl implements WhiteLabelManagementServ
|
|
|
|
if (existingLogo != null) {
|
|
|
|
if (existingLogo != null) {
|
|
|
|
WhiteLabelStorageUtil.storeWhiteLabelImage(existingLogo, WhiteLabelImage.ImageName.LOGO, tenantId);
|
|
|
|
WhiteLabelStorageUtil.storeWhiteLabelImage(existingLogo, WhiteLabelImage.ImageName.LOGO, tenantId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (existingLogoIcon != null) {
|
|
|
|
|
|
|
|
WhiteLabelStorageUtil.storeWhiteLabelImage(existingLogoIcon, WhiteLabelImage.ImageName.LOGO_ICON, tenantId);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -328,10 +387,13 @@ public class WhiteLabelManagementServiceImpl implements WhiteLabelManagementServ
|
|
|
|
WhiteLabelTheme whiteLabelTheme = new WhiteLabelTheme();
|
|
|
|
WhiteLabelTheme whiteLabelTheme = new WhiteLabelTheme();
|
|
|
|
WhiteLabelImageRequestPayload faviconPayload = whiteLabelThemeCreateRequest.getFavicon();
|
|
|
|
WhiteLabelImageRequestPayload faviconPayload = whiteLabelThemeCreateRequest.getFavicon();
|
|
|
|
WhiteLabelImageRequestPayload logoPayload = whiteLabelThemeCreateRequest.getLogo();
|
|
|
|
WhiteLabelImageRequestPayload logoPayload = whiteLabelThemeCreateRequest.getLogo();
|
|
|
|
|
|
|
|
WhiteLabelImageRequestPayload logoIconPayload = whiteLabelThemeCreateRequest.getLogoIcon();
|
|
|
|
WhiteLabelImage faviconImage = constructWhiteLabelImageDTO(faviconPayload);
|
|
|
|
WhiteLabelImage faviconImage = constructWhiteLabelImageDTO(faviconPayload);
|
|
|
|
WhiteLabelImage logoImage = constructWhiteLabelImageDTO(logoPayload);
|
|
|
|
WhiteLabelImage logoImage = constructWhiteLabelImageDTO(logoPayload);
|
|
|
|
|
|
|
|
WhiteLabelImage logoIconImage = constructWhiteLabelImageDTO(logoIconPayload);
|
|
|
|
whiteLabelTheme.setFaviconImage(faviconImage);
|
|
|
|
whiteLabelTheme.setFaviconImage(faviconImage);
|
|
|
|
whiteLabelTheme.setLogoImage(logoImage);
|
|
|
|
whiteLabelTheme.setLogoImage(logoImage);
|
|
|
|
|
|
|
|
whiteLabelTheme.setLogoIconImage(logoIconImage);
|
|
|
|
whiteLabelTheme.setFooterText(whiteLabelThemeCreateRequest.getFooterText());
|
|
|
|
whiteLabelTheme.setFooterText(whiteLabelThemeCreateRequest.getFooterText());
|
|
|
|
whiteLabelTheme.setAppTitle(whiteLabelThemeCreateRequest.getAppTitle());
|
|
|
|
whiteLabelTheme.setAppTitle(whiteLabelThemeCreateRequest.getAppTitle());
|
|
|
|
return whiteLabelTheme;
|
|
|
|
return whiteLabelTheme;
|
|
|
@ -367,8 +429,8 @@ public class WhiteLabelManagementServiceImpl implements WhiteLabelManagementServ
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public WhiteLabelTheme getWhiteLabelTheme() throws MetadataManagementException, NotFoundException {
|
|
|
|
public WhiteLabelTheme getWhiteLabelTheme(String tenantDomain) throws MetadataManagementException, NotFoundException, DeviceManagementException {
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
int tenantId = DeviceManagerUtil.getTenantId(tenantDomain);
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("Retrieving whitelabel theme for tenant: " + tenantId);
|
|
|
|
log.debug("Retrieving whitelabel theme for tenant: " + tenantId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|