conflict fixes

merge-requests/18/head
inoshperera 6 years ago
parent dbc382716a
commit 853d095706

@ -52,7 +52,7 @@ public interface ApplicationStorageManager {
* @param screenshots Input Streams of screenshots
* @throws ResourceManagementException Resource Management Exception.
*/
void updateImageArtifacts(ApplicationRelease applicationRelease, InputStream iconFile,
ApplicationRelease updateImageArtifacts(ApplicationRelease applicationRelease, InputStream iconFile,
InputStream bannerFile, List<InputStream> screenshots)
throws ResourceManagementException, ApplicationManagementException;

@ -139,17 +139,17 @@ public class Util {
application.setDeviceTypeId(rs.getInt("DEVICE_TYPE_ID"));
}
// Tag tag = new Tag();
// tag.setTagName(rs.getString("APP_TAG"));
// UnrestrictedRole unrestrictedRole = new UnrestrictedRole();
// unrestrictedRole.setRole(rs.getString("ROLE"));
// if (application.getTags() != null && application.getTags().contains(tag)) {
// application.getTags().add(tag);
// }
// if (application.getUnrestrictedRoles() != null && application.getUnrestrictedRoles()
// .contains(unrestrictedRole)) {
// application.getUnrestrictedRoles().add(unrestrictedRole);
// }
Tag tag = new Tag();
tag.setTagName(rs.getString("APP_TAG"));
UnrestrictedRole unrestrictedRole = new UnrestrictedRole();
unrestrictedRole.setRole(rs.getString("ROLE"));
if (application.getTags() != null && application.getTags().contains(tag)) {
application.getTags().add(tag);
}
if (application.getUnrestrictedRoles() != null && application.getUnrestrictedRoles()
.contains(unrestrictedRole)) {
application.getUnrestrictedRoles().add(unrestrictedRole);
}
iteration++;
}
}

@ -254,8 +254,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
String sql = "SELECT AR.ID AS RELEASE_ID, AR.VERSION AS RELEASE_VERSION, AR.UUID, AR.RELEASE_TYPE, AR.APP_PRICE,"
+ " AR.STORED_LOCATION, AR.ICON_LOCATION, AR.BANNER_LOCATION, AR.SC_1_LOCATION AS SCREEN_SHOT_1, AR" +
".SC_2_LOCATION AS SCREEN_SHOT_2, AR.SC_3_LOCATION AS SCREEN_SHOT_3, AR.APP_HASH_VALUE AS HASH_VALUE, "
+ "AR.SHARED_WITH_ALL_TENANTS AS SHARED, AR.APP_META_INFO, AR.CREATED_BY, AR.CREATED_AT, "
+ "AR.PUBLISHED_BY, AR.PUBLISHED_AT, AR.STARS, AR.RATING FROM AP_APP_RELEASE AS "
+ "AR.SHARED_WITH_ALL_TENANTS AS SHARED, AR.APP_META_INFO, AR.RATING FROM AP_APP_RELEASE AS "
+ "AR where AR.TENANT_ID = ? AND AR.AP_APP_ID=(SELECT AP_APP_ID" +
" FROM AP_APP_LIFECYCLE_STATE WHERE AP_APP_ID = ? AND CURRENT_STATE = ? AND TENANT_ID = ?);";
@ -269,23 +268,8 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
resultSet = statement.executeQuery();
while (resultSet.next()) {
ApplicationRelease applicationRelease = new ApplicationRelease();
applicationRelease.setId(resultSet.getInt("RELEASE_ID"));
applicationRelease.setVersion(resultSet.getString("RELEASE_VERSION"));
applicationRelease.setUuid(resultSet.getString("UUID"));
applicationRelease.setReleaseType(resultSet.getString("RELEASE_TYPE"));
applicationRelease.setPrice(resultSet.getDouble("APP_PRICE"));
applicationRelease.setAppStoredLoc(resultSet.getString("STORED_LOCATION"));
applicationRelease.setIconLoc(resultSet.getString("ICON_LOCATION"));
applicationRelease.setBannerLoc(resultSet.getString("BANNER_LOCATION"));
applicationRelease.setScreenshotLoc1(resultSet.getString("SCREEN_SHOT_1"));
applicationRelease.setScreenshotLoc2(resultSet.getString("SCREEN_SHOT_2"));
applicationRelease.setScreenshotLoc3(resultSet.getString("SCREEN_SHOT_3"));
applicationRelease.setAppHashValue(resultSet.getString("HASH_VALUE"));
applicationRelease.setIsSharedWithAllTenants(resultSet.getInt("SHARED"));
applicationRelease.setMetaData(resultSet.getString("APP_META_INFO"));
applicationRelease.setRating(resultSet.getDouble("RATING"));
applicationReleases.add(applicationRelease);
ApplicationRelease appRelease = constructApplicationRelease(resultSet);
applicationReleases.add(appRelease);
}
return applicationReleases;
} catch (DBConnectionException e) {

@ -733,10 +733,9 @@ public class ApplicationManagerImpl implements ApplicationManager {
if (applicationRelease == null) {
throw new NotFoundException("No App release associated with the app Id " + appId + "and UUID "+ uuid);
}
applicationStorageManager
ApplicationRelease updatedRelease = applicationStorageManager
.updateImageArtifacts(applicationRelease, iconFileStream, bannerFileStream, attachments);
updateRelease(appId, applicationRelease);
return applicationRelease;
return updateRelease(appId, updatedRelease);
} finally {
ConnectionManagerUtil.closeDBConnection();
}

@ -133,7 +133,7 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
}
@Override
public void updateImageArtifacts(ApplicationRelease applicationRelease, InputStream
public ApplicationRelease updateImageArtifacts(ApplicationRelease applicationRelease, InputStream
iconFileStream, InputStream bannerFileStream, List<InputStream> screenShotStreams)
throws ResourceManagementException {
@ -164,6 +164,7 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
count++;
}
}
return applicationRelease;
} catch (ApplicationStorageManagementException e) {
throw new ApplicationStorageManagementException("Application Storage exception while trying to"
+ " update the screen-shot count for the application Release " + applicationRelease.getUuid() +

Loading…
Cancel
Save