|
|
@ -4926,11 +4926,11 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void saveApplicationIcon(String iconPath, String packageName, String version) throws DeviceManagementException{
|
|
|
|
public void saveApplicationIcon(String iconPath, String packageName, String version, int tenantId) throws DeviceManagementException{
|
|
|
|
try{
|
|
|
|
try{
|
|
|
|
DeviceManagementDAOFactory.beginTransaction();
|
|
|
|
DeviceManagementDAOFactory.beginTransaction();
|
|
|
|
if(applicationDAO.getApplicationPackageCount(packageName) == 0){
|
|
|
|
if(applicationDAO.getApplicationPackageCount(packageName) == 0){
|
|
|
|
applicationDAO.saveApplicationIcon(iconPath, packageName, version);
|
|
|
|
applicationDAO.saveApplicationIcon(iconPath, packageName, version, tenantId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DeviceManagementDAOFactory.commitTransaction();
|
|
|
|
DeviceManagementDAOFactory.commitTransaction();
|
|
|
|
} catch (TransactionManagementException e) {
|
|
|
|
} catch (TransactionManagementException e) {
|
|
|
@ -4947,6 +4947,47 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void updateApplicationIcon(String iconPath, String oldPackageName, String newPackageName, String version)
|
|
|
|
|
|
|
|
throws DeviceManagementException{
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
DeviceManagementDAOFactory.beginTransaction();
|
|
|
|
|
|
|
|
applicationDAO.updateApplicationIcon(iconPath, oldPackageName, newPackageName, version);
|
|
|
|
|
|
|
|
DeviceManagementDAOFactory.commitTransaction();
|
|
|
|
|
|
|
|
} catch (TransactionManagementException e) {
|
|
|
|
|
|
|
|
String msg = "Error occurred while initiating transaction";
|
|
|
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
throw new DeviceManagementException(msg, e);
|
|
|
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
|
|
|
DeviceManagementDAOFactory.rollbackTransaction();
|
|
|
|
|
|
|
|
String msg = "Error occurred while updating app icon info";
|
|
|
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
throw new DeviceManagementException(msg, e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
DeviceManagementDAOFactory.closeConnection();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void deleteApplicationIcon(String packageName)
|
|
|
|
|
|
|
|
throws DeviceManagementException {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
DeviceManagementDAOFactory.beginTransaction();
|
|
|
|
|
|
|
|
applicationDAO.deleteApplicationIcon(packageName);
|
|
|
|
|
|
|
|
DeviceManagementDAOFactory.commitTransaction();
|
|
|
|
|
|
|
|
} catch (TransactionManagementException e) {
|
|
|
|
|
|
|
|
String msg = "Error occurred while initiating transaction";
|
|
|
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
throw new DeviceManagementException(msg, e);
|
|
|
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
|
|
|
DeviceManagementDAOFactory.rollbackTransaction();
|
|
|
|
|
|
|
|
String msg = "Error occurred while deleting app icon info";
|
|
|
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
throw new DeviceManagementException(msg, e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
DeviceManagementDAOFactory.closeConnection();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
private void getInstalledAppIconInfo(Device device) throws DeviceManagementException {
|
|
|
|
private void getInstalledAppIconInfo(Device device) throws DeviceManagementException {
|
|
|
|
List<Application> applications = device.getApplications();
|
|
|
|
List<Application> applications = device.getApplications();
|
|
|
|
String iconPath;
|
|
|
|
String iconPath;
|
|
|
@ -4956,11 +4997,14 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|
|
|
iconPath = deviceDAO.getIconPath(app.getApplicationIdentifier());
|
|
|
|
iconPath = deviceDAO.getIconPath(app.getApplicationIdentifier());
|
|
|
|
app.setImageUrl(iconPath);
|
|
|
|
app.setImageUrl(iconPath);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DeviceManagementDAOFactory.commitTransaction();
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
|
|
|
DeviceManagementDAOFactory.rollbackTransaction();
|
|
|
|
String msg = "Error occurred while retrieving installed app icon info";
|
|
|
|
String msg = "Error occurred while retrieving installed app icon info";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new DeviceManagementException(msg, e);
|
|
|
|
throw new DeviceManagementException(msg, e);
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
|
|
|
DeviceManagementDAOFactory.rollbackTransaction();
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new DeviceManagementException(msg, e);
|
|
|
|
throw new DeviceManagementException(msg, e);
|
|
|
|