conflict fixes

feature/appm-store/pbac
inoshperera 6 years ago
parent dbc382716a
commit 853d095706

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

@ -139,17 +139,17 @@ public class Util {
application.setDeviceTypeId(rs.getInt("DEVICE_TYPE_ID")); application.setDeviceTypeId(rs.getInt("DEVICE_TYPE_ID"));
} }
// Tag tag = new Tag(); Tag tag = new Tag();
// tag.setTagName(rs.getString("APP_TAG")); tag.setTagName(rs.getString("APP_TAG"));
// UnrestrictedRole unrestrictedRole = new UnrestrictedRole(); UnrestrictedRole unrestrictedRole = new UnrestrictedRole();
// unrestrictedRole.setRole(rs.getString("ROLE")); unrestrictedRole.setRole(rs.getString("ROLE"));
// if (application.getTags() != null && application.getTags().contains(tag)) { if (application.getTags() != null && application.getTags().contains(tag)) {
// application.getTags().add(tag); application.getTags().add(tag);
// } }
// if (application.getUnrestrictedRoles() != null && application.getUnrestrictedRoles() if (application.getUnrestrictedRoles() != null && application.getUnrestrictedRoles()
// .contains(unrestrictedRole)) { .contains(unrestrictedRole)) {
// application.getUnrestrictedRoles().add(unrestrictedRole); application.getUnrestrictedRoles().add(unrestrictedRole);
// } }
iteration++; 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," 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" + + " 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, " ".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.SHARED_WITH_ALL_TENANTS AS SHARED, AR.APP_META_INFO, AR.RATING FROM AP_APP_RELEASE AS "
+ "AR.PUBLISHED_BY, AR.PUBLISHED_AT, AR.STARS, AR.RATING FROM AP_APP_RELEASE AS "
+ "AR where AR.TENANT_ID = ? AND AR.AP_APP_ID=(SELECT AP_APP_ID" + + "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 = ?);"; " 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(); resultSet = statement.executeQuery();
while (resultSet.next()) { while (resultSet.next()) {
ApplicationRelease applicationRelease = new ApplicationRelease(); ApplicationRelease appRelease = constructApplicationRelease(resultSet);
applicationRelease.setId(resultSet.getInt("RELEASE_ID")); applicationReleases.add(appRelease);
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);
} }
return applicationReleases; return applicationReleases;
} catch (DBConnectionException e) { } catch (DBConnectionException e) {

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

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

Loading…
Cancel
Save