import org.onap.portalapp.portal.domain.EPUserAppsSortPreference;
import org.onap.portalapp.portal.domain.EPWidgetsManualSortPreference;
import org.onap.portalapp.portal.domain.EcompApp;
+import org.onap.portalapp.portal.domain.MicroserviceData;
import org.onap.portalapp.portal.domain.UserRole;
import org.onap.portalapp.portal.domain.UserRoles;
import org.onap.portalapp.portal.ecomp.model.AppCatalogItem;
import org.onap.portalsdk.core.onboarding.ueb.Helper;
import org.onap.portalsdk.core.onboarding.ueb.TopicManager;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.KeyConstants;
+import org.onap.portalsdk.core.onboarding.util.KeyProperties;
import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
import org.onap.portalsdk.core.service.DataAccessService;
public List<OnboardingApp> getEnabledNonOpenOnboardingApps() {
@SuppressWarnings("unchecked")
List<EPApp> apps = dataAccessService.getList(EPApp.class,
- " where enabled = true and open = false and id!=" + ECOMP_APP_ID, null, null);
+ " where enabled = true and open = false and app_type!= 3 and id!=" + ECOMP_APP_ID, null, null);
+
List<OnboardingApp> onboardingAppsList = new ArrayList<OnboardingApp>();
for (EPApp app : apps) {
OnboardingApp onboardingApp = new OnboardingApp();
if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
if (modifiedOnboardingApp.getId() != null) {
updateApp(modifiedOnboardingApp.getId(), modifiedOnboardingApp, fieldsValidator, user);
+ logger.info(EELFLoggerDelegate.auditLogger, "Updated " + modifiedOnboardingApp.getAppName() +
+ " onboarding application details by user " + user.getLoginId());
} else {
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
}
if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
if (newOnboardingApp.getId() == null) {
updateApp(null, newOnboardingApp, fieldsValidator, user);
+ logger.info(EELFLoggerDelegate.auditLogger, "Added " + newOnboardingApp.getAppName() +
+ " Onboarding application by user " + user.getLoginId());
} else {
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
}
}
final Map<String, Long> params = new HashMap<>();
params.put("app_id", appid);
+
+ //Checking if App is associated with any exiting microservices- ep_microservice:
+ final Map<String, Long> queryparams = new HashMap<>();
+ queryparams.put("applicationId", appid);
+ List<MicroserviceData> microservicesList = dataAccessService.executeNamedQuery( "getMicroservicesByAppId", queryparams, null);
+ if(microservicesList!=null && microservicesList.size()>0) {
+ fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+ return fieldsValidator;
+ }
+
List<EPUserAppRolesRequest> EPUserAppRolesRequestList= new ArrayList<>();
EPUserAppRolesRequestList = dataAccessService.executeNamedQuery( "getRequestIdsForApp", params, null);
for(int i=0;i<EPUserAppRolesRequestList.size();i++)
}
protected String constructImageName(OnboardingApp onboardingApp) {
- return "portal_" + String.valueOf(onboardingApp.getLandingPage().hashCode() + "_" + (int) (Math.random() * 100000.0))
+ String appLandingPageURL = onboardingApp.getLandingPage();
+ if(appLandingPageURL == null) {
+ appLandingPageURL = "";
+ }
+ return "portal_" + String.valueOf(appLandingPageURL.hashCode() + "_" + (int) (Math.random() * 100000.0))
+ ".png";
}
if (encryptedAppPwd != null && !encryptedAppPwd.isEmpty()) {
try {
result = CipherUtil.decryptPKC(encryptedAppPwd,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed for app " + app.getName(), e);
}
if (decryptedAppPwd != null && !decryptedAppPwd.isEmpty()) {
try {
result = CipherUtil.encryptPKC(decryptedAppPwd,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword failed for app " + app.getName(), e);
}