mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge branch 'publisher-fix' into 'master'
Fix app name validation issue for webclips Closes product-iots#509 See merge request entgra/carbon-device-mgt!539
This commit is contained in:
commit
4b3ba956d3
@ -1894,16 +1894,23 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|||||||
DeviceManagementProviderService deviceManagementProviderService = DataHolder.getInstance()
|
DeviceManagementProviderService deviceManagementProviderService = DataHolder.getInstance()
|
||||||
.getDeviceManagementService();
|
.getDeviceManagementService();
|
||||||
try {
|
try {
|
||||||
DeviceType deviceType = deviceManagementProviderService.getDeviceType(deviceTypeName);
|
int deviceTypeId;
|
||||||
if (deviceType == null) {
|
if (!deviceTypeName.equals(Constants.ALL)) {
|
||||||
String msg = "Device type doesn't exist. Hence check the application name existence with valid "
|
DeviceType deviceType = deviceManagementProviderService.getDeviceType(deviceTypeName);
|
||||||
+ "device type name.";
|
deviceTypeId = deviceType.getId();
|
||||||
log.error(msg);
|
if (deviceType == null) {
|
||||||
throw new BadRequestException(msg);
|
String msg = "Device type doesn't exist. Hence check the application name existence with valid "
|
||||||
|
+ "device type name.";
|
||||||
|
log.error(msg);
|
||||||
|
throw new BadRequestException(msg);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//For web-clips device type = 'ALL'
|
||||||
|
deviceTypeId = 0;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
ConnectionManagerUtil.openDBConnection();
|
ConnectionManagerUtil.openDBConnection();
|
||||||
if (applicationDAO.isExistingAppName(appName, deviceType.getId(), tenantId)) {
|
if (applicationDAO.isExistingAppName(appName, deviceTypeId, tenantId)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (DBConnectionException e) {
|
} catch (DBConnectionException e) {
|
||||||
|
|||||||
@ -48,6 +48,7 @@ public class Constants {
|
|||||||
public static final String FORWARD_SLASH = "/";
|
public static final String FORWARD_SLASH = "/";
|
||||||
public static final String ANY = "ANY";
|
public static final String ANY = "ANY";
|
||||||
public static final String DEFAULT_PCK_NAME = "default.app.com";
|
public static final String DEFAULT_PCK_NAME = "default.app.com";
|
||||||
|
public static final String ALL = "ALL";
|
||||||
|
|
||||||
public static final String GOOGLE_PLAY_STORE_URL = "https://play.google.com/store/apps/details?id=";
|
public static final String GOOGLE_PLAY_STORE_URL = "https://play.google.com/store/apps/details?id=";
|
||||||
public static final String APPLE_STORE_URL = "https://itunes.apple.com/country/app/app-name/id";
|
public static final String APPLE_STORE_URL = "https://itunes.apple.com/country/app/app-name/id";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user