|
|
@ -29,6 +29,7 @@ import org.wso2.carbon.context.CarbonContext;
|
|
|
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
|
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.ApplicationArtifact;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.ApplicationArtifact;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.ApplicationInstaller;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.ApplicationInstaller;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.LifecycleChanger;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.Pagination;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.Pagination;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.config.RatingConfiguration;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.config.RatingConfiguration;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO;
|
|
|
@ -84,6 +85,7 @@ import org.wso2.carbon.user.api.UserRealm;
|
|
|
|
import org.wso2.carbon.user.api.UserStoreException;
|
|
|
|
import org.wso2.carbon.user.api.UserStoreException;
|
|
|
|
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
|
|
|
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.ws.rs.core.Response;
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.io.InputStream;
|
|
|
@ -96,7 +98,6 @@ import java.util.HashSet;
|
|
|
|
import java.util.LinkedList;
|
|
|
|
import java.util.LinkedList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Optional;
|
|
|
|
|
|
|
|
import java.util.Queue;
|
|
|
|
import java.util.Queue;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.UUID;
|
|
|
|
import java.util.UUID;
|
|
|
@ -149,7 +150,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
|
|
|
|
|
|
|
ApplicationDTO applicationDTO;
|
|
|
|
ApplicationDTO applicationDTO;
|
|
|
|
List<String> unrestrictedRoles;
|
|
|
|
List<String> unrestrictedRoles;
|
|
|
|
Optional<CategoryDTO> category;
|
|
|
|
List<Integer> categoryIds = new ArrayList<>();
|
|
|
|
List<String> tags;
|
|
|
|
List<String> tags;
|
|
|
|
|
|
|
|
|
|
|
|
//validating and verifying application data
|
|
|
|
//validating and verifying application data
|
|
|
@ -189,7 +190,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<CategoryDTO> registeredCategories = this.applicationDAO.getAllCategories(tenantId);
|
|
|
|
List<CategoryDTO> registeredCategories = this.applicationDAO.getAllCategories(tenantId);
|
|
|
|
String categoryName = applicationWrapper.getAppCategory();
|
|
|
|
List<String> appCategories = applicationWrapper.getAppCategories();
|
|
|
|
|
|
|
|
|
|
|
|
if (registeredCategories.isEmpty()) {
|
|
|
|
if (registeredCategories.isEmpty()) {
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
@ -198,13 +199,21 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new ApplicationManagementException(msg);
|
|
|
|
throw new ApplicationManagementException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
category = registeredCategories.stream().filter(obj -> obj.getCategoryName().equals(categoryName))
|
|
|
|
for (String cat : appCategories) {
|
|
|
|
.findAny();
|
|
|
|
boolean isValidCategory = false;
|
|
|
|
if (!category.isPresent()) {
|
|
|
|
for (CategoryDTO obj : registeredCategories) {
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
if (cat.equals(obj.getCategoryName())) {
|
|
|
|
String msg = "Request contains invalid category: " + categoryName;
|
|
|
|
categoryIds.add(obj.getId());
|
|
|
|
log.error(msg);
|
|
|
|
isValidCategory = true;
|
|
|
|
throw new ApplicationManagementException(msg);
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!isValidCategory) {
|
|
|
|
|
|
|
|
String msg = "Application Creating request contains invalid categories. Hence please verify the "
|
|
|
|
|
|
|
|
+ "application creating payload.";
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
String msg = "Error occurred while getting database connection.";
|
|
|
|
String msg = "Error occurred while getting database connection.";
|
|
|
@ -260,6 +269,9 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("New ApplicationDTO entry added to AP_APP table. App Id:" + appId);
|
|
|
|
log.debug("New ApplicationDTO entry added to AP_APP table. App Id:" + appId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//add application categories
|
|
|
|
|
|
|
|
this.applicationDAO.addCategoryMapping(categoryIds, appId, tenantId);
|
|
|
|
|
|
|
|
|
|
|
|
//adding application unrestricted roles
|
|
|
|
//adding application unrestricted roles
|
|
|
|
if (unrestrictedRoles != null && !unrestrictedRoles.isEmpty()) {
|
|
|
|
if (unrestrictedRoles != null && !unrestrictedRoles.isEmpty()) {
|
|
|
|
this.visibilityDAO.addUnrestrictedRoles(unrestrictedRoles, appId, tenantId);
|
|
|
|
this.visibilityDAO.addUnrestrictedRoles(unrestrictedRoles, appId, tenantId);
|
|
|
@ -269,15 +281,6 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
In current flow, allow to add one category for an application. If it is required to add multiple
|
|
|
|
|
|
|
|
categories DAO layer is implemented to match with that requirement. Hence logic is also implemented
|
|
|
|
|
|
|
|
this way.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
List<Integer> categoryIds = new ArrayList<>();
|
|
|
|
|
|
|
|
categoryIds.add(category.get().getId());
|
|
|
|
|
|
|
|
this.applicationDAO.addCategoryMapping(categoryIds, appId, tenantId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//adding application tags
|
|
|
|
//adding application tags
|
|
|
|
if (tags != null && !tags.isEmpty()) {
|
|
|
|
if (tags != null && !tags.isEmpty()) {
|
|
|
|
List<TagDTO> registeredTags = applicationDAO.getAllTags(tenantId);
|
|
|
|
List<TagDTO> registeredTags = applicationDAO.getAllTags(tenantId);
|
|
|
@ -623,6 +626,11 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public ApplicationList getApplications(Filter filter) throws ApplicationManagementException {
|
|
|
|
public ApplicationList getApplications(Filter filter) throws ApplicationManagementException {
|
|
|
|
|
|
|
|
if (filter == null) {
|
|
|
|
|
|
|
|
String msg = "Request Payload is null";
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
|
|
|
|
String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
|
|
|
|
ApplicationList applicationList = new ApplicationList();
|
|
|
|
ApplicationList applicationList = new ApplicationList();
|
|
|
@ -631,24 +639,23 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
List<ApplicationDTO> filteredApplications = new ArrayList<>();
|
|
|
|
List<ApplicationDTO> filteredApplications = new ArrayList<>();
|
|
|
|
DeviceType deviceType = null;
|
|
|
|
DeviceType deviceType = null;
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
//set default values
|
|
|
|
//set default values
|
|
|
|
if (!StringUtils.isEmpty(filter.getDeviceType())) {
|
|
|
|
if (filter.getLimit() == 0) {
|
|
|
|
deviceType = getDeviceTypeData(filter.getDeviceType());
|
|
|
|
filter.setLimit(20);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (filter.getLimit() == 0) {
|
|
|
|
String deviceTypename = filter.getDeviceType();
|
|
|
|
filter.setLimit(20);
|
|
|
|
if (!StringUtils.isEmpty(deviceTypename)) {
|
|
|
|
}
|
|
|
|
deviceType = getDeviceTypeData(deviceTypename);
|
|
|
|
|
|
|
|
}
|
|
|
|
if (deviceType == null) {
|
|
|
|
if (deviceType == null) {
|
|
|
|
deviceType = new DeviceType();
|
|
|
|
deviceType = new DeviceType();
|
|
|
|
deviceType.setId(-1);
|
|
|
|
deviceType.setId(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
validateFilter(filter);
|
|
|
|
validateFilter(filter);
|
|
|
|
appDTOs = applicationDAO.getApplications(filter, deviceType.getId(), tenantId);
|
|
|
|
appDTOs = applicationDAO.getApplications(filter, deviceType.getId(), tenantId);
|
|
|
|
//todo as a performance improvement get these data from DB. Consider where in clause.
|
|
|
|
|
|
|
|
for (ApplicationDTO applicationDTO : appDTOs) {
|
|
|
|
for (ApplicationDTO applicationDTO : appDTOs) {
|
|
|
|
boolean isSearchingApp = true;
|
|
|
|
boolean isSearchingApp = true;
|
|
|
|
List<String> filteringTags = filter.getTags();
|
|
|
|
List<String> filteringTags = filter.getTags();
|
|
|
@ -656,14 +663,18 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
List<String> filteringUnrestrictedRoles = filter.getUnrestrictedRoles();
|
|
|
|
List<String> filteringUnrestrictedRoles = filter.getUnrestrictedRoles();
|
|
|
|
|
|
|
|
|
|
|
|
if (!lifecycleStateManager.getEndState().equals(applicationDTO.getStatus())) {
|
|
|
|
if (!lifecycleStateManager.getEndState().equals(applicationDTO.getStatus())) {
|
|
|
|
List<String> appUnrestrictedRoles = visibilityDAO.getUnrestrictedRoles(applicationDTO.getId(), tenantId);
|
|
|
|
List<String> appUnrestrictedRoles = visibilityDAO
|
|
|
|
|
|
|
|
.getUnrestrictedRoles(applicationDTO.getId(), tenantId);
|
|
|
|
|
|
|
|
applicationDTO.setUnrestrictedRoles(appUnrestrictedRoles);
|
|
|
|
if ((appUnrestrictedRoles.isEmpty() || hasUserRole(appUnrestrictedRoles, userName)) && (
|
|
|
|
if ((appUnrestrictedRoles.isEmpty() || hasUserRole(appUnrestrictedRoles, userName)) && (
|
|
|
|
filteringUnrestrictedRoles == null || filteringUnrestrictedRoles.isEmpty()
|
|
|
|
filteringUnrestrictedRoles == null || filteringUnrestrictedRoles.isEmpty()
|
|
|
|
|| hasAppUnrestrictedRole(appUnrestrictedRoles, filteringUnrestrictedRoles,
|
|
|
|
|| hasAppUnrestrictedRole(appUnrestrictedRoles, filteringUnrestrictedRoles,
|
|
|
|
userName))) {
|
|
|
|
userName))) {
|
|
|
|
if (filteringCategories != null && !filteringCategories.isEmpty()) {
|
|
|
|
if (filteringCategories != null && !filteringCategories.isEmpty()) {
|
|
|
|
List<String> appTagList = applicationDAO.getAppCategories(applicationDTO.getId(), tenantId);
|
|
|
|
List<String> appCategoryList = applicationDAO
|
|
|
|
boolean isAppCategory = filteringCategories.stream().anyMatch(appTagList::contains);
|
|
|
|
.getAppCategories(applicationDTO.getId(), tenantId);
|
|
|
|
|
|
|
|
applicationDTO.setAppCategories(appCategoryList);
|
|
|
|
|
|
|
|
boolean isAppCategory = filteringCategories.stream().anyMatch(appCategoryList::contains);
|
|
|
|
if (!isAppCategory) {
|
|
|
|
if (!isAppCategory) {
|
|
|
|
isSearchingApp = false;
|
|
|
|
isSearchingApp = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -699,9 +710,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
applicationList.getPagination().setSize(filter.getOffset());
|
|
|
|
applicationList.getPagination().setSize(filter.getOffset());
|
|
|
|
applicationList.getPagination().setCount(applicationList.getApplications().size());
|
|
|
|
applicationList.getPagination().setCount(applicationList.getApplications().size());
|
|
|
|
return applicationList;
|
|
|
|
return applicationList;
|
|
|
|
} catch (UnexpectedServerErrorException e){
|
|
|
|
} catch (UserStoreException e) {
|
|
|
|
throw new ApplicationManagementException(e.getMessage(), e);
|
|
|
|
|
|
|
|
}catch (UserStoreException e) {
|
|
|
|
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
"User-store exception while checking whether the user " + userName + " of tenant " + tenantId
|
|
|
|
"User-store exception while checking whether the user " + userName + " of tenant " + tenantId
|
|
|
|
+ " has the publisher permission", e);
|
|
|
|
+ " has the publisher permission", e);
|
|
|
@ -843,9 +852,8 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
List<String> tags = this.applicationDAO.getAppTags(appId, tenantId);
|
|
|
|
List<String> tags = this.applicationDAO.getAppTags(appId, tenantId);
|
|
|
|
List<String> categories = this.applicationDAO.getAppCategories(appId, tenantId);
|
|
|
|
List<String> categories = this.applicationDAO.getAppCategories(appId, tenantId);
|
|
|
|
applicationDTO.setTags(tags);
|
|
|
|
applicationDTO.setTags(tags);
|
|
|
|
//todo when support to add multiple categories this has to be changed
|
|
|
|
|
|
|
|
if (!categories.isEmpty()){
|
|
|
|
if (!categories.isEmpty()){
|
|
|
|
applicationDTO.setAppCategory(categories.get(0));
|
|
|
|
applicationDTO.setAppCategories(categories);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isAdminUser(userName, tenantId, CarbonConstants.UI_ADMIN_PERMISSION_COLLECTION)) {
|
|
|
|
if (isAdminUser(userName, tenantId, CarbonConstants.UI_ADMIN_PERMISSION_COLLECTION)) {
|
|
|
|
return appDtoToAppResponse(applicationDTO);
|
|
|
|
return appDtoToAppResponse(applicationDTO);
|
|
|
@ -1595,10 +1603,17 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void changeLifecycleState(String releaseUuid, String stateName)
|
|
|
|
public void changeLifecycleState(String releaseUuid, LifecycleChanger lifecycleChanger)
|
|
|
|
throws ApplicationManagementException {
|
|
|
|
throws ApplicationManagementException {
|
|
|
|
|
|
|
|
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
|
|
|
|
String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
|
|
|
|
|
|
|
|
if (lifecycleChanger == null || StringUtils.isEmpty(lifecycleChanger.getAction())) {
|
|
|
|
|
|
|
|
String msg = "The Action is null or empty. Please verify the request.";
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ConnectionManagerUtil.beginDBTransaction();
|
|
|
|
ConnectionManagerUtil.beginDBTransaction();
|
|
|
|
ApplicationReleaseDTO applicationReleaseDTO = this.applicationReleaseDAO
|
|
|
|
ApplicationReleaseDTO applicationReleaseDTO = this.applicationReleaseDAO
|
|
|
@ -1609,23 +1624,24 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new NotFoundException(msg);
|
|
|
|
throw new NotFoundException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (lifecycleStateManager
|
|
|
|
if (lifecycleStateManager
|
|
|
|
.isValidStateChange(applicationReleaseDTO.getCurrentState(), stateName, userName, tenantId)) {
|
|
|
|
.isValidStateChange(applicationReleaseDTO.getCurrentState(), lifecycleChanger.getAction(), userName,
|
|
|
|
if (lifecycleStateManager.isInstallableState(stateName) && applicationReleaseDAO
|
|
|
|
tenantId)) {
|
|
|
|
|
|
|
|
if (lifecycleStateManager.isInstallableState(lifecycleChanger.getAction()) && applicationReleaseDAO
|
|
|
|
.hasExistInstallableAppRelease(applicationReleaseDTO.getUuid(),
|
|
|
|
.hasExistInstallableAppRelease(applicationReleaseDTO.getUuid(),
|
|
|
|
lifecycleStateManager.getInstallableState(), tenantId)) {
|
|
|
|
lifecycleStateManager.getInstallableState(), tenantId)) {
|
|
|
|
String msg = "Installable application release is already registered for the application. "
|
|
|
|
String msg = "Installable application release is already registered for the application. "
|
|
|
|
+ "Therefore it is not permitted to change the lifecycle state from "
|
|
|
|
+ "Therefore it is not permitted to change the lifecycle state from "
|
|
|
|
+ applicationReleaseDTO.getCurrentState() + " to " + stateName;
|
|
|
|
+ applicationReleaseDTO.getCurrentState() + " to " + lifecycleChanger.getAction();
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new ForbiddenException(msg);
|
|
|
|
throw new ForbiddenException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LifecycleState lifecycleState = new LifecycleState();
|
|
|
|
LifecycleState lifecycleState = new LifecycleState();
|
|
|
|
lifecycleState.setCurrentState(stateName);
|
|
|
|
lifecycleState.setCurrentState(lifecycleChanger.getAction());
|
|
|
|
lifecycleState.setPreviousState(applicationReleaseDTO.getCurrentState());
|
|
|
|
lifecycleState.setPreviousState(applicationReleaseDTO.getCurrentState());
|
|
|
|
lifecycleState.setUpdatedBy(userName);
|
|
|
|
lifecycleState.setUpdatedBy(userName);
|
|
|
|
applicationReleaseDTO.setCurrentState(stateName);
|
|
|
|
lifecycleState.setResonForChange(lifecycleChanger.getReason());
|
|
|
|
|
|
|
|
applicationReleaseDTO.setCurrentState(lifecycleChanger.getAction());
|
|
|
|
if (this.applicationReleaseDAO.updateRelease(applicationReleaseDTO, tenantId) == null) {
|
|
|
|
if (this.applicationReleaseDAO.updateRelease(applicationReleaseDTO, tenantId) == null) {
|
|
|
|
String msg = "Application release updating is failed/.";
|
|
|
|
String msg = "Application release updating is failed/.";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
@ -1635,7 +1651,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
String msg = "Invalid lifecycle state transition from '" + applicationReleaseDTO.getCurrentState() + "'"
|
|
|
|
String msg = "Invalid lifecycle state transition from '" + applicationReleaseDTO.getCurrentState() + "'"
|
|
|
|
+ " to '" + stateName + "'";
|
|
|
|
+ " to '" + lifecycleChanger.getAction() + "'";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new ApplicationManagementException(msg);
|
|
|
|
throw new ApplicationManagementException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2347,7 +2363,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new RequestValidatingException(msg);
|
|
|
|
throw new RequestValidatingException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isEmpty(applicationWrapper.getAppCategory())) {
|
|
|
|
if (applicationWrapper.getAppCategories().isEmpty()) {
|
|
|
|
String msg = "Application category can't be empty.";
|
|
|
|
String msg = "Application category can't be empty.";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new RequestValidatingException(msg);
|
|
|
|
throw new RequestValidatingException(msg);
|
|
|
@ -2459,7 +2475,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
ApplicationDTO applicationDTO = new ApplicationDTO();
|
|
|
|
ApplicationDTO applicationDTO = new ApplicationDTO();
|
|
|
|
applicationDTO.setName(applicationWrapper.getName());
|
|
|
|
applicationDTO.setName(applicationWrapper.getName());
|
|
|
|
applicationDTO.setDescription(applicationWrapper.getDescription());
|
|
|
|
applicationDTO.setDescription(applicationWrapper.getDescription());
|
|
|
|
applicationDTO.setAppCategory(applicationWrapper.getAppCategory());
|
|
|
|
applicationDTO.setAppCategories(applicationWrapper.getAppCategories());
|
|
|
|
applicationDTO.setType(applicationWrapper.getType());
|
|
|
|
applicationDTO.setType(applicationWrapper.getType());
|
|
|
|
applicationDTO.setSubType(applicationWrapper.getSubType());
|
|
|
|
applicationDTO.setSubType(applicationWrapper.getSubType());
|
|
|
|
applicationDTO.setPaymentCurrency(applicationWrapper.getPaymentCurrency());
|
|
|
|
applicationDTO.setPaymentCurrency(applicationWrapper.getPaymentCurrency());
|
|
|
@ -2492,7 +2508,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
application.setId(applicationDTO.getId());
|
|
|
|
application.setId(applicationDTO.getId());
|
|
|
|
application.setName(applicationDTO.getName());
|
|
|
|
application.setName(applicationDTO.getName());
|
|
|
|
application.setDescription(applicationDTO.getDescription());
|
|
|
|
application.setDescription(applicationDTO.getDescription());
|
|
|
|
application.setAppCategory(applicationDTO.getAppCategory());
|
|
|
|
application.setAppCategories(applicationDTO.getAppCategories());
|
|
|
|
application.setType(applicationDTO.getType());
|
|
|
|
application.setType(applicationDTO.getType());
|
|
|
|
application.setSubType(applicationDTO.getSubType());
|
|
|
|
application.setSubType(applicationDTO.getSubType());
|
|
|
|
application.setPaymentCurrency(applicationDTO.getPaymentCurrency());
|
|
|
|
application.setPaymentCurrency(applicationDTO.getPaymentCurrency());
|
|
|
|