Merge "Upgraded SDK and CXF versions"
diff --git a/deliveries/build_portalapps_dockers.sh b/deliveries/build_portalapps_dockers.sh
index fdaf9a1..d2349b8 100755
--- a/deliveries/build_portalapps_dockers.sh
+++ b/deliveries/build_portalapps_dockers.sh
@@ -76,7 +76,7 @@
if [ "$SDK_DOCKERFILE" != "skip" ] && [ "SDK_APP_DIR" != "skip" ]; then
echo "Build Portal-SDK app"
cd $BASEDIR/$SDK_APP_DIR
- ${MVN} ${MVN_EXTRA_SDK} clean package
+ ${MVN} ${MVN_EXTRA_SDK} clean package -Dskiptests=true
fi
echo "Java build complete."
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/sessionmgt/SessionCommunicationController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/sessionmgt/SessionCommunicationController.java
index d36cf6c..33006c9 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/sessionmgt/SessionCommunicationController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/sessionmgt/SessionCommunicationController.java
@@ -54,6 +54,8 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
import io.swagger.annotations.ApiOperation;
@@ -75,14 +77,14 @@
@ApiOperation(value = "Gets session slot-check interval, a duration in milliseconds.",
response = Integer.class)
- @RequestMapping(value={"/getSessionSlotCheckInterval"}, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value={"/getSessionSlotCheckInterval"}, produces = "application/json")
public Integer getSessionSlotCheckInterval(HttpServletRequest request, HttpServletResponse response) throws Exception {
return manageService.fetchSessionSlotCheckInterval();
}
@ApiOperation(value = "Extends session timeout values for all on-boarded applications.",
response = Boolean.class)
- @RequestMapping(value={"/extendSessionTimeOuts"}, method = RequestMethod.POST)
+ @PostMapping(value={"/extendSessionTimeOuts"})
public Boolean extendSessionTimeOuts(HttpServletRequest request, HttpServletResponse response, @RequestParam String sessionMap) {
manageService.extendSessionTimeOuts(sessionMap);
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/music/conf/MusicSessionRepositoryHandler.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/music/conf/MusicSessionRepositoryHandler.java
index 46f96d6..12deabe 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/music/conf/MusicSessionRepositoryHandler.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/music/conf/MusicSessionRepositoryHandler.java
@@ -4,6 +4,8 @@
* ===================================================================
* Copyright © 2018 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modifications Copyright (c) 2020 IBM
+ * ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
@@ -55,12 +57,11 @@
public Session get(String id) {
if(musicCache){
- // todo need to add the clean up for "sessions" map if musicCache is enabled
+ // need to add the clean up for "sessions" map if musicCache is enabled
return this.sessions.get(id);
}else{
try {
- Session session = MusicService.getMetaAttribute(id);
- return session;
+ return MusicService.getMetaAttribute(id);
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "get failed with id " + id, e);
return null;
@@ -72,7 +73,7 @@
public void remove(String id) {
if(musicCache){
- // todo need to add the clean up for "sessions" map if musicCache is enabled
+ // need to add the clean up for "sessions" map if musicCache is enabled
sessions.remove(id);
}else{
try {
@@ -87,7 +88,7 @@
public void put(String id, MusicSession musicSession) {
if(musicCache){
- // todo need to add the clean up for "sessions" map if musicCache is enabled
+ //need to add the clean up for "sessions" map if musicCache is enabled
sessions.put(id, musicSession);
}else{
try {
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppCatalogController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppCatalogController.java
index 557e4dc..6ff16fc 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppCatalogController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppCatalogController.java
@@ -62,6 +62,9 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+
@RestController
@org.springframework.context.annotation.Configuration
@@ -90,7 +93,7 @@
* @throws IOException If sendError fails
* @return List of items suitable for display
*/
- @RequestMapping(value = { "/portalApi/appCatalog" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/appCatalog" }, produces = "application/json")
public List<AppCatalogItem> getAppCatalog(HttpServletRequest request, HttpServletResponse response)
throws IOException {
EPUser user = EPUserUtils.getUserSession(request);
@@ -125,7 +128,7 @@
* @return FieldsValidator
* @throws IOException If sendError fails
*/
- @RequestMapping(value = { "/portalApi/appCatalog" }, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = { "/portalApi/appCatalog" }, produces = "application/json")
public FieldsValidator putAppCatalogSelection(HttpServletRequest request,
@RequestBody AppCatalogPersonalization persRequest, HttpServletResponse response) throws IOException {
FieldsValidator result = new FieldsValidator();
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppContactUsController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppContactUsController.java
index 8f456fd..e9119de 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppContactUsController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppContactUsController.java
@@ -63,6 +63,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
@RestController
@RequestMapping("/portalApi/contactus")
@@ -94,7 +96,7 @@
* @param request HttpServletRequest
* @return PortalRestResponse
*/
- @RequestMapping(value = "/feedback", method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = "/feedback", produces = "application/json")
public PortalRestResponse<String> getPortalDetails(HttpServletRequest request) {
PortalRestResponse<String> portalRestResponse;
try {
@@ -123,7 +125,7 @@
* @param request HttpServletRequest
* @return PortalRestResponse<List<AppContactUsItem>>
*/
- @RequestMapping(value = "/list", method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = "/list", produces = "application/json")
public PortalRestResponse<List<AppContactUsItem>> getAppContactUsList(HttpServletRequest request) {
PortalRestResponse<List<AppContactUsItem>> portalRestResponse;
try {
@@ -145,7 +147,7 @@
* @param request HttpServletRequest
* @return PortalRestResponse<List<AppContactUsItem>>
*/
- @RequestMapping(value = "/allapps", method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = "/allapps", produces = "application/json")
public PortalRestResponse<List<AppContactUsItem>> getAppsAndContacts(HttpServletRequest request) {
PortalRestResponse<List<AppContactUsItem>> portalRestResponse;
try {
@@ -167,7 +169,7 @@
* @param request HttpServletRequest
* @return PortalRestResponse<List<AppCategoryFunctionsItem>>
*/
- @RequestMapping(value = "/functions", method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = "/functions", produces = "application/json")
public PortalRestResponse<List<AppCategoryFunctionsItem>> getAppCategoryFunctions(HttpServletRequest request) {
PortalRestResponse<List<AppCategoryFunctionsItem>> portalRestResponse;
try {
@@ -190,7 +192,7 @@
* @param contactUs AppContactUsItem
* @return PortalRestResponse<String>
*/
- @RequestMapping(value = "/save", method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = "/save", produces = "application/json")
public PortalRestResponse<String> save(@RequestBody AppContactUsItem contactUs) {
if (contactUs == null || contactUs.getAppName() == null) {
@@ -210,7 +212,7 @@
return new PortalRestResponse<>(PortalRestStatusEnum.OK, saveAppContactUs, "");
}
- @RequestMapping(value = "/saveAll", method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = "/saveAll", produces = "application/json")
public PortalRestResponse<String> save(@RequestBody List<AppContactUsItem> contactUsList) {
if (contactUsList == null) {
@@ -237,7 +239,7 @@
* @param id app ID
* @return PortalRestResponse<String>
*/
- @RequestMapping(value = "/delete/{appid}", method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = "/delete/{appid}", produces = "application/json")
public PortalRestResponse<String> delete(@PathVariable("appid") Long id) {
String saveAppContactUs = FAILURE;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java
index c34311c..6a6b3a6 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java
@@ -86,6 +86,10 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.HttpClientErrorException;
@@ -121,7 +125,7 @@
* HttpServletResponse
* @return List<EcompApp>
*/
- @RequestMapping(value = { "/portalApi/userApps" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/userApps" }, produces = "application/json")
public List<EcompApp> getUserApps(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<EcompApp> ecompApps = null;
@@ -152,7 +156,7 @@
* @throws IOException
* if sendError fails
*/
- @RequestMapping(value = { "/portalApi/persUserApps" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/persUserApps" }, produces = "application/json")
public List<EcompApp> getPersUserApps(HttpServletRequest request, HttpServletResponse response) throws IOException {
EPUser user = EPUserUtils.getUserSession(request);
List<EcompApp> ecompApps = null;
@@ -185,7 +189,7 @@
* HttpServletResponse
* @return List<AppIdAndNameTransportModel>
*/
- @RequestMapping(value = { "/portalApi/adminApps" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/adminApps" }, produces = "application/json")
public List<AppIdAndNameTransportModel> getAdminApps(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<AppIdAndNameTransportModel> adminApps = null;
@@ -214,8 +218,8 @@
* HttpServletResponse
* @return List<AppIdAndNameTransportModel>
*/
- @RequestMapping(value = {
- "/portalApi/appsForSuperAdminAndAccountAdmin" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/appsForSuperAdminAndAccountAdmin" }, produces = "application/json")
public List<AppIdAndNameTransportModel> getAppsForSuperAdminAndAccountAdmin(HttpServletRequest request,
HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
@@ -246,7 +250,7 @@
* @return JSON with left menu
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
- @RequestMapping(value = { "/portalApi/leftmenuItems" }, method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
+ @GetMapping(value = { "/portalApi/leftmenuItems" }, produces = "application/json;charset=UTF-8")
public String getLeftMenuItems(HttpServletRequest request, HttpServletResponse response) {
String menuList = null;
Set menuSet = (Set) AppUtils.getSession(request)
@@ -266,8 +270,8 @@
return menuList;
}
- @RequestMapping(value = {
- PORTAL_API_USER_APPS_ORDER_BY_SORT_PREF }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ PORTAL_API_USER_APPS_ORDER_BY_SORT_PREF }, produces = "application/json")
public List<EcompApp> getUserAppsOrderBySortPref(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<EcompApp> ecompApps = null;
@@ -322,8 +326,8 @@
* sort pref
* @return FieldsValidator
*/
- @RequestMapping(value = {
- "/portalApi/saveUserAppsSortingManual" }, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = {
+ "/portalApi/saveUserAppsSortingManual" }, produces = "application/json")
public FieldsValidator putUserAppsSortingManual(HttpServletRequest request,
@RequestBody List<EPAppsManualPreference> epAppsManualPref, HttpServletResponse response) {
FieldsValidator fieldsValidator = null;
@@ -346,8 +350,8 @@
return fieldsValidator;
}
- @RequestMapping(value = {
- "/portalApi/saveUserWidgetsSortManual" }, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = {
+ "/portalApi/saveUserWidgetsSortManual" }, produces = "application/json")
public FieldsValidator putUserWidgetsSortManual(HttpServletRequest request,
@RequestBody List<EPWidgetsSortPreference> saveManualWidgetSData, HttpServletResponse response) {
FieldsValidator fieldsValidator = null;
@@ -370,8 +374,8 @@
return fieldsValidator;
}
- @RequestMapping(value = {
- "/portalApi/updateWidgetsSortPref" }, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = {
+ "/portalApi/updateWidgetsSortPref" }, produces = "application/json")
public FieldsValidator putUserWidgetsSortPref(HttpServletRequest request,
@RequestBody List<EPWidgetsSortPreference> delManualWidgetData, HttpServletResponse response) {
FieldsValidator fieldsValidator = null;
@@ -406,8 +410,8 @@
* data to delete
* @return FieldsValidator
*/
- @RequestMapping(value = {
- "/portalApi/UpdateUserAppsSortManual" }, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = {
+ "/portalApi/UpdateUserAppsSortManual" }, produces = "application/json")
public FieldsValidator deleteUserAppSortManual(HttpServletRequest request,
@RequestBody EPDeleteAppsManualSortPref delManualAppData, HttpServletResponse response) {
FieldsValidator fieldsValidator = null;
@@ -425,8 +429,8 @@
return fieldsValidator;
}
- @RequestMapping(value = {
- "/portalApi/saveUserAppsSortingPreference" }, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = {
+ "/portalApi/saveUserAppsSortingPreference" }, produces = "application/json")
public FieldsValidator putUserAppsSortingPreference(HttpServletRequest request,
@RequestBody EPAppsSortPreference userAppsValue, HttpServletResponse response) {
FieldsValidator fieldsValidator = null;
@@ -444,8 +448,8 @@
return fieldsValidator;
}
- @RequestMapping(value = {
- "/portalApi/userAppsSortTypePreference" }, method = RequestMethod.GET, produces = "application/String")
+ @GetMapping(value = {
+ "/portalApi/userAppsSortTypePreference" }, produces = "application/String")
public String getUserAppsSortTypePreference(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
String userSortPreference = null;
@@ -476,7 +480,7 @@
* HTTP servlet response
* @return List<AdminUserApplications>
*/
- @RequestMapping(value = { "/portalApi/accountAdmins" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/accountAdmins" }, produces = "application/json")
public List<AdminUserApplications> getAppsAdministrators(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<AdminUserApplications> admins = null;
@@ -494,7 +498,7 @@
return admins;
}
- @RequestMapping(value = { "/portalApi/availableApps" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/availableApps" }, produces = "application/json")
public List<AppsResponse> getApps(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<AppsResponse> apps = null;
@@ -522,8 +526,8 @@
* HTTP servlet response
* @return List of applications
*/
- @RequestMapping(value = {
- "/portalApi/allAvailableApps" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/allAvailableApps" }, produces = "application/json")
public List<AppsResponse> getAllApps(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<AppsResponse> apps = null;
@@ -549,7 +553,7 @@
* HTTP servlet response
* @return List of applications
*/
- @RequestMapping(value = { "/portalApi/appsFullList" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/appsFullList" }, produces = "application/json")
public List<EcompApp> getAppsFullList(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<EcompApp> ecompApps = null;
@@ -570,7 +574,7 @@
* HTTP servlet response
* @return UserRoles
*/
- @RequestMapping(value = { "/portalApi/userProfile" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/userProfile" }, produces = "application/json")
public UserRoles getUserProfile(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
UserRoles userAndRoles = null;
@@ -597,8 +601,7 @@
* application ID
* @return List<LocalRole>
*/
- @RequestMapping(value = { "/portalApi/appRoles/{appId}" }, method = {
- RequestMethod.GET }, produces = "application/json")
+ @GetMapping(value = { "/portalApi/appRoles/{appId}" }, produces = "application/json")
public List<LocalRole> getAppRoles(HttpServletRequest request, @PathVariable("appId") Long appId,
HttpServletResponse response) {
List<LocalRole> roleList = null;
@@ -627,8 +630,7 @@
* @param response
* @return EPApp object
*/
- @RequestMapping(value = { "/portalApi/singleAppInfo" }, method = {
- RequestMethod.GET }, produces = "application/json")
+ @GetMapping(value = { "/portalApi/singleAppInfo" }, produces = "application/json")
public EPApp getSingleAppInfo(HttpServletRequest request, HttpServletResponse response) {
EPApp app = null;
EPUser user = EPUserUtils.getUserSession(request);
@@ -657,8 +659,7 @@
* @param response
* @return EPApp object
*/
- @RequestMapping(value = { "/portalApi/singleAppInfoById" }, method = {
- RequestMethod.GET }, produces = "application/json")
+ @GetMapping(value = { "/portalApi/singleAppInfoById" }, produces = "application/json")
public EPApp getSingleAppInfoById(HttpServletRequest request, HttpServletResponse response) {
EPApp app = null;
EPUser user = EPUserUtils.getUserSession(request);
@@ -690,7 +691,7 @@
* HTTP servlet response
* @return List<OnboardingApp>
*/
- @RequestMapping(value = { PORTAL_API_ONBOARDING_APPS }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { PORTAL_API_ONBOARDING_APPS }, produces = "application/json")
public List<OnboardingApp> getOnboardingApps(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<OnboardingApp> onboardingApps = null;
@@ -728,7 +729,7 @@
* @return FieldsValidator
* @throws Exception
*/
- @RequestMapping(value = { PORTAL_API_ONBOARDING_APPS }, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = { PORTAL_API_ONBOARDING_APPS }, produces = "application/json")
public FieldsValidator putOnboardingApp(HttpServletRequest request,
@RequestBody OnboardingApp modifiedOnboardingApp, HttpServletResponse response) {
FieldsValidator fieldsValidator = null;
@@ -784,7 +785,7 @@
* app to add
* @return FieldsValidator
*/
- @RequestMapping(value = { PORTAL_API_ONBOARDING_APPS }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { PORTAL_API_ONBOARDING_APPS }, produces = "application/json")
public FieldsValidator postOnboardingApp(HttpServletRequest request, @RequestBody OnboardingApp newOnboardingApp,
HttpServletResponse response) {
FieldsValidator fieldsValidator = null;
@@ -845,8 +846,7 @@
* ID of app to delete
* @return FieldsValidator
*/
- @RequestMapping(value = { "/portalApi/onboardingApps/{appId}" }, method = {
- RequestMethod.DELETE }, produces = "application/json")
+ @DeleteMapping(value = { "/portalApi/onboardingApps/{appId}" }, produces = "application/json")
public FieldsValidator deleteOnboardingApp(HttpServletRequest request, @PathVariable("appId") Long appId,
HttpServletResponse response) {
FieldsValidator fieldsValidator = null;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequest.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequest.java
index d5438f4..28ec0e1 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequest.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequest.java
@@ -65,6 +65,9 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@@ -126,7 +129,7 @@
* @return PortalRestResponse with success or failure
*/
@ApiOperation(value = "Creates a new user as a Portal administrator.", response = PortalRestResponse.class)
- @RequestMapping(value = "/portalAdmin", method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = "/portalAdmin", produces = "application/json")
@ResponseBody
public PortalRestResponse<String> postPortalAdmin(HttpServletRequest request, HttpServletResponse response,
@Valid @RequestBody EPUser epUser) {
@@ -200,7 +203,7 @@
* @return OnboardingApp objects
*/
@ApiOperation(value = "Gets the specified application that is on-boarded in Portal.", response = OnboardingApp.class)
- @RequestMapping(value = {ONBOARD_APP + "/{appId}"}, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {ONBOARD_APP + "/{appId}"}, produces = "application/json")
@ResponseBody
public OnboardingApp getOnboardAppExternal(HttpServletRequest request, HttpServletResponse response,
@PathVariable("appId") Long appId) {
@@ -234,7 +237,7 @@
* @return PortalRestResponse
*/
@ApiOperation(value = "Adds a new application to Portal.", response = PortalRestResponse.class)
- @RequestMapping(value = {ONBOARD_APP}, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = {ONBOARD_APP}, produces = "application/json")
@ResponseBody
public PortalRestResponse<String> postOnboardAppExternal(HttpServletRequest request, HttpServletResponse response,
@Valid @RequestBody OnboardingApp newOnboardApp) {
@@ -322,7 +325,7 @@
* @return PortalRestResponse
*/
@ApiOperation(value = "Updates information about an on-boarded application in Portal.", response = PortalRestResponse.class)
- @RequestMapping(value = {ONBOARD_APP + "/{appId}"}, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = {ONBOARD_APP + "/{appId}"}, produces = "application/json")
@ResponseBody
public PortalRestResponse<String> putOnboardAppExternal(HttpServletRequest request, HttpServletResponse response,
@PathVariable("appId") Long appId, @Valid @RequestBody OnboardingApp oldOnboardApp) {
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuditLogController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuditLogController.java
index cff8245..ae64be1 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuditLogController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuditLogController.java
@@ -48,6 +48,7 @@
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@@ -91,7 +92,7 @@
* @param comment
* Comment
*/
- @RequestMapping(value = "/store", method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = "/store", produces = "application/json")
public void auditLog(HttpServletRequest request, @RequestParam String affectedAppId, @RequestParam String type,
@RequestParam String comment) {
logger.debug(EELFLoggerDelegate.debugLogger, "auditLog: appId {}, type {}, comment {}", affectedAppId, type,
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuxApiRequestMapperController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuxApiRequestMapperController.java
index 1f0c1f8..ab13095 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuxApiRequestMapperController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuxApiRequestMapperController.java
@@ -84,6 +84,10 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -106,7 +110,7 @@
private ManifestService manifestService;
@ApiOperation(value = "Gets user roles for an application which is upgraded to newer version.", response = String.class, responseContainer = "List")
- @RequestMapping(value = { "/v3/user/{loginId}" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/v3/user/{loginId}" }, produces = "application/json")
public String getUser(HttpServletRequest request, HttpServletResponse response,
@PathVariable("loginId") String loginId) throws Exception {
if (loginId!=null){
@@ -128,7 +132,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Gets roles for an application which is upgraded to newer version.", response = CentralV2Role.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/roles" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/v3/roles" }, produces = "application/json")
public List<CentralV2Role> getRoles(HttpServletRequest request, HttpServletResponse response) throws Exception {
Map<String, Object> res = getMethod(request, response);
request.getMethod();
@@ -143,7 +147,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Saves role for an application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/role" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/v3/role" }, produces = "application/json")
public PortalRestResponse<String> saveRole(HttpServletRequest request, HttpServletResponse response,
@RequestBody Role role) throws Exception {
Map<String, Object> res = getMethod(request, response);
@@ -158,7 +162,7 @@
}
@ApiOperation(value = "Gets v2 role information for an application which is upgraded to newer version.", response = CentralV2Role.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/role/{role_id}" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/v3/role/{role_id}" }, produces = "application/json")
public CentralV2Role getRoleInfo(HttpServletRequest request, HttpServletResponse response,
@PathVariable("role_id") Long roleId) throws Exception {
Map<String, Object> res = getMethod(request, response);
@@ -174,7 +178,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Gets all active Users of application", response = String.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/users" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/v3/users" }, produces = "application/json")
public List<EcompUser> getUsersOfApplication(HttpServletRequest request, HttpServletResponse response)
throws Exception {
Map<String, Object> res = getMethod(request, response);
@@ -189,7 +193,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Gets all role functions for an application which is upgraded to newer version.", response = CentralV2RoleFunction.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/functions" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/v3/functions" }, produces = "application/json")
public List<CentralV2RoleFunction> getRoleFunctionsList(HttpServletRequest request, HttpServletResponse response)
throws Exception {
Map<String, Object> res = getMethod(request, response);
@@ -203,7 +207,7 @@
}
@ApiOperation(value = "Gets role information for an application provided by function code.", response = CentralV2RoleFunction.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/function/{code}" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/v3/function/{code}" }, produces = "application/json")
public CentralV2RoleFunction getRoleFunction(HttpServletRequest request, HttpServletResponse response,
@PathVariable("code") String code) throws Exception {
if (code!=null){
@@ -224,7 +228,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Saves role function for an application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/roleFunction" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/v3/roleFunction" }, produces = "application/json")
public PortalRestResponse<String> saveRoleFunction(HttpServletRequest request, HttpServletResponse response,
@RequestBody String roleFunc) throws Exception {
if (roleFunc!=null){
@@ -249,7 +253,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Deletes role function for an application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/roleFunction/{code}" }, method = RequestMethod.DELETE, produces = "application/json")
+ @DeleteMapping(value = { "/v3/roleFunction/{code}" }, produces = "application/json")
public PortalRestResponse<String> deleteRoleFunction(HttpServletRequest request, HttpServletResponse response,
@PathVariable("code") String code) throws Exception {
PortalRestResponse<String> result = null;
@@ -272,7 +276,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "deletes roles for an application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/deleteRole/{roleId}" }, method = RequestMethod.DELETE, produces = "application/json")
+ @DeleteMapping(value = { "/v3/deleteRole/{roleId}" }, produces = "application/json")
public PortalRestResponse<String> deleteRole(HttpServletRequest request, HttpServletResponse response,
@PathVariable("roleId") Long roleId) throws Exception {
PortalRestResponse<String> result = null;
@@ -288,7 +292,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Gets active roles for an application.", response = CentralV2Role.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/activeRoles" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/v3/activeRoles" }, produces = "application/json")
public List<CentralV2Role> getActiveRoles(HttpServletRequest request, HttpServletResponse response)
throws Exception {
List<CentralV2Role> cenRole = null;
@@ -302,7 +306,7 @@
}
@ApiOperation(value = "Gets ecompUser of an application.", response = CentralUser.class, responseContainer = "List")
- @RequestMapping(value = { "/v4/user/{loginId}" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/v4/user/{loginId}" }, produces = "application/json")
public String getEcompUser(HttpServletRequest request, HttpServletResponse response,
@PathVariable("loginId") String loginId) throws Exception {
Map<String, Object> res = getMethod(request, response);
@@ -325,7 +329,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Gets user ecomp role for an application.", response = CentralUser.class, responseContainer = "List")
- @RequestMapping(value = { "/v4/roles" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/v4/roles" }, produces = "application/json")
public List<EcompRole> getEcompRolesOfApplication(HttpServletRequest request, HttpServletResponse response)
throws Exception {
Map<String, Object> res = getMethod(request, response);
@@ -339,8 +343,8 @@
}
@ApiOperation(value = "Gets session slot-check interval, a duration in milliseconds.", response = Integer.class)
- @RequestMapping(value = {
- "/v3/getSessionSlotCheckInterval" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/v3/getSessionSlotCheckInterval" }, produces = "application/json")
public Integer getSessionSlotCheckInterval(HttpServletRequest request, HttpServletResponse response)
throws Exception {
Map<String, Object> res = getMethod(request, response);
@@ -376,7 +380,7 @@
}
@ApiOperation(value = "Gets javascript with functions that support gathering and reporting web analytics.", response = String.class)
- @RequestMapping(value = { "/v3/analytics" }, method = RequestMethod.GET, produces = "application/javascript")
+ @GetMapping(value = { "/v3/analytics" }, produces = "application/javascript")
public String getAnalyticsScript(HttpServletRequest request, HttpServletResponse response) throws Exception {
Map<String, Object> res = getMethod(request, response);
String ans = null;
@@ -388,7 +392,7 @@
return ans;
}
- @RequestMapping(value = { "/v3/storeAnalytics" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/v3/storeAnalytics" }, produces = "application/json")
@ResponseBody
@ApiOperation(value = "Accepts data from partner applications with web analytics data.", response = PortalAPIResponse.class)
public PortalAPIResponse storeAnalyticsScript(HttpServletRequest request, HttpServletResponse response,
@@ -412,8 +416,8 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Bulk upload functions for an application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = {
- "/v3/upload/portal/functions" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = {
+ "/v3/upload/portal/functions" }, produces = "application/json")
public PortalRestResponse<String> bulkUploadFunctions(HttpServletRequest request, HttpServletResponse response)
throws Exception {
Optional<PortalRestResponse<String>> result = null;
@@ -433,7 +437,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Bulk upload roles for an application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/upload/portal/roles" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/v3/upload/portal/roles" }, produces = "application/json")
public PortalRestResponse<String> bulkUploadRoles(HttpServletRequest request, HttpServletResponse response)
throws Exception {
Optional<PortalRestResponse<String>> result;
@@ -453,8 +457,8 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Bulk upload role functions for an application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = {
- "/v3/upload/portal/roleFunctions" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = {
+ "/v3/upload/portal/roleFunctions" }, produces = "application/json")
public PortalRestResponse<String> bulkUploadRoleFunctions(HttpServletRequest request, HttpServletResponse response)
throws Exception {
Optional<PortalRestResponse<String>> result;
@@ -474,8 +478,8 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Bulk upload user roles for an application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = {
- "/v3/upload/portal/userRoles" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = {
+ "/v3/upload/portal/userRoles" }, produces = "application/json")
public PortalRestResponse<String> bulkUploadUserRoles(HttpServletRequest request, HttpServletResponse response)
throws Exception {
Optional<PortalRestResponse<String>> result;
@@ -496,8 +500,8 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Bulk upload users for renamed role of an application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = {
- "/v3/upload/portal/userRole/{roleId}" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = {
+ "/v3/upload/portal/userRole/{roleId}" }, produces = "application/json")
public PortalRestResponse<String> bulkUploadUsersSingleRole(HttpServletRequest request,
HttpServletResponse response, @PathVariable Long roleId) throws Exception {
Optional<PortalRestResponse<String>> result = null;
@@ -517,8 +521,8 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Bulk upload functions for an partner application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = {
- "/v3/upload/partner/functions" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = {
+ "/v3/upload/partner/functions" }, produces = "application/json")
public PortalRestResponse<String> bulkUploadPartnerFunctions(HttpServletRequest request,
HttpServletResponse response) throws Exception {
Optional<PortalRestResponse<String>> result = null;
@@ -539,7 +543,7 @@
// not using
@SuppressWarnings("unchecked")
@ApiOperation(value = "Bulk upload roles for an partner application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/upload/partner/roles" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/v3/upload/partner/roles" }, produces = "application/json")
public PortalRestResponse<String> bulkUploadPartnerRoles(HttpServletRequest request, HttpServletResponse response,
@RequestBody List<Role> upload) throws Exception {
Optional<PortalRestResponse<String>> result = null;
@@ -559,8 +563,8 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Bulk upload role functions for an partner application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = {
- "/v3/upload/partner/roleFunctions" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = {
+ "/v3/upload/partner/roleFunctions" }, produces = "application/json")
public PortalRestResponse<String> bulkUploadPartnerRoleFunctions(HttpServletRequest request,
HttpServletResponse response) throws Exception {
Optional<PortalRestResponse<String>> result = null;
@@ -580,7 +584,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Gets all functions along with global functions", response = List.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/menuFunctions" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/v3/menuFunctions" }, produces = "application/json")
public List<String> getMenuFunctions(HttpServletRequest request, HttpServletResponse response) throws Exception {
List<String> functionsList = null;
Map<String, Object> res = getMethod(request, response);
@@ -795,7 +799,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Creates an application user with the specified roles.", response = PortalRestResponse.class)
- @RequestMapping(value = { "/v3/userProfile" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/v3/userProfile" }, produces = "application/json")
public PortalRestResponse<String> postUserProfile(HttpServletRequest request,
@RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) {
@@ -817,7 +821,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Updates an application user to have only the specified roles.", response = PortalRestResponse.class)
- @RequestMapping(value = { "/v3/userProfile" }, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = { "/v3/userProfile" }, produces = "application/json")
public PortalRestResponse<String> putUserProfile(HttpServletRequest request,
@RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) {
@@ -839,7 +843,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Processes a request to delete one or more application roles for one specified user who has roles.", response = PortalRestResponse.class)
- @RequestMapping(value = { "/v3/userProfile" }, method = RequestMethod.DELETE, produces = "application/json")
+ @DeleteMapping(value = { "/v3/userProfile" }, produces = "application/json")
public PortalRestResponse<String> deleteUserProfile(HttpServletRequest request,
@RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) {
@@ -884,7 +888,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Creates a new user as a Portal administrator.", response = PortalRestResponse.class)
- @RequestMapping(value = "/v3/portalAdmin", method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = "/v3/portalAdmin", produces = "application/json")
@ResponseBody
public PortalRestResponse<String> postPortalAdmin(HttpServletRequest request, HttpServletResponse response,
@RequestBody EPUser epUser) {
@@ -906,7 +910,7 @@
}
@ApiOperation(value = "Gets the specified application that is on-boarded in Portal.", response = OnboardingApp.class)
- @RequestMapping(value = { "/v3/onboardApp/{appId}" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/v3/onboardApp/{appId}" }, produces = "application/json")
@ResponseBody
public OnboardingApp getOnboardAppExternal(HttpServletRequest request, HttpServletResponse response,
@PathVariable("appId") Long appId) {
@@ -922,7 +926,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Adds a new application to Portal.", response = PortalRestResponse.class)
- @RequestMapping(value = { "/v3/onboardApp" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/v3/onboardApp" }, produces = "application/json")
@ResponseBody
public PortalRestResponse<String> postOnboardAppExternal(HttpServletRequest request, HttpServletResponse response,
@RequestBody OnboardingApp newOnboardApp) {
@@ -946,7 +950,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Updates information about an on-boarded application in Portal.", response = PortalRestResponse.class)
- @RequestMapping(value = { "/v3/onboardApp/{appId}" }, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = { "/v3/onboardApp/{appId}" }, produces = "application/json")
@ResponseBody
public PortalRestResponse<String> putOnboardAppExternal(HttpServletRequest request, HttpServletResponse response,
@PathVariable("appId") Long appId, @RequestBody OnboardingApp oldOnboardApp) {
@@ -968,7 +972,7 @@
}
@ApiOperation(value = "Creates a Portal user notification for roles identified in the content from an external application.", response = PortalAPIResponse.class)
- @RequestMapping(value = { "/v3/publishNotification" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/v3/publishNotification" }, produces = "application/json")
@ResponseBody
public PortalAPIResponse publishNotification(HttpServletRequest request,
@RequestBody EpNotificationItem notificationItem, HttpServletResponse response) {
@@ -989,7 +993,7 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Gets favorite items within the functional menu for the current user.", response = FavoritesFunctionalMenuItemJson.class, responseContainer = "List")
- @RequestMapping(value = { "/v3/getFavorites" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/v3/getFavorites" }, produces = "application/json")
public List<FavoritesFunctionalMenuItemJson> getFavoritesForUser(HttpServletRequest request,
HttpServletResponse response) throws Exception {
List<FavoritesFunctionalMenuItemJson> favorites = null;
@@ -1004,8 +1008,8 @@
@SuppressWarnings("unchecked")
@ApiOperation(value = "Gets functional menu items appropriate for the current user.", response = FunctionalMenuItem.class, responseContainer = "List")
- @RequestMapping(value = {
- "/v3/functionalMenuItemsForUser" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/v3/functionalMenuItemsForUser" }, produces = "application/json")
public List<FunctionalMenuItem> getFunctionalMenuItemsForUser(HttpServletRequest request,
HttpServletResponse response) throws Exception {
List<FunctionalMenuItem> fnMenuItems = null;
@@ -1020,7 +1024,7 @@
@ApiOperation(value = "Gets MechId roles", response = String.class, responseContainer = "List")
- @RequestMapping(value = { "/v3/systemUser" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/v3/systemUser" }, produces = "application/json")
public List<AAFPermission> getSystemUserPerms(HttpServletRequest request, HttpServletResponse response) throws Exception {
List<AAFPermission> permsList = null;
Map<String, Object> res = getMethod(request, response);
@@ -1033,7 +1037,7 @@
}
@ApiOperation(value = "Update role description in external auth system for an application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = { "/v3/update/app/roleDescription" }, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = { "/v3/update/app/roleDescription" }, produces = "application/json")
public PortalRestResponse<String> updateAppRoleDescription(HttpServletRequest request, HttpServletResponse response) throws Exception {
PortalRestResponse<String> result = null;
Map<String, Object> res = getMethod(request, response);
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BEPropertyReaderController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BEPropertyReaderController.java
index 51b1d48..4ebe6b5 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BEPropertyReaderController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BEPropertyReaderController.java
@@ -40,6 +40,7 @@
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@@ -56,7 +57,7 @@
private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(BEPropertyReaderController.class);
- @RequestMapping(value = "/readProperty", method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = "/readProperty", produces = "application/json")
public PortalRestResponse<BEProperty> readProperty(HttpServletRequest request, @RequestParam String key) {
try {
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", new BEProperty(key, SystemProperties.getProperty(key)));
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/FunctionalMenuController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/FunctionalMenuController.java
index 65abc28..dd5f5f4 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/FunctionalMenuController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/FunctionalMenuController.java
@@ -575,14 +575,20 @@
String lastNameStr = null;
String emailStr = null;
String lastLogin = null;
+ boolean isSystemUser = false;
EPUser user = EPUserUtils.getUserSession(request);
firstNameStr = user.getFirstName();
lastNameStr = user.getLastName();
orgUserIdStr = user.getOrgUserId();
+ isSystemUser = user.isSystemUser();
emailStr = user.getEmail();
if (emailStr == null || emailStr.equals("")) {
- EPUser userResult = searchService.searchUserByUserId(orgUserIdStr);
- emailStr = userResult.getEmail();
+ try {
+ EPUser userResult = searchService.searchUserByUserId(orgUserIdStr);
+ emailStr = userResult.getEmail();
+ }catch(Exception ex) {
+ logger.error(EELFLoggerDelegate.errorLogger, "searchUserByUserId call failed", ex);
+ }
}
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss Z a");
Date lastLoginDate = user.getLastLoginDate();
@@ -622,6 +628,7 @@
map.put("userId",
orgUserIdStr != null ? orgUserIdStr : (orgUserIdSC != null ? orgUserIdSC.getCvalue() : null));
map.put("last_login", lastLogin);
+ map.put("isSystemUser", String.valueOf(isSystemUser));
JSONObject j = new JSONObject(map);
fnMenuStaticResponse = j.toString();
// Be chatty in the log
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java
index e2dd658..e308182 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java
@@ -4,17 +4,19 @@
* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
- * Modifications Copyright (c) 2019 Samsung
+ * Modifications Copyright (c) 2019 Samsung
* ===================================================================
- *
+ * Modifications Copyright (c) 2020 IBM
+ * ===================================================================
+ *
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
+ * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
@@ -96,6 +98,8 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
@@ -154,7 +158,7 @@
* @throws Exception
*/
- @RequestMapping(value = { "/portalApi/get_roles/{appId}" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/get_roles/{appId}" })
public void getRoles(HttpServletRequest request, HttpServletResponse response, @PathVariable("appId") Long appId)
throws Exception {
try {
@@ -183,7 +187,7 @@
}
}
- @RequestMapping(value = { "/portalApi/role_list/toggleRole/{appId}/{roleId}" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role_list/toggleRole/{appId}/{roleId}" })
public Map<String, Object> toggleRole(HttpServletRequest request, HttpServletResponse response,
@PathVariable("appId") Long appId, @PathVariable("roleId") Long roleId) throws Exception {
EPApp requestedApp = null;
@@ -227,7 +231,7 @@
return responseMap;
}
- @RequestMapping(value = { "/portalApi/role_list/removeRole/{appId}/{roleId}" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role_list/removeRole/{appId}/{roleId}" })
public Map<String, Object> removeRole(HttpServletRequest request, HttpServletResponse response,
@PathVariable("appId") Long appId, @PathVariable("roleId") Long roleId) throws Exception {
@@ -293,7 +297,7 @@
return responseMap;
}
- @RequestMapping(value = { "/portalApi/role/saveRole/{appId}" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role/saveRole/{appId}" })
public Map<String, Object> saveRole(HttpServletRequest request, HttpServletResponse response,
@PathVariable("appId") Long appId) throws Exception {
EPUser user = EPUserUtils.getUserSession(request);
@@ -415,29 +419,29 @@
return responseMap;
}
- @RequestMapping(value = { "/portalApi/role/removeRoleFunction" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role/removeRoleFunction" })
public ModelAndView removeRoleRoleFunction(HttpServletRequest request, HttpServletResponse response)
throws Exception {
return getRoleController().removeRoleFunction(request, response);
}
- @RequestMapping(value = { "/portalApi/role/addRoleFunction" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role/addRoleFunction" })
public ModelAndView addRoleRoRoleFunction(HttpServletRequest request, HttpServletResponse response)
throws Exception {
return getRoleController().addRoleFunction(request, response);
}
- @RequestMapping(value = { "/portalApi/role/removeChildRole" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role/removeChildRole" })
public ModelAndView removeChildRole(HttpServletRequest request, HttpServletResponse response) throws Exception {
return getRoleController().removeChildRole(request, response);
}
- @RequestMapping(value = { "/portalApi/role/addChildRole" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role/addChildRole" })
public ModelAndView addChildRole(HttpServletRequest request, HttpServletResponse response) throws Exception {
return getRoleController().addChildRole(request, response);
}
- @RequestMapping(value = { "/portalApi/get_role/{appId}/{roleId}" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/get_role/{appId}/{roleId}" })
public void getRole(HttpServletRequest request, HttpServletResponse response, @PathVariable("appId") Long appId,
@PathVariable("roleId") Long roleId) throws Exception {
try {
@@ -471,7 +475,7 @@
}
}
- @RequestMapping(value = { "/portalApi/get_role_functions/{appId}" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/get_role_functions/{appId}" })
public void getRoleFunctionList(HttpServletRequest request, HttpServletResponse response,
@PathVariable("appId") Long appId) throws Exception {
try {
@@ -502,7 +506,7 @@
}
}
- @RequestMapping(value = { "/portalApi/role_function_list/saveRoleFunction/{appId}" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role_function_list/saveRoleFunction/{appId}" })
public PortalRestResponse<String> saveRoleFunction(HttpServletRequest request, HttpServletResponse response, @Valid @RequestBody CentralV2RoleFunction roleFunc,
@PathVariable("appId") Long appId) throws Exception {
if (roleFunc!=null) {
@@ -599,7 +603,7 @@
}
}
- @RequestMapping(value = { "/portalApi/role_function_list/removeRoleFunction/{appId}" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role_function_list/removeRoleFunction/{appId}" })
public PortalRestResponse<String> removeRoleFunction(HttpServletRequest request, HttpServletResponse response,
@RequestBody String roleFunc, @PathVariable("appId") Long appId) throws Exception {
EPUser user = EPUserUtils.getUserSession(request);
@@ -676,7 +680,7 @@
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "Deleted Successfully!", "Success");
}
- @RequestMapping(value = { "/portalApi/centralizedApps" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/centralizedApps" })
public List<CentralizedApp> getCentralizedAppRoles(HttpServletRequest request, HttpServletResponse response, String userId) {
if(userId!=null) {
SecureString secureString = new SecureString(userId);
@@ -719,7 +723,7 @@
this.roleController = roleController;
}
- @RequestMapping(value = { "/portalApi/syncRoles" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/portalApi/syncRoles" }, produces = "application/json")
public PortalRestResponse<String> syncRoles(HttpServletRequest request, HttpServletResponse response,
@RequestBody Long appId) {
EPUser user = EPUserUtils.getUserSession(request);
@@ -741,7 +745,7 @@
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "Sync roles completed successfully!", "Success");
}
- @RequestMapping(value = { "/portalApi/syncFunctions" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/portalApi/syncFunctions" }, produces = "application/json")
public PortalRestResponse<String> syncFunctions(HttpServletRequest request, HttpServletResponse response,
@RequestBody Long appId) {
EPUser user = EPUserUtils.getUserSession(request);
@@ -826,8 +830,8 @@
response.getWriter().write("Unauthorized User");
}
- @RequestMapping(value = {
- "/portalApi/uploadRoleFunction/{appId}" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = {
+ "/portalApi/uploadRoleFunction/{appId}" }, produces = "application/json")
public PortalRestResponse<String> bulkUploadRoleFunc(HttpServletRequest request, HttpServletResponse response,
@RequestBody UploadRoleFunctionExtSystem data, @PathVariable("appId") Long appId) {
EPUser user = EPUserUtils.getUserSession(request);
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RolesApprovalSystemController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RolesApprovalSystemController.java
index 5562caa..487cc4d 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RolesApprovalSystemController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RolesApprovalSystemController.java
@@ -219,9 +219,9 @@
* If any field is missing.
*/
private void validateExtSystemUser(ExternalSystemUser extSysUser, boolean rolesRequired) throws Exception {
- if (extSysUser.getLoginId() == null || extSysUser.getLoginId() == "")
+ if (extSysUser.getLoginId() == null || extSysUser.getLoginId().equals(""))
throw new Exception("Request has no login ID");
- if (extSysUser.getApplicationName() == null || extSysUser.getApplicationName() == "")
+ if (extSysUser.getApplicationName() == null || extSysUser.getApplicationName().equals(""))
throw new Exception("Request has no application name");
if (extSysUser.getMyloginrequestId() == null)
throw new Exception("Request has no request ID");
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerAuxController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerAuxController.java
index c99953f..85c48b7 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerAuxController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerAuxController.java
@@ -37,9 +37,6 @@
*/
package org.onap.portalapp.portal.controller;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserNotificationController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserNotificationController.java
index 0dfccc9..cec01ba 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserNotificationController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserNotificationController.java
@@ -4,13 +4,15 @@
* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modifications Copyright (c) 2020 IBM
+ * ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -50,6 +52,8 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@@ -87,8 +91,8 @@
private static final String SUCCESS = "success";
private static final String FAILURE = "FAILURE";
- @RequestMapping(value = {
- "/portalApi/getFunctionalMenuRole" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/getFunctionalMenuRole" }, produces = "application/json")
public List<FunctionalMenuRole> getMenuIdRoleId(HttpServletRequest request, HttpServletResponse response) {
// EPUser user = EPUserUtils.getUserSession(request);
List<FunctionalMenuRole> menuRoleList = null;
@@ -96,8 +100,8 @@
return menuRoleList;
}
- @RequestMapping(value = {
- "/portalApi/getNotifications" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/getNotifications" }, produces = "application/json")
public PortalRestResponse<List<EpNotificationItem>> getNotifications(HttpServletRequest request,
HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
@@ -114,8 +118,8 @@
return portalRestResponse;
}
- @RequestMapping(value = {
- "/portalApi/getAdminNotifications" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/getAdminNotifications" }, produces = "application/json")
public List<EpNotificationItemVO> getAdminNotifications(HttpServletRequest request, HttpServletResponse response) {
List<EpNotificationItemVO> adminNotificationList = null;
EPUser user = EPUserUtils.getUserSession(request);
@@ -123,7 +127,7 @@
return adminNotificationList;
}
- @RequestMapping(value = "/portalApi/saveNotification", method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = "/portalApi/saveNotification", produces = "application/json")
public PortalRestResponse<String> save(HttpServletRequest request, HttpServletResponse response,
@RequestBody EpNotificationItem notificationItem) {
@@ -160,8 +164,8 @@
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "SUCCESS", "");
}
- @RequestMapping(value = {
- "/portalApi/notificationUpdateRate" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/notificationUpdateRate" }, produces = "application/json")
public PortalRestResponse<Map<String, String>> getNotificationUpdateRate(HttpServletRequest request) {
try {
String updateRate = SystemProperties.getProperty(EPCommonSystemProperties.NOTIFICATION_UPDATE_RATE);
@@ -178,8 +182,8 @@
}
}
- @RequestMapping(value = {
- "/portalApi/notificationRead" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/notificationRead" }, produces = "application/json")
public PortalRestResponse<Map<String, String>> notificationRead(
@RequestParam("notificationId") String notificationID, HttpServletRequest request) {
try {
@@ -191,8 +195,8 @@
}
}
- @RequestMapping(value = {
- "/portalApi/getNotificationHistory" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/getNotificationHistory" }, produces = "application/json")
public List<EpNotificationItemVO> getNotificationHistory(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<EpNotificationItemVO> notificationList = null;
@@ -200,8 +204,7 @@
return notificationList;
}
- @RequestMapping(value = { "/portalApi/notificationRole/{notificationId}/roles" }, method = {
- RequestMethod.GET }, produces = "application/json")
+ @GetMapping(value = { "/portalApi/notificationRole/{notificationId}/roles" }, produces = "application/json")
public List<Integer> testGetRoles(HttpServletRequest request, @PathVariable("notificationId") Long notificationId) {
List<EpRoleNotificationItem> notifRoles = userNotificationService.getNotificationRoles(notificationId);
ArrayList<Integer> rolesList = new ArrayList<>();
@@ -211,8 +214,7 @@
return rolesList;
}
- @RequestMapping(value = { "/portalApi/getNotificationAppRoles" }, method = {
- RequestMethod.GET }, produces = "application/json")
+ @GetMapping(value = { "/portalApi/getNotificationAppRoles" }, produces = "application/json")
public List<EcompAppRole> getNotificationAppRoles(HttpServletRequest request, HttpServletResponse response) {
List<EcompAppRole> epAppRoleList = null;
try {
@@ -225,8 +227,8 @@
return epAppRoleList;
}
- @RequestMapping(value = {
- "/portalApi/getMessageRecipients" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/getMessageRecipients" }, produces = "application/json")
public List<String> getMessageRecipients(@RequestParam("notificationId") Long notificationID) {
// EPUser user = EPUserUtils.getUserSession(request);
List<String> messageUserRecipients = null;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserRolesController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserRolesController.java
index aa180b0..b3d64db 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserRolesController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserRolesController.java
@@ -46,7 +46,6 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.cxf.transport.http.HTTPException;
import org.onap.portalapp.controller.EPRestrictedBaseController;
-import org.onap.portalapp.portal.domain.EPApp;
import org.onap.portalapp.portal.domain.EPRole;
import org.onap.portalapp.portal.domain.EPUser;
import org.onap.portalapp.portal.domain.EPUserAppCatalogRoles;
@@ -59,7 +58,6 @@
import org.onap.portalapp.portal.logging.logic.EPLogUtil;
import org.onap.portalapp.portal.service.AdminRolesService;
import org.onap.portalapp.portal.service.ApplicationsRestClientService;
-import org.onap.portalapp.portal.service.EPAppService;
import org.onap.portalapp.portal.service.SearchService;
import org.onap.portalapp.portal.service.UserRolesService;
import org.onap.portalapp.portal.transport.AppNameIdIsAdmin;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WebAnalyticsExtAppController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WebAnalyticsExtAppController.java
index 92449a3..a8eb1d6 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WebAnalyticsExtAppController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WebAnalyticsExtAppController.java
@@ -4,6 +4,8 @@
* ===================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modifications Copyright (c) 2020 IBM
+ * ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
@@ -77,6 +79,8 @@
import org.springframework.util.concurrent.SuccessCallback;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@@ -117,7 +121,7 @@
* @return String
*/
@ApiOperation(value = "Gets javascript with functions that support gathering and reporting web analytics.", response = String.class)
- @RequestMapping(value = { "/analytics" }, method = RequestMethod.GET, produces = "application/javascript")
+ @GetMapping(value = { "/analytics" }, produces = "application/javascript")
public String getAnalyticsScript(HttpServletRequest request) {
String responseText = "";
EPApp app = null;
@@ -162,7 +166,7 @@
* Analytics
* @return PortalAPIResponse
*/
- @RequestMapping(value = { "/storeAnalytics" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/storeAnalytics" }, produces = "application/json")
@ResponseBody
@ApiOperation(value = "Accepts data from partner applications with web analytics data.", response = PortalAPIResponse.class)
public PortalAPIResponse storeAnalyticsScript(HttpServletRequest request, @RequestBody Analytics analyticsMap) {
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogController.java
index 015e6c4..a403737 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogController.java
@@ -40,7 +40,6 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
-import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java
index 404784f..56f5040 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java
@@ -4,6 +4,8 @@
* ===================================================================
* Copyright © 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modifications Copyright (c) 2020 IBM
+ * ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
@@ -63,6 +65,10 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@@ -86,7 +92,7 @@
this.persUserWidgetService = persUserWidgetService;
}
- @RequestMapping(value = { "/portalApi/widgets" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/widgets" }, produces = "application/json")
public List<OnboardingWidget> getOnboardingWidgets(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<OnboardingWidget> onboardingWidgets = null;
@@ -118,7 +124,7 @@
// Attention: real json has all OnboardingWidget fields except "id", we use OnboardingWidget for not
// to create new class for parsing
- @RequestMapping(value = { "/portalApi/widgets/{widgetId}" }, method = { RequestMethod.PUT },
+ @PutMapping(value = { "/portalApi/widgets/{widgetId}" },
produces = "application/json")
public FieldsValidator putOnboardingWidget(HttpServletRequest request, @PathVariable("widgetId") Long widgetId,
@RequestBody OnboardingWidget onboardingWidget, HttpServletResponse response) {
@@ -147,7 +153,7 @@
// Attention: real json has all OnboardingWidget fields except "id", we use OnboardingWidget for not
// to create new class for parsing
- @RequestMapping(value = { "/portalApi/widgets" }, method = { RequestMethod.POST }, produces = "application/json")
+ @PostMapping(value = { "/portalApi/widgets" }, produces = "application/json")
public FieldsValidator postOnboardingWidget(HttpServletRequest request,
@RequestBody OnboardingWidget onboardingWidget, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
@@ -173,7 +179,7 @@
return fieldsValidator;
}
- @RequestMapping(value = { "/portalApi/widgets/{widgetId}" }, method = { RequestMethod.DELETE },
+ @DeleteMapping(value = { "/portalApi/widgets/{widgetId}" },
produces = "application/json")
public FieldsValidator deleteOnboardingWidget(HttpServletRequest request, @PathVariable("widgetId") Long widgetId,
HttpServletResponse response) {
@@ -199,7 +205,7 @@
* @return FieldsValidator
* @throws IOException
*/
- @RequestMapping(value = { "portalApi/widgetCatalogSelection" }, method = RequestMethod.PUT,
+ @PutMapping(value = { "portalApi/widgetCatalogSelection" },
produces = "application/json")
public FieldsValidator putWidgetCatalogSelection(HttpServletRequest request,
@RequestBody WidgetCatalogPersonalization persRequest, HttpServletResponse response) throws IOException {
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/FunctionalMenuItemWithAppID.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/FunctionalMenuItemWithAppID.java
index 9900827..583b43a 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/FunctionalMenuItemWithAppID.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/FunctionalMenuItemWithAppID.java
@@ -44,7 +44,6 @@
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
-import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/MicroserviceData.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/MicroserviceData.java
index b8f79d0..6db834e 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/MicroserviceData.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/MicroserviceData.java
@@ -39,11 +39,6 @@
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-
import javax.validation.Valid;
import org.hibernate.validator.constraints.SafeHtml;
import org.onap.portalsdk.core.domain.support.DomainVo;
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/FunctionalMenuControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/FunctionalMenuControllerTest.java
index bee5d93..80099d5 100644
--- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/FunctionalMenuControllerTest.java
+++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/FunctionalMenuControllerTest.java
@@ -292,7 +292,7 @@
@Test
public void getFunctionalMenuStaticInfoTest(){
String fnMenuStaticactualResponse = null;
- String fnMenuStaticexpectedResponse = "{\"firstName\":\"test\",\"lastName\":\"test\",\"last_login\":\"09/08/2017 03:48:13 -0400 am\",\"userId\":\"guestT\",\"email\":\"test\"}";
+ String fnMenuStaticexpectedResponse = "{\"firstName\":\"test\",\"lastName\":\"test\",\"last_login\":\"09/08/2017 03:48:13 -0400 am\",\"userId\":\"guestT\",\"isSystemUser\":\"false\",\"email\":\"test\"}";
String orgUserIdStr = null;
EPUser user = mockUser.mockEPUser();
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPServiceCookieTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPServiceCookieTest.java
new file mode 100644
index 0000000..27118a4
--- /dev/null
+++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPServiceCookieTest.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2020 IBM Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
+
+public class EPServiceCookieTest {
+ EPServiceCookie ep=new EPServiceCookie();
+
+ @Test
+ public void testGetValue() throws NullPointerException{
+ Map<String, String> mymap = new HashMap<>();
+ mymap.put("1", "one");
+ ep.setValue(mymap);
+ assertNotNull(ep.getValue());
+ assertTrue(ep.getValue().equals(mymap));
+ }
+
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/DuplicateRecordExceptionTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/DuplicateRecordExceptionTest.java
new file mode 100644
index 0000000..9154e8d
--- /dev/null
+++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/DuplicateRecordExceptionTest.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2020 IBM Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+package org.onap.portalapp.portal.exceptions;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class DuplicateRecordExceptionTest {
+ @Test
+ public void Test1()
+ {
+ String s1 = "Duplicate Record";
+ DuplicateRecordException mde=new DuplicateRecordException(s1);
+ assertEquals(mde.getMessage(),"Duplicate Record");
+
+ }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/NonCentralizedAppExceptionTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/NonCentralizedAppExceptionTest.java
index 7109b2d..d295843 100644
--- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/NonCentralizedAppExceptionTest.java
+++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/NonCentralizedAppExceptionTest.java
@@ -39,11 +39,14 @@
import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+
public class NonCentralizedAppExceptionTest {
@Test
public void TestException2() {
String s1 = "Value1";
NonCentralizedAppException nca = new NonCentralizedAppException(s1);
+ assertEquals(nca.toString(),"Value1 is not Centralized Application");
}
}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/NotValidDataExceptionTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/NotValidDataExceptionTest.java
new file mode 100644
index 0000000..889b28f
--- /dev/null
+++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/NotValidDataExceptionTest.java
@@ -0,0 +1,51 @@
+/*-
+ * ============LICENSE_START============================================
+ * ONAP Portal
+ * =====================================================================
+ * Copyright (C) 2020 IBM Intellectual Property. All rights reserved.
+ * =====================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END================================================
+ *
+ *
+ */
+package org.onap.portalapp.portal.exceptions;
+
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+
+public class NotValidDataExceptionTest {
+
+ @Test
+ public void TestException2() {
+ String s1 = "data";
+ NotValidDataException nca = new NotValidDataException(s1);
+ assertEquals(nca.toString(),"NotValidDataException{}: data");
+ }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/RoleFunctionExceptionTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/RoleFunctionExceptionTest.java
new file mode 100644
index 0000000..db17e78
--- /dev/null
+++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/RoleFunctionExceptionTest.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START============================================
+ * ONAP Portal
+ * =====================================================================
+ * Copyright (C) 2020 IBM Intellectual Property. All rights reserved.
+ * =====================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END================================================
+ *
+ *
+ */
+
+package org.onap.portalapp.portal.exceptions;
+
+import org.apache.commons.codec.DecoderException;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+
+public class RoleFunctionExceptionTest {
+
+ @Test
+ public void TestRoleFunctionConstructor()
+ {
+ String s1 = "Rolefunction Exception Occured";
+ String s2 = "value2";
+ DecoderException e=new DecoderException(s2);
+ RoleFunctionException rfe=new RoleFunctionException(s1,e);
+ assertEquals(rfe.getMessage(),"Rolefunction Exception Occured");
+ }
+}
diff --git a/portal-FE-common/src/app/layout/components/header/header.component.html b/portal-FE-common/src/app/layout/components/header/header.component.html
index f3b3a5f..97f4a26 100644
--- a/portal-FE-common/src/app/layout/components/header/header.component.html
+++ b/portal-FE-common/src/app/layout/components/header/header.component.html
@@ -76,7 +76,7 @@
<li class="dropdown-item" style="font-weight: lighter">
{{firstName}}, {{lastName}}
</li>
-<li class="dropdown-item">
+<li class="dropdown-item" *ngIf=(!isSystemUser)>
<span class="dropdown-item-name"> {{ 'Email'}}: </span>
<div>
<span class="dropdown-item-value">
@@ -85,7 +85,8 @@
</div>
</li>
<li class="dropdown-item">
- <span class="dropdown-item-name"> {{ 'User Id' }}: </span>
+ <span class="dropdown-item-name" *ngIf=(!isSystemUser)> {{ 'User Id' }}: </span>
+ <span class="dropdown-item-name" *ngIf=(isSystemUser)> {{ 'System Id' }}: </span>
<div>
<span class="dropdown-item-value">
{{loginSnippetUserid}}
diff --git a/portal-FE-common/src/app/layout/components/header/header.component.ts b/portal-FE-common/src/app/layout/components/header/header.component.ts
index 09dd4c1..429587d 100644
--- a/portal-FE-common/src/app/layout/components/header/header.component.ts
+++ b/portal-FE-common/src/app/layout/components/header/header.component.ts
@@ -59,6 +59,7 @@
api = environment.api;
brandName: string;
brandLogoImagePath: string;
+ isSystemUser: boolean = false;
constructor(public router: Router, private userProfileService: UserProfileService, private menusService: MenusService, private cookieService: CookieService) {
@@ -90,7 +91,7 @@
getUserInformation() {
this.userProfileService.getFunctionalMenuStaticInfo().toPromise().then((res: any) => {
- if (res == null || res.firstName == null || res.firstName == '' || res.lastName == null || res.lastName == '') {
+ if (res === null || res.firstName === null || res.firstName === '' || res.lastName === null || res.lastName === '') {
// $log.info('HeaderCtrl: failed to get all required data, trying user profile');
this.userProfileService.getUserProfile().toPromise().then((profile: any) => {
this.firstName = profile.firstName;
@@ -105,6 +106,9 @@
this.loginSnippetUserid = res.userId;
this.lastLogin = Date.parse(res.last_login);
}
+ if(res != null && res.isSystemUser === 'true'){
+ this.isSystemUser = true;
+ }
sessionStorage.userId = res.userId;
this.menusService.getFunctionalMenuForUser().toPromise().then((jsonHeaderMenu: any) => {
// $scope.menuItems = unflatten(jsonHeaderMenu);
diff --git a/portal-FE-os/src/app/app.component.html b/portal-FE-os/src/app/app.component.html
index dea5177..2c914c5 100644
--- a/portal-FE-os/src/app/app.component.html
+++ b/portal-FE-os/src/app/app.component.html
@@ -35,5 +35,7 @@
-->
-
+<div class="diaplay-banner" *ngIf="diaplayBanner">
+ <span>{{browserCompatibilityMsg}}</span>
+</div>
<router-outlet></router-outlet>
diff --git a/portal-FE-os/src/app/app.component.scss b/portal-FE-os/src/app/app.component.scss
index 7a77339..e739496 100644
--- a/portal-FE-os/src/app/app.component.scss
+++ b/portal-FE-os/src/app/app.component.scss
@@ -34,4 +34,14 @@
* ============LICENSE_END============================================
*
*
- */
\ No newline at end of file
+ */
+
+ .diaplay-banner{
+ margin-top: 14px;
+ background-color: yellow;
+ font-weight: bold;
+ position: fixed;
+ z-index: 9999;
+ margin-left: 34em;
+ height: 24px;
+}
\ No newline at end of file
diff --git a/portal-FE-os/src/app/app.component.ts b/portal-FE-os/src/app/app.component.ts
index dbfb568..389153b 100644
--- a/portal-FE-os/src/app/app.component.ts
+++ b/portal-FE-os/src/app/app.component.ts
@@ -35,13 +35,49 @@
*
*
*/
-import { Component } from '@angular/core';
+import { Component, OnInit } from '@angular/core';
+import { environment } from 'src/environments/environment';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
-export class AppComponent {
-
-}
+export class AppComponent implements OnInit {
+ diaplayBanner : boolean = false;
+ api = environment.api;
+ browserCompatibilityMsg: string;
+
+ ngOnInit() {
+ this.diaplayBanner = false;
+ this.browserCompatibilityMsg = this.api.browserCompatibilityMsg;
+ this.getBrowserName();
+ }
+
+ /**
+ * Identify Browser
+ */
+ getBrowserName() {
+ const agent = window.navigator.userAgent.toLowerCase();
+ switch (true) {
+ case agent.indexOf('edge') > -1:
+ return 'edge';
+ case agent.indexOf('opr') > -1 && !!(<any>window).opr:
+ this.diaplayBanner = true;
+ return 'opera';
+ case agent.indexOf('chrome') > -1 && !!(<any>window).chrome:
+ return 'chrome';
+ case agent.indexOf('trident') > -1:
+ this.diaplayBanner = true;
+ return 'ie';
+ case agent.indexOf('firefox') > -1:
+ return 'firefox';
+ case agent.indexOf('safari') > -1:
+ this.diaplayBanner = true;
+ return 'safari';
+ default:
+ this.diaplayBanner = true;
+ return 'other';
+ }
+ }
+}
\ No newline at end of file
diff --git a/portal-FE-os/src/environments/environment.prod.ts b/portal-FE-os/src/environments/environment.prod.ts
index db6b5bf..7cc34da 100644
--- a/portal-FE-os/src/environments/environment.prod.ts
+++ b/portal-FE-os/src/environments/environment.prod.ts
@@ -125,7 +125,8 @@
"footerLogoImagePath": "",
"footerLogoText": "",
"intraSearcLink": "",
- "extraSearcLink": "https://wiki.onap.org/dosearchsite.action?cql=siteSearch+~+searchStringPlaceHolder&queryString=searchStringPlaceHolder"
+ "extraSearcLink": "https://wiki.onap.org/dosearchsite.action?cql=siteSearch+~+searchStringPlaceHolder&queryString=searchStringPlaceHolder",
+ "browserCompatibilityMsg": "This Application is best viewed on Firefox, Chrome and Edge."
},
"getAccessUrl": "",
"getAccessName":"",
diff --git a/portal-FE-os/src/environments/environment.ts b/portal-FE-os/src/environments/environment.ts
index 0482c20..d412522 100644
--- a/portal-FE-os/src/environments/environment.ts
+++ b/portal-FE-os/src/environments/environment.ts
@@ -129,7 +129,8 @@
"footerLogoImagePath": "",
"footerLogoText": "",
"intraSearcLink": "",
- "extraSearcLink": "https://wiki.onap.org/dosearchsite.action?cql=siteSearch+~+searchStringPlaceHolder&queryString=searchStringPlaceHolder"
+ "extraSearcLink": "https://wiki.onap.org/dosearchsite.action?cql=siteSearch+~+searchStringPlaceHolder&queryString=searchStringPlaceHolder",
+ "browserCompatibilityMsg": "This Application is best viewed on Firefox, Chrome and Edge."
},
"getAccessUrl": "",
"getAccessName": "",
diff --git a/portal-FE-os/src/favicon.ico b/portal-FE-os/src/favicon.ico
index d2c5e0f..cb712eb 100644
--- a/portal-FE-os/src/favicon.ico
+++ b/portal-FE-os/src/favicon.ico
Binary files differ