|
|
|
@ -1286,6 +1286,9 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
}
|
|
|
|
|
applicationDTO.setId(appId);
|
|
|
|
|
applicationDTO.setApplicationReleaseDTOs(applicationReleaseEntities);
|
|
|
|
|
if (applicationDTO.getType().equals("ENTERPRISE") || applicationDTO.getType().equals("PUBLIC") ) {
|
|
|
|
|
persistAppIconInfo(applicationReleaseDTO);
|
|
|
|
|
}
|
|
|
|
|
return APIUtil.appDtoToAppResponse(applicationDTO);
|
|
|
|
|
}
|
|
|
|
|
} catch (LifeCycleManagementDAOException e) {
|
|
|
|
@ -1312,6 +1315,23 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void persistAppIconInfo(ApplicationReleaseDTO applicationReleaseDTO)
|
|
|
|
|
throws ApplicationManagementException {
|
|
|
|
|
try{
|
|
|
|
|
String iconPath = APIUtil.createAppIconPath(applicationReleaseDTO);
|
|
|
|
|
DataHolder.getInstance().getDeviceManagementService().saveApplicationIcon(iconPath,
|
|
|
|
|
String.valueOf(applicationReleaseDTO.getPackageName()), applicationReleaseDTO.getVersion());
|
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
|
String msg = "Error occurred while creating iconPath";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
|
String msg = "Error occurred while saving application icon info";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <T> ApplicationRelease createRelease(ApplicationDTO applicationDTO, ApplicationReleaseDTO applicationReleaseDTO,
|
|
|
|
|
ApplicationType type, boolean isPublished)
|
|
|
|
@ -1358,6 +1378,8 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ApplicationRelease applicationRelease = APIUtil.releaseDtoToRelease(applicationReleaseDTO);
|
|
|
|
|
DataHolder.getInstance().getDeviceManagementService().saveApplicationIcon(applicationReleaseDTO.getIconName(),
|
|
|
|
|
String.valueOf(applicationReleaseDTO.getPackageName()), applicationReleaseDTO.getVersion());
|
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
|
return applicationRelease;
|
|
|
|
|
} catch (TransactionManagementException e) {
|
|
|
|
@ -1381,6 +1403,8 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
String msg = "Error occurred while adding new application release for application " + applicationDTO.getId();
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
} finally {
|
|
|
|
|
ConnectionManagerUtil.closeDBConnection();
|
|
|
|
|
}
|
|
|
|
|