Fix isues in app release update

feature/appm-store/pbac
lasanthaDLPDS 6 years ago
parent 48d606bdde
commit 1b0983dafb

@ -150,8 +150,7 @@ public interface ApplicationManager {
* @param stateName Lifecycle state to change the app * @param stateName Lifecycle state to change the app
* @throws ApplicationManagementException ApplicationDTO Management Exception. * @throws ApplicationManagementException ApplicationDTO Management Exception.
*/ */
void changeLifecycleState(String releaseUuid, String stateName) void changeLifecycleState(String releaseUuid, String stateName) throws ApplicationManagementException;
throws ApplicationManagementException;
/** /**
* To update release images such as icons, banner and screenshots. * To update release images such as icons, banner and screenshots.

@ -64,8 +64,7 @@ public interface LifecycleStateDAO {
* *
* @throws LifeCycleManagementDAOException Lifecycle Management DAO Exception. * @throws LifeCycleManagementDAOException Lifecycle Management DAO Exception.
*/ */
void addLifecycleState(LifecycleState state, int appReleaseId, int tenantId) void addLifecycleState(LifecycleState state, int appReleaseId, int tenantId) throws LifeCycleManagementDAOException;
throws LifeCycleManagementDAOException;
/** /**
* To delete lifecycle state data of specific application release. * To delete lifecycle state data of specific application release.

@ -102,7 +102,7 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
statement.setBoolean(15, applicationRelease.getIsSharedWithAllTenants()); statement.setBoolean(15, applicationRelease.getIsSharedWithAllTenants());
statement.setString(16, applicationRelease.getMetaData()); statement.setString(16, applicationRelease.getMetaData());
statement.setString(17, applicationRelease.getSupportedOsVersions()); statement.setString(17, applicationRelease.getSupportedOsVersions());
statement.setString(18, applicationRelease.getCurrentState()); statement.setString(18, applicationRelease.getCurrentState().toUpperCase());
statement.setInt(19, appId); statement.setInt(19, appId);
statement.executeUpdate(); statement.executeUpdate();
resultSet = statement.getGeneratedKeys(); resultSet = statement.getGeneratedKeys();
@ -474,9 +474,9 @@ public class GenericApplicationReleaseDAOImpl extends AbstractDAOImpl implements
statement.setBoolean(14, applicationReleaseDTO.getIsSharedWithAllTenants()); statement.setBoolean(14, applicationReleaseDTO.getIsSharedWithAllTenants());
statement.setString(15, applicationReleaseDTO.getMetaData()); statement.setString(15, applicationReleaseDTO.getMetaData());
statement.setString(16, applicationReleaseDTO.getSupportedOsVersions()); statement.setString(16, applicationReleaseDTO.getSupportedOsVersions());
statement.setString(17, applicationReleaseDTO.getCurrentState()); statement.setString(17, applicationReleaseDTO.getCurrentState().toUpperCase());
statement.setInt(18, tenantId); statement.setInt(18, applicationReleaseDTO.getId());
statement.setInt(19, applicationReleaseDTO.getId()); statement.setInt(19, tenantId);
if (statement.executeUpdate() == 0) { if (statement.executeUpdate() == 0) {
return null; return null;
} }

@ -1625,7 +1625,11 @@ public class ApplicationManagerImpl implements ApplicationManager {
lifecycleState.setPreviousState(applicationReleaseDTO.getCurrentState()); lifecycleState.setPreviousState(applicationReleaseDTO.getCurrentState());
lifecycleState.setUpdatedBy(userName); lifecycleState.setUpdatedBy(userName);
applicationReleaseDTO.setCurrentState(stateName); applicationReleaseDTO.setCurrentState(stateName);
this.applicationReleaseDAO.updateRelease(applicationReleaseDTO, tenantId); if (this.applicationReleaseDAO.updateRelease(applicationReleaseDTO, tenantId) == null) {
String msg = "Application release updating is failed/.";
log.error(msg);
throw new ApplicationManagementException(msg);
}
this.lifecycleStateDAO.addLifecycleState(lifecycleState, applicationReleaseDTO.getId(), tenantId); this.lifecycleStateDAO.addLifecycleState(lifecycleState, applicationReleaseDTO.getId(), tenantId);
ConnectionManagerUtil.commitDBTransaction(); ConnectionManagerUtil.commitDBTransaction();
} else { } else {

@ -931,12 +931,12 @@ public interface ApplicationManagementPublisherAPI {
name = "oldTagName", name = "oldTagName",
value = "Existing Tag Name", value = "Existing Tag Name",
required = true) required = true)
@PathParam("oldTagName") String oldTagName, @QueryParam("from") String oldTagName,
@ApiParam( @ApiParam(
name = "tag", name = "newTagName",
value = "Modifying Tag Name", value = "Modifying Tag Name",
required = true) required = true)
@QueryParam("tag") String newTagName @QueryParam("to") String newTagName
); );
@GET @GET

@ -551,10 +551,10 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem
@PUT @PUT
@Override @Override
@Consumes("application/json") @Consumes("application/json")
@Path("/tags/{oldTagName}") @Path("/tags/rename")
public Response modifyTagName( public Response modifyTagName(
@PathParam("oldTagName") String oldTagName, @QueryParam("from") String oldTagName,
@QueryParam("tag") String newTagName) { @QueryParam("to") String newTagName) {
ApplicationManager applicationManager = APIUtil.getApplicationManager(); ApplicationManager applicationManager = APIUtil.getApplicationManager();
try { try {
applicationManager.updateTag(oldTagName, newTagName); applicationManager.updateTag(oldTagName, newTagName);

Loading…
Cancel
Save