Merge "Fixed userbar issue on home page"
authorSunder Tattavarada <statta@research.att.com>
Wed, 20 May 2020 14:14:12 +0000 (14:14 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 20 May 2020 14:14:12 +0000 (14:14 +0000)
57 files changed:
3.2.1-container-portal-docker.yaml [new file with mode: 0644]
deliveries/build_portalapps_dockers.sh
ecomp-portal-BE-common/pom.xml
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/sessionmgt/SessionCommunicationController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppCatalogController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppContactUsController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequest.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuditLogController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuxApiRequestMapperController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BEPropertyReaderController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BasicAuthAccountController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/CommonWidgetController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/DashboardController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/EncryptAdminController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAccessRolesController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/FunctionalMenuController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/GetAccessController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/HealthCheckController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ManifestController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceProxyController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/SharedContext.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptor.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInterface.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxUtil.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppsCacheServiceImple.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthenticationCredentialServiceImpl.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageService.java
ecomp-portal-BE-os/pom.xml
ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/system.properties
ecomp-portal-widget-ms/widget-ms/pom.xml
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/WidgetsCatalogController.java
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/hibernate/HibernateConfiguration.java
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/MicroserviceServiceImpl.java
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java
ecomp-portal-widget-ms/widget-ms/src/main/resources/application.properties
ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImplTest.java
ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java
pom.xml
portal-FE-common/src/app/shared/services/users/users.service.ts
portal-FE-os/src/app/.gitignore
portal-FE-os/src/app/layout/components/search-users/search-users.component.html [moved from portal-FE-common/src/app/layout/components/search-users/search-users.component.html with 94% similarity]
portal-FE-os/src/app/layout/components/search-users/search-users.component.scss [moved from portal-FE-common/src/app/layout/components/search-users/search-users.component.scss with 100% similarity]
portal-FE-os/src/app/layout/components/search-users/search-users.component.spec.ts [moved from portal-FE-common/src/app/layout/components/search-users/search-users.component.spec.ts with 100% similarity]
portal-FE-os/src/app/layout/components/search-users/search-users.component.ts [moved from portal-FE-common/src/app/layout/components/search-users/search-users.component.ts with 91% similarity]
portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.html
portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.ts
portal-FE-os/src/favicon.ico

diff --git a/3.2.1-container-portal-docker.yaml b/3.2.1-container-portal-docker.yaml
new file mode 100644 (file)
index 0000000..8872a0a
--- /dev/null
@@ -0,0 +1,7 @@
+distribution_type: container
+container_release_tag: 3.2.1
+project: portal
+ref: b310e558488c48cadc251a3d87b1f10f044c2499
+containers:
+    - name: portal-app
+      version: 3.2.0-STAGING-latest
index fdaf9a1..d2349b8 100755 (executable)
@@ -76,7 +76,7 @@ else
         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."
index 19d3243..82e9827 100644 (file)
                <dependency>
                        <groupId>org.apache.cxf</groupId>
                        <artifactId>cxf-rt-rs-client</artifactId>
-                       <version>3.3.3</version>
+                       <version>3.3.4</version>
                </dependency>
                <!-- Mapper -->
                <dependency>
index 33006c9..1553991 100644 (file)
@@ -51,7 +51,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.RequestMapping;
-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;
index 6ff16fc..714d3ab 100644 (file)
@@ -59,8 +59,6 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.RequestBody;
-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;
index e9119de..0bf75fb 100644 (file)
@@ -61,7 +61,6 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
 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.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
index 28ec0e1..ce29900 100644 (file)
@@ -68,7 +68,6 @@ 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;
 
index ae64be1..dc5127c 100644 (file)
@@ -49,7 +49,6 @@ 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;
 
index ab13095..2f4f788 100644 (file)
@@ -358,7 +358,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B
        }
 
        @ApiOperation(value = "Extends session timeout values for all on-boarded applications.", response = Boolean.class)
-       @RequestMapping(value = { "/v3/extendSessionTimeOuts" }, method = RequestMethod.POST)
+       @PostMapping(value = { "/v3/extendSessionTimeOuts" })
        public Boolean extendSessionTimeOuts(HttpServletRequest request, HttpServletResponse response,
                        @RequestParam String sessionMap) throws Exception {
 
@@ -865,7 +865,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B
 
        @SuppressWarnings("unchecked")
        @ApiOperation(value = "Accepts messages from external ticketing systems and creates notifications for Portal users.", response = PortalRestResponse.class)
-       @RequestMapping(value = { "/v3/ticketevent" }, method = RequestMethod.POST)
+       @PostMapping(value = { "/v3/ticketevent" })
        public PortalRestResponse<String> handleRequest(HttpServletRequest request, HttpServletResponse response,
                        @RequestBody String ticketEventJson) throws Exception {
 
index 4ebe6b5..6016496 100644 (file)
@@ -41,7 +41,6 @@ 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;
 import org.onap.portalapp.portal.domain.BEProperty;
index ab040bb..24c08f3 100644 (file)
@@ -59,12 +59,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 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;
 
 @RestController
index 417a294..66b9df2 100644 (file)
@@ -47,9 +47,7 @@ import org.onap.portalapp.portal.service.DashboardSearchService;
 import org.onap.portalapp.portal.transport.CommonWidgetMeta;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 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;
 
index 17a2847..ff89bb8 100644 (file)
@@ -80,9 +80,6 @@ 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.RestController;
 
index 2a1b9e8..6ad88ae 100644 (file)
@@ -70,9 +70,6 @@ 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.RestController;
 
index 258a7fd..c57dc4f 100644 (file)
@@ -59,6 +59,7 @@ import org.onap.portalsdk.core.service.DataAccessService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -75,7 +76,7 @@ public class EncryptAdminController implements BasicAuthenticationController {
 
        EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EncryptAdminController.class);
 
-       @RequestMapping(value = { "/executeEncryptQuery" }, method = RequestMethod.POST)
+       @PostMapping(value = { "/executeEncryptQuery" })
        public Map<Long, String> executeEncrypt(HttpServletRequest request, HttpServletResponse response)
                        throws CipherUtilException {
 
index 103e338..83b5155 100644 (file)
@@ -94,9 +94,7 @@ 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;
 
 import com.fasterxml.jackson.databind.DeserializationFeature;
index bc2c19b..d43d9f3 100644 (file)
@@ -86,9 +86,6 @@ 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.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 
index dd5f5f4..3442d5a 100644 (file)
@@ -83,12 +83,10 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 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.RestController;
 
index d8bf7dd..19441ac 100644 (file)
@@ -47,6 +47,7 @@ import javax.servlet.http.HttpServletRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 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.RestController;
 import org.onap.portalapp.controller.EPUnRestrictedBaseController;
@@ -78,7 +79,7 @@ public class GetAccessController extends EPUnRestrictedBaseController {
                }
        };
        
-       @RequestMapping(value = { "/portalApi/getAppList" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/portalApi/getAppList" }, produces = "application/json")
        public List<GetAccessResult> getAppList(HttpServletRequest request) throws IOException {
                List<GetAccessResult> appsList = null;
                EPUser user = EPUserUtils.getUserSession(request);
index ca66809..d78d614 100644 (file)
@@ -4,6 +4,8 @@
  * ===================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ===================================================================
+ *  Modification Copyright Â© 2020 IBM.
+ * ===================================================================
  *
  * Unless otherwise specified, all software contained herein is licensed
  * under the Apache License, Version 2.0 (the "License");
@@ -46,6 +48,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.slf4j.MDC;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 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.RestController;
 import org.onap.music.main.MusicUtil;
@@ -118,7 +121,7 @@ public class HealthCheckController extends EPUnRestrictedBaseController {
        private final String statusDown = "DOWN";
        private final String statusOk = "OK";
 
-       @RequestMapping(value = { "/portalApi/healthCheck" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/portalApi/healthCheck" }, produces = "application/json")
        public HealthStatus healthCheck(HttpServletRequest request, HttpServletResponse response) {
                HealthStatus healthStatus = new HealthStatus(500, "");
 
@@ -229,8 +232,8 @@ public class HealthCheckController extends EPUnRestrictedBaseController {
                return healthStatus;
        }
 
-       @RequestMapping(value = {
-                       "/portalApi/healthCheckSuspend" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = {
+                       "/portalApi/healthCheckSuspend" }, produces = "application/json")
        public HealthStatus healthCheckSuspend(HttpServletRequest request, HttpServletResponse response) {
                HealthStatus healthStatus = new HealthStatus(500, "Suspended for manual failover mechanism");
 
@@ -243,8 +246,8 @@ public class HealthCheckController extends EPUnRestrictedBaseController {
                return healthStatus;
        }
 
-       @RequestMapping(value = {
-                       "/portalApi/healthCheckResume" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = {
+                       "/portalApi/healthCheckResume" }, produces = "application/json")
        public HealthStatus healthCheckResume(HttpServletRequest request, HttpServletResponse response) {
                HealthStatus healthStatus = new HealthStatus(500, "Resumed from manual failover mechanism");
 
@@ -255,7 +258,7 @@ public class HealthCheckController extends EPUnRestrictedBaseController {
                return healthStatus;
        }
 
-       @RequestMapping(value = { "/portalApi/ping" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/portalApi/ping" }, produces = "application/json")
        public HealthStatus ping(HttpServletRequest request, HttpServletResponse response) {
                HealthStatus healthStatus = new HealthStatus(200, "OK");
                EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/ping", "GET result =", response.getStatus());
index 508b1be..d371dd5 100644 (file)
@@ -1,6 +1,8 @@
 /**
  * Copyright (C) 2019 CMCC, Inc. and others. All rights reserved.
  *
+ *  Modification Copyright Â© 2020 IBM.
+ * ===================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -22,6 +24,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 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.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 import com.alibaba.fastjson.JSONObject;
@@ -33,19 +37,19 @@ public class LanguageController {
     @Autowired
     private LanguageService languageService;
 
-    @RequestMapping(value = "/language",method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
+    @GetMapping(value = "/language", produces = "application/json;charset=UTF-8")
     public JSONObject getLanguageList() {
         return languageService.getLanguages();
     }
 
-    @RequestMapping(value = "/languageSetting/user/{loginId}",method = RequestMethod.POST)
+    @PostMapping(value = "/languageSetting/user/{loginId}")
     public void setUpUserLanguage(@RequestBody JSONObject jsonLanguageId,
                                   @PathVariable("loginId") String loginId) throws Exception {
         Integer languageId = jsonLanguageId.getInteger("languageId");
         languageService.setUpUserLanguage(languageId,loginId);
     }
 
-    @RequestMapping(value = "/languageSetting/user/{loginId}",method = RequestMethod.GET)
+    @GetMapping(value = "/languageSetting/user/{loginId}")
     public JSONObject getUserLanguage(HttpServletRequest request, HttpServletResponse response,
                                       @PathVariable("loginId") String loginId) {
         return languageService.getUserLanguage(loginId);
index 471ebe5..747b3da 100644 (file)
@@ -47,6 +47,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 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.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
@@ -91,7 +92,7 @@ public class ManifestController extends RestrictedBaseController {
         * { "error": "message" }
         *         </pre>
         */
-       @RequestMapping(value = { "/portalApi/manifest" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/portalApi/manifest" }, produces = "application/json")
        @ResponseBody
        public Map<String, Object> getManifest(HttpServletRequest request) {
                Map<String, Object> response = new HashMap<String, Object>();
index 89e8fe7..6bb5b69 100644 (file)
@@ -4,6 +4,8 @@
  * ===================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ===================================================================
+ *  Modification Copyright Â© 2020 IBM.
+ * ===================================================================
  *
  * Unless otherwise specified, all software contained herein is licensed
  * under the Apache License, Version 2.0 (the "License");
@@ -64,6 +66,10 @@ import org.springframework.http.ResponseEntity;
 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;
 import org.springframework.web.client.RestTemplate;
@@ -85,7 +91,7 @@ public class MicroserviceController extends EPRestrictedBaseController {
        @Autowired
        private MicroserviceService microserviceService;
 
-       @RequestMapping(value = { "/portalApi/microservices" }, method = RequestMethod.POST)
+       @PostMapping(value = { "/portalApi/microservices" })
        public PortalRestResponse<String> createMicroservice(HttpServletRequest request, HttpServletResponse response,
                        @Valid @RequestBody MicroserviceData newServiceData) throws Exception {
                if (newServiceData == null) {
@@ -108,13 +114,13 @@ public class MicroserviceController extends EPRestrictedBaseController {
                return new PortalRestResponse<>(PortalRestStatusEnum.OK, "SUCCESS", "");
        }
 
-       @RequestMapping(value = { "/portalApi/microservices" }, method = RequestMethod.GET)
+       @GetMapping(value = { "/portalApi/microservices" })
        public List<MicroserviceData> getMicroservice(HttpServletRequest request, HttpServletResponse response)
                        throws Exception {
                return microserviceService.getMicroserviceData();
        }
 
-       @RequestMapping(value = { "/portalApi/microservices/{serviceId}" }, method = RequestMethod.PUT)
+       @PutMapping(value = { "/portalApi/microservices/{serviceId}" })
        public PortalRestResponse<String> updateMicroservice(HttpServletRequest request, HttpServletResponse response,
                        @PathVariable("serviceId") long serviceId, @Valid @RequestBody MicroserviceData newServiceData) {
 
@@ -135,7 +141,7 @@ public class MicroserviceController extends EPRestrictedBaseController {
                return new PortalRestResponse<>(PortalRestStatusEnum.OK, "SUCCESS", "");
        }
        
-       @RequestMapping(value = { "/portalApi/microservices/{serviceId}" }, method = RequestMethod.DELETE)
+       @DeleteMapping(value = { "/portalApi/microservices/{serviceId}" })
        public PortalRestResponse<String> deleteMicroservice(HttpServletRequest request, HttpServletResponse response,
                        @PathVariable("serviceId") long serviceId) {
                try {
index fed3b98..134d99e 100644 (file)
@@ -4,6 +4,8 @@
  * ===================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ===================================================================
+ *  Modification Copyright Â© 2020 IBM.
+ * ===================================================================
  *
  * Unless otherwise specified, all software contained herein is licensed
  * under the Apache License, Version 2.0 (the "License");
@@ -52,6 +54,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.PathVariable;
 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.RestController;
 import org.springframework.web.client.HttpClientErrorException;
@@ -69,8 +72,7 @@ public class MicroserviceProxyController extends EPUnRestrictedBaseController {
        @Autowired
        private MicroserviceProxyService microserviceProxyService;
 
-       @RequestMapping(value = { "/portalApi/microservice/proxy/{serviceId}" }, method = {
-                       RequestMethod.GET }, produces = "application/json")
+       @GetMapping(value = { "/portalApi/microservice/proxy/{serviceId}" }, produces = "application/json")
        public String getMicroserviceProxy(HttpServletRequest request, HttpServletResponse response,
                        @PathVariable("serviceId") long serviceId) throws Exception {
                EPUser user = EPUserUtils.getUserSession(request);
@@ -83,8 +85,7 @@ public class MicroserviceProxyController extends EPUnRestrictedBaseController {
                return isValidJSON(answer) ? answer : "{\"error\":\"" + answer.replace(System.getProperty("line.separator"), "") + "\"}";
        }
 
-       @RequestMapping(value = { "/portalApi/microservice/proxy/parameter/{widgetId}" }, method = {
-                       RequestMethod.GET }, produces = "application/json")
+       @GetMapping(value = { "/portalApi/microservice/proxy/parameter/{widgetId}" }, produces = "application/json")
        public String getMicroserviceProxyByWidgetId(HttpServletRequest request, HttpServletResponse response,
                        @PathVariable("widgetId") long widgetId) throws Exception {
                EPUser user = EPUserUtils.getUserSession(request);
index 32b28c7..563a387 100644 (file)
@@ -4,6 +4,8 @@
  * ===================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ===================================================================
+ *  Modification Copyright Â© 2020 IBM.
+ * ===================================================================
  *
  * Unless otherwise specified, all software contained herein is licensed
  * under the Apache License, Version 2.0 (the "License");
@@ -69,6 +71,10 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
 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;
 
@@ -92,7 +98,7 @@ public class PortalAdminController extends EPRestrictedBaseController {
                this.auditService = auditService;
        }
 
-       @RequestMapping(value = { "/portalApi/portalAdmins" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/portalApi/portalAdmins" }, produces = "application/json")
        public List<PortalAdmin> getPortalAdmins(HttpServletRequest request, HttpServletResponse response) {
                EPUser user = EPUserUtils.getUserSession(request);
                List<PortalAdmin> portalAdmins = null;
@@ -120,7 +126,7 @@ public class PortalAdminController extends EPRestrictedBaseController {
         * @param response 
         * @return FieldsValidator 
         */
-       @RequestMapping(value = { "/portalApi/portalAdmin" }, method = RequestMethod.POST)
+       @PostMapping(value = { "/portalApi/portalAdmin" })
        public FieldsValidator createPortalAdmin(HttpServletRequest request, @RequestBody String userId,
                        HttpServletResponse response) {
                EPUser user = EPUserUtils.getUserSession(request);
@@ -167,7 +173,7 @@ public class PortalAdminController extends EPRestrictedBaseController {
                return fieldsValidator;
        }
 
-       @RequestMapping(value = { "/portalApi/portalAdmin/{userInfo}" }, method = RequestMethod.DELETE)
+       @DeleteMapping(value = { "/portalApi/portalAdmin/{userInfo}" })
        public FieldsValidator deletePortalAdmin(HttpServletRequest request, @PathVariable("userInfo") String userInfo,
                        HttpServletResponse response) {
 
@@ -225,8 +231,8 @@ public class PortalAdminController extends EPRestrictedBaseController {
                return fieldsValidator;
        }
 
-       @RequestMapping(value = {
-                       "/portalApi/adminAppsRoles/{appId}" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = {
+                       "/portalApi/adminAppsRoles/{appId}" }, produces = "application/json")
        public List<EPRole> getRolesByApp(HttpServletRequest request, @PathVariable("appId") Long appId,
                        HttpServletResponse response) {
                EPUser user = EPUserUtils.getUserSession(request);
index 421a2fb..14837db 100644 (file)
@@ -43,7 +43,6 @@ import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
-import javax.persistence.SequenceGenerator;
 import javax.persistence.Table;
 
 import javax.validation.constraints.Digits;
index 3209f35..78b4047 100644 (file)
  */
 package org.onap.portalapp.portal.interceptor;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
 import java.util.HashMap;
 import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.mockito.internal.stubbing.answers.ThrowsException;
 import org.onap.aaf.cadi.CadiWrap;
 import org.onap.portalapp.controller.sessionmgt.SessionCommunicationController;
 import org.onap.portalapp.portal.controller.BasicAuthenticationController;
@@ -60,7 +53,6 @@ import org.onap.portalapp.portal.controller.SharedContextRestController;
 import org.onap.portalapp.portal.controller.WebAnalyticsExtAppController;
 import org.onap.portalapp.portal.domain.BasicAuthCredentials;
 import org.onap.portalapp.portal.domain.EPApp;
-import org.onap.portalapp.portal.domain.EPEndpoint;
 import org.onap.portalapp.portal.domain.EPUser;
 import org.onap.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
 import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
@@ -68,7 +60,6 @@ import org.onap.portalapp.portal.logging.logic.EPLogUtil;
 import org.onap.portalapp.portal.service.AdminRolesService;
 import org.onap.portalapp.portal.service.AppsCacheService;
 import org.onap.portalapp.portal.service.BasicAuthenticationCredentialService;
-import org.onap.portalapp.portal.service.ExternalAccessRolesService;
 import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
 import org.onap.portalapp.portal.utils.EcompPortalUtils;
 import org.onap.portalapp.service.RemoteWebServiceCallService;
index 93310a9..6a581c1 100644 (file)
@@ -41,7 +41,6 @@ import java.util.Collections;
 import java.util.Date;
 
 import javax.security.auth.login.CredentialException;
-import javax.ws.rs.client.Entity;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedHashMap;
 
index 3a70da8..94498f6 100644 (file)
@@ -54,7 +54,6 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalapp.portal.service.AppsCacheService;
 import org.onap.portalapp.portal.service.AppsCacheServiceImple;
 import org.onap.portalapp.portal.transport.OnboardingApp;
-import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
 
 @Service("appsCacheService")
 @org.springframework.context.annotation.Configuration
index da09c17..618e9ba 100644 (file)
@@ -50,7 +50,6 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalsdk.core.onboarding.exception.CipherUtilException;
 import org.onap.portalsdk.core.onboarding.util.CipherUtil;
 import org.onap.portalsdk.core.service.DataAccessService;
-import org.onap.portalsdk.core.util.SystemProperties;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.stereotype.Service;
index 570d1e9..ee39dd4 100644 (file)
@@ -16,9 +16,6 @@
 package org.onap.portalapp.portal.service;
 
 import com.alibaba.fastjson.JSONObject;
-import org.onap.portalapp.portal.domain.Language;
-
-import java.util.List;
 
 public interface LanguageService {
 
index 4ad50df..398520c 100644 (file)
                        <artifactId>tiles-jsp</artifactId>
                        <version>3.0.5</version>
                </dependency>
-               <dependency>
-                       <groupId>org.apache.cxf</groupId>
-                       <artifactId>cxf-rt-rs-client</artifactId>
-                       <version>3.0.0-milestone1</version>
-               </dependency>
                <!-- Mapper -->
                <dependency>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <version>1.8.5</version>
                        <scope>test</scope>
                </dependency>
-               <dependency>
-                       <groupId>commons-beanutils</groupId>
-                       <artifactId>commons-beanutils</artifactId>
-                       <version>1.9.3</version>
-               </dependency>
                <!-- OpenID Connect Dependencies -->
                <dependency>
                        <groupId>org.mitre</groupId>
index 041458d..3ca32b8 100644 (file)
@@ -151,7 +151,7 @@ ext_central_access_url = https://aaftest.test.onap.org:8095/proxy/authz/
 ext_central_access_user_domain = @csp.onap.org
 
 # External Central Auth system access
-remote_centralized_system_access = false
+remote_centralized_system_access = true
 
 #left menu with root value or non-root
 portal_left_menu = non-root
\ No newline at end of file
index 4095388..f427506 100644 (file)
@@ -7,7 +7,7 @@
        <parent>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-parent</artifactId>
-               <version>1.5.11.RELEASE</version>
+               <version>2.2.5.RELEASE</version>
                <relativePath /> <!-- lookup parent from repository -->
        </parent>
 
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
                <java.version>1.8</java.version>
-               <hibernate.version>4.3.11.Final</hibernate.version>
+               <hibernate.version>5.4.14.Final</hibernate.version>
                <skipTests>false</skipTests>
                <!-- Replicate this from OParent -->
-               <jacocoVersion>0.7.6.201602180812</jacocoVersion>
+               <jacocoVersion>0.8.2</jacocoVersion>
        </properties>
 
        <dependencies>
@@ -68,7 +68,7 @@
                <dependency>
                        <groupId>org.hibernate</groupId>
                        <artifactId>hibernate-core</artifactId>
-                       <!-- <version>${hibernate.version}</version> -->
+                       <version>${hibernate.version}</version>
                </dependency>
                <dependency>
                        <groupId>org.springframework.boot</groupId>
@@ -96,7 +96,7 @@
                <dependency>
                        <groupId>com.github.ulisesbocchio</groupId>
                        <artifactId>jasypt-spring-boot-starter</artifactId>
-                       <version>1.9</version>
+                       <version>2.1.0</version>
                </dependency>
                <dependency>
                        <groupId>org.jsoup</groupId>
                <dependency>
                        <groupId>dom4j</groupId>
                        <artifactId>dom4j</artifactId>
-                       <!-- <version>1.6.1</version> -->
+                       <version>1.6.1</version>
                        <exclusions>
                                <exclusion>
                                        <groupId>jaxme</groupId>
                <dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-core</artifactId>
-               <version>8.5.28</version>
+               <version>9.0.33</version>
                </dependency>
                <dependency>
                        <groupId>ch.qos.logback</groupId>
                <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-web</artifactId>
-               <version>4.2.13.RELEASE</version>
+               <version>5.2.3.RELEASE</version>
                </dependency>
                <dependency>
                        <groupId>org.projectlombok</groupId>
index b1450b6..2bea235 100644 (file)
@@ -4,7 +4,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequest; 
 import javax.servlet.http.HttpServletResponse;
 
 import org.onap.portalapp.widget.domain.ValidationRespond;
@@ -22,6 +22,10 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestHeader;
 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.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
@@ -37,12 +41,12 @@ public class WidgetsCatalogController {
 
        @Value("${server.port}")
        String port;
-       @Value("${server.contextPath}")
+       @Value("${server.servlet.context-path}")
        String context;
        
-       @Value("${security.user.name}")
+       @Value("${spring.security.user.name}")
        String security_user;
-       @Value("${security.user.password}")
+       @Value("${spring.security.user.password}")
        String security_pass;
        
        @Autowired
@@ -59,7 +63,7 @@ public class WidgetsCatalogController {
        private static final Logger logger = LoggerFactory.getLogger(WidgetsCatalogController.class);
        
        @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/microservices/widgetCatalog" }, produces = "application/json")
        public List<WidgetCatalog> getWidgetCatalog(HttpServletRequest request, HttpServletResponse response
                        ,@RequestHeader(value="Authorization") String auth) throws IOException{
                
@@ -79,7 +83,7 @@ public class WidgetsCatalogController {
        }
        
        @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog/{loginName}" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/microservices/widgetCatalog/{loginName}" }, produces = "application/json")
        public List<WidgetCatalog> getUserWidgetCatalog(HttpServletRequest request, HttpServletResponse response, 
                        @PathVariable("loginName") String loginName, @RequestHeader(value="Authorization") String auth) throws IOException {
                List<WidgetCatalog> widgetCatalog = null;
@@ -98,7 +102,7 @@ public class WidgetsCatalogController {
        }
 
        @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.PUT, produces = "application/json")
+       @PutMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, produces = "application/json")
        public void updateWidgetCatalog(HttpServletRequest request, HttpServletResponse response,
                        @RequestBody WidgetCatalog newWidgetCatalog, @PathVariable("widgetId") long widgetId,
                        @RequestHeader(value="Authorization") String auth) throws IOException {
@@ -117,7 +121,7 @@ public class WidgetsCatalogController {
        }
        
        @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog" }, method = RequestMethod.POST, produces = "application/json")
+       @PostMapping(value = { "/microservices/widgetCatalog" }, produces = "application/json")
        public ValidationRespond saveWidgetCatalog(HttpServletRequest request, HttpServletResponse response, @RequestHeader(value="Authorization") String auth,
                        @RequestParam("file") MultipartFile file, @RequestParam("widget") String widget) throws IOException {   
        
@@ -148,7 +152,7 @@ public class WidgetsCatalogController {
        }
 
        @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.POST, produces = "application/json")
+       @PostMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, produces = "application/json")
        public ValidationRespond updateWidgetCatalogwithFiles(HttpServletRequest request, HttpServletResponse response, @RequestHeader(value="Authorization") String auth,
                        @RequestParam("file") MultipartFile file, @RequestParam("widget") String widget, @PathVariable("widgetId") long widgetId) throws IOException {  
                logger.debug("microserivces updating with files {}", widgetId);
@@ -176,8 +180,7 @@ public class WidgetsCatalogController {
        }
        
        @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, method = {
-                       RequestMethod.DELETE }, produces = "application/json")
+       @DeleteMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, produces = "application/json")
        public void deleteOnboardingWidget(HttpServletRequest request, HttpServletResponse response,
                        @PathVariable("widgetId") long widgetId, @RequestHeader(value="Authorization") String auth)  throws IOException{                
                if(!util.authorization(auth, security_user, security_pass)){
@@ -196,7 +199,7 @@ public class WidgetsCatalogController {
        }
        
        @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog/parameters/{widgetId}" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/microservices/widgetCatalog/parameters/{widgetId}" }, produces = "application/json")
        public Long getServiceIdByWidget(HttpServletRequest request, HttpServletResponse response, 
                        @PathVariable("widgetId") Long widgetId, @RequestHeader(value="Authorization") String auth) throws IOException {
                
@@ -217,7 +220,7 @@ public class WidgetsCatalogController {
 
        
        @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog/service/{serviceId}" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/microservices/widgetCatalog/service/{serviceId}" }, produces = "application/json")
        public List<WidgetCatalog> getWidgetByServiceId(HttpServletRequest request, HttpServletResponse response, 
                        @PathVariable("serviceId") Long serviceId, @RequestHeader(value="Authorization") String auth) throws IOException {
                List<WidgetCatalog> list = new ArrayList<>();
@@ -237,7 +240,7 @@ public class WidgetsCatalogController {
        
        
        @ResponseBody
-       @RequestMapping(value = { "/microservices/download/{widgetId}" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/microservices/download/{widgetId}" }, produces = "application/json")
        public byte[] getWidgetZipFile(HttpServletRequest request, HttpServletResponse response, 
                        @PathVariable("widgetId") long widgetId, @RequestHeader(value="Authorization") String auth) throws Exception {
                byte[] byteFile = null;
index 212826c..46ee814 100644 (file)
@@ -21,7 +21,7 @@ public class App implements Serializable{
 
        @Id
        @Column(name = "APP_ID")
-       @GeneratedValue(strategy=GenerationType.AUTO)
+       @GeneratedValue(strategy=GenerationType.IDENTITY)
        @Digits(integer = 11, fraction = 0)
        private Long appId;
 
index 43e7b2b..2ed49ab 100644 (file)
@@ -26,7 +26,7 @@ public class MicroserviceData {
        @Id
        @Column(name = "id")
        @Digits(integer = 11, fraction = 0)
-       @GeneratedValue(strategy=GenerationType.AUTO)
+       @GeneratedValue(strategy=GenerationType.IDENTITY)
        private Long id;
 
        @Column(name = "name")
index 7207d0a..cd9236d 100644 (file)
@@ -24,7 +24,7 @@ public class MicroserviceParameter {
        
        @Id
        @Column(name = "id")
-       @GeneratedValue(strategy=GenerationType.AUTO)
+       @GeneratedValue(strategy=GenerationType.IDENTITY)
        @Digits(integer = 11, fraction = 0)
        private Long id;
 
index aae9bfe..173a143 100644 (file)
@@ -33,7 +33,7 @@ public class RoleApp implements Serializable{
 
        @Id
        @Column(name = "ROLE_ID")
-       @GeneratedValue(strategy=GenerationType.AUTO)
+       @GeneratedValue(strategy=GenerationType.IDENTITY)
        @Digits(integer = 11, fraction = 0)
        private Long roleId;
 
index 1dc0582..a822c5a 100644 (file)
@@ -30,7 +30,7 @@ public class WidgetCatalog{
        
        @Id
        @Column(name = "widget_id")
-       @GeneratedValue(strategy=GenerationType.AUTO)
+       @GeneratedValue(strategy=GenerationType.IDENTITY)
        @Digits(integer = 11, fraction = 0)
        private long id;
        
index b52631f..ac25077 100644 (file)
@@ -6,7 +6,7 @@ import javax.sql.DataSource;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
-import org.springframework.orm.hibernate4.LocalSessionFactoryBean;
+import org.springframework.orm.hibernate5.LocalSessionFactoryBean;
 import org.springframework.orm.jpa.JpaTransactionManager;
 import org.springframework.transaction.PlatformTransactionManager;
 
index fed70ad..a02667d 100644 (file)
@@ -41,7 +41,7 @@ public class MicroserviceServiceImpl implements MicroserviceService{
                        Transaction tx = session.beginTransaction();            
                        session.save(newService);
                        tx.commit();
-                       session.flush();
+//                     session.flush();
                        session.close();
                }
                catch(Exception e){
@@ -58,7 +58,7 @@ public class MicroserviceServiceImpl implements MicroserviceService{
                        Transaction tx = session.beginTransaction();            
                        session.save(newParameter);
                        tx.commit();
-                       session.flush();
+//                     session.flush();
                        session.close();
                }
                catch(Exception e){
@@ -77,7 +77,7 @@ public class MicroserviceServiceImpl implements MicroserviceService{
                
                List<MicroserviceData> services = criteria.list();
                logger.debug("MicroserviceServiceImpl.getMicroserviceByName: result={}", services);
-               session.flush();
+//             session.flush();
                session.close();
                
                return (services.size() > 0) ? services.get(0).getId() : null;
index 59180d3..f5558e2 100644 (file)
@@ -191,7 +191,7 @@ public class WidgetCatalogServiceImpl implements WidgetCatalogService {
                        Transaction tx = session.beginTransaction();            
                        session.save(newWidgetCatalog);
                        tx.commit();
-                       session.flush();
+                       //session.flush();
                        session.close();
                        updateAppId(newWidgetCatalog.getId(), newWidgetCatalog.getWidgetRoles());
                }
@@ -217,7 +217,7 @@ public class WidgetCatalogServiceImpl implements WidgetCatalogService {
                        Transaction tx = session.beginTransaction();
                        session.update(newWidgetCatalog);
                        tx.commit();
-                       session.flush();
+                       //session.flush();
                        session.close();
                        updateAppId(newWidgetCatalog.getId(), newWidgetCatalog.getWidgetRoles());
                }catch(Exception e){
@@ -268,7 +268,7 @@ public class WidgetCatalogServiceImpl implements WidgetCatalogService {
                
                List<MicroserviceData> widgets = criteria.list();
                logger.debug("WidgetCatalogServiceImpl.getWidgetIdByName: result={}", widgets);
-               session.flush();
+//             session.flush();
                session.close();
                
                return (widgets.size() > 0) ? true : false;
index 42483b7..82b26d6 100644 (file)
@@ -1,22 +1,22 @@
 ## General App Properties
-server.contextPath=/widget
+server.servlet.context-path=/widget
 server.port=9082
-spring.http.multipart.max-file-size=128MB
-spring.http.multipart.max-request-size=128MB
+spring.servlet.multipart.max-file-size=128MB
+spring.servlet.multipart.max-request-size=128MB
 microservice.widget.location=/tmp
 
 ## App DB Properties
 spring.datasource.url=jdbc:mariadb://localhost:3306/portal
 spring.datasource.username=root
-spring.datasource.password=root
+spring.datasource.password=welcome2ibm
 spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
 spring.database.driver.classname=org.mariadb.jdbc.Driver
 spring.jpa.show-sql=false
 spring.jpa.properties.hibernate.format_sql=false
 
 ## Basic Authentication Properties
-security.user.name=widget_user
-security.user.password=ENC(IjywcRnI9+nuVEh9+OFFiRWAjBT1n718)
+spring.security.user.name=widget_user
+spring.security.user.password=ENC(IjywcRnI9+nuVEh9+OFFiRWAjBT1n718)
 
 account.user.name=portal
 account.user.password=6APqvG4AU2rfLgCvMdySwQ==
index 933710d..2d1fd27 100644 (file)
@@ -59,6 +59,7 @@ import org.mockito.MockitoAnnotations;
 import org.onap.portalapp.widget.domain.App;
 import org.onap.portalapp.widget.domain.RoleApp;
 import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.hibernate.query.NativeQuery;
 
 public class WidgetCatalogServiceImplTest {
 
@@ -75,7 +76,7 @@ public class WidgetCatalogServiceImplTest {
        Criteria criteria;
 
        @Mock
-       SQLQuery query;
+       NativeQuery query;
 
        @Before
        public void init() {
index d3dc1cb..0d01ee5 100644 (file)
@@ -134,7 +134,7 @@ public class WidgetsCatalogControllerTest {
                List<WidgetCatalog> list = new ArrayList<WidgetCatalog>();
                WidgetCatalog widget = new WidgetCatalog();
                list.add(widget);
-               Mockito.when(widgetService.getWidgetCatalog()).thenReturn(list);
+               Mockito.lenient().when(widgetService.getWidgetCatalog()).thenReturn(list);
                
                mockMvc.perform(get("/microservices/widgetCatalog/"))
                .andExpect(status().isBadRequest());
@@ -148,7 +148,7 @@ public class WidgetsCatalogControllerTest {
                widget.setId(1);
                widget.setName("junit");
                list.add(widget);
-               Mockito.when(widgetService.getUserWidgetCatalog("test")).thenReturn(list);
+               Mockito.lenient().when(widgetService.getUserWidgetCatalog("test")).thenReturn(list);
                
                String security_user = "user";
                String security_pass = "password";
@@ -170,7 +170,7 @@ public class WidgetsCatalogControllerTest {
                widget.setId(1);
                widget.setName("junit");
                list.add(widget);
-               Mockito.when(widgetService.getUserWidgetCatalog("test")).thenReturn(list);
+               Mockito.lenient().when(widgetService.getUserWidgetCatalog("test")).thenReturn(list);
                
                String security_user = "user";
                String security_pass = "password";
@@ -190,7 +190,7 @@ public class WidgetsCatalogControllerTest {
        @Test
        public void saveWidgetCatalog_ValidAuthorization_NoError() throws Exception {   
                ValidationRespond respond = new ValidationRespond(true, null);
-               Mockito.when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond);
+               Mockito.lenient().when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond);
                
                String security_user = "user";
                String security_pass = "password";
@@ -211,7 +211,7 @@ public class WidgetsCatalogControllerTest {
        @Test
        public void saveWidgetCatalog_Authorization_Error() throws Exception {  
                ValidationRespond respond = new ValidationRespond(true, null);
-               Mockito.when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond);
+               Mockito.lenient().when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond);
                
                String security_user = "user";
                String security_pass = "password";
@@ -270,7 +270,7 @@ public class WidgetsCatalogControllerTest {
        @Test
        public void updateWidgetCatalogwithFiles_ValidAuthorization_NoError() throws Exception {
                ValidationRespond respond = new ValidationRespond(true, null);
-               Mockito.when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond);
+               Mockito.lenient().when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond);
                
                String security_user = "user";
                String security_pass = "password";
@@ -420,7 +420,7 @@ public class WidgetsCatalogControllerTest {
                widget.setId(1);
                widget.setName("junit");
                list.add(widget);
-               Mockito.when(widgetService.getWidgetsByServiceId(serviceId)).thenReturn(list);
+               Mockito.lenient().when(widgetService.getWidgetsByServiceId(serviceId)).thenReturn(list);
                
                String security_user = "user";
                String security_pass = "password";
@@ -462,7 +462,7 @@ public class WidgetsCatalogControllerTest {
                String wrong_pass = "wrong";
                Long widgetId = new Long(1);
                byte[] bytes="Test".getBytes();
-               Mockito.when(storageService.getWidgetCatalogContent(widgetId)).thenReturn(bytes);       
+               Mockito.lenient().when(storageService.getWidgetCatalogContent(widgetId)).thenReturn(bytes);     
                        
                ReflectionTestUtils.setField(controller, "security_user", security_user, String.class);
                ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);
diff --git a/pom.xml b/pom.xml
index 19d8c34..7c48401 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
        <properties>
                <!-- Jenkins should invoke mvn with argument -Dbuild.number=${BUILD_NUMBER} -->
                <build.number>0</build.number>
-               <epsdk.version>2.6.0</epsdk.version>
+               <epsdk.version>3.3.0-SNAPSHOT</epsdk.version>
                <springframework.version>4.3.24.RELEASE</springframework.version>
                <springframework.security.version>4.2.13.RELEASE</springframework.security.version>
                <hibernate.version>4.3.11.Final</hibernate.version>
                          </execution>
                        </executions>
                  </plugin>
-                 
+                 <plugin>
+                     <groupId>org.apache.maven.plugins</groupId>
+                     <artifactId>maven-enforcer-plugin</artifactId>
+                     <version>3.0.0-M2</version>
+                     <executions>
+                      <execution>
+                      <id>enforce-no-snapshots</id>
+                      <goals>
+                      <goal>enforce</goal>
+                      </goals>
+                    <configuration>
+                    <rules>
+                    <requireReleaseVersion>
+                     <message>No Snapshots Allowed!</message>
+                    </requireReleaseVersion>
+                    </rules>
+                    <fail>false</fail>
+                    </configuration>
+                  </execution>
+                 </executions>
+                 </plugin>
                </plugins>
        </build>
 
index 38ebedd..d977f72 100644 (file)
@@ -78,8 +78,7 @@ export class UsersService {
   
   addNewUser(newUserData){
     console.log("User service : ", newUserData);
-    return this.http.post(this.api.saveNewUser, newUserData).subscribe((response)=>{
-    });
+       return this.http.post(this.api.saveNewUser, newUserData);
   }
 
 }
index 75b6dda..fe6b8ee 100644 (file)
@@ -1,5 +1,6 @@
 /ng-material-module.ts
 /layout/
+!layout/components/search-users
 /modals/
 /shared/
 !shared/interceptors/
@@ -67,4 +67,7 @@
         <tr mat-row (click)="setSelectedUser(row)" id="table-row-{{i}}" [ngClass]="{ 'selected': row === selectedUser }"
             *matRowDef="let row; columns: displayedColumns; let i = index;"></tr>
     </table>
+</div>
+<div class="search-user-container" *ngIf="noUserFlag">
+    <p>{{message}} Or <a href="javascript:void(0);" (click)="addNewUser()"><b>Click Here</b></a> to add <b>New User!</b></p>
 </div>
\ No newline at end of file
@@ -56,6 +56,7 @@ export class SearchUsersComponent implements OnInit {
   @ViewChild(MatSort) sort: MatSort;
   @ViewChild(MatPaginator) paginator: MatPaginator;
   @Output() passBackSelectedUser: EventEmitter<any> = new EventEmitter();
+  @Output() userNotFoundFlag = new EventEmitter<boolean>();
   searchString: string;
   txtResults = 'result';
   searchUsersResults: any;
@@ -65,6 +66,8 @@ export class SearchUsersComponent implements OnInit {
   selectedUser: any;
   displayedColumns: string[] = ['firstName'];
   dataSourceMap = new MatTableDataSource(this.searchUsersResults);
+  submitted = false;
+  message = " No users found with your query. Please change your search and try again.";
 
   ngOnInit() {
     this.searchString = '';
@@ -77,6 +80,7 @@ export class SearchUsersComponent implements OnInit {
       this.passBackSelectedUser.emit(systemUser);
   }
 
+  noUserFlag: boolean = false;
   searchUsers() {
     if (!this.isSystemUser) {
       this.isLoading = true;
@@ -85,11 +89,10 @@ export class SearchUsersComponent implements OnInit {
       this.userService.searchUsers(this.searchString).subscribe((_data: PortalAdmin) => {
         this.searchUsersResults = _data;
         if (this.searchUsersResults == null || this.searchUsersResults.length == 0) {
-          const modelRef = this.ngModal.open(ConfirmationModalComponent)
-          modelRef.componentInstance.title = "Confirmation";
-          modelRef.componentInstance.message = " No users found with your query. Please change your search and try again."
+          this.noUserFlag = true;
           this.isLoading = false;
         } else {
+          this.noUserFlag = false;
           this.showUserTable = true;
           this.isLoading = false;
           this.dataSourceMap = new MatTableDataSource(this.searchUsersResults);
@@ -104,4 +107,9 @@ export class SearchUsersComponent implements OnInit {
     this.passBackSelectedUser.emit(this.selectedUser);
   }
 
+  addNewUser() {
+    console.log("Emit the value to parent");
+    this.userNotFoundFlag.emit(true);
+  }
+
 }
index 7fc35e4..bd9d69b 100644 (file)
   </form>  
 </div>
 <div class="modal-footer">
-  <button type="submit" class="btn btn-primary" (click)="addUser()" [disabled]="addNewUserForm.invalid">Next</button> &nbsp;
+  <button type="submit" class="btn btn-primary" (click)="addUser()">Next</button> &nbsp;
     <button type="button" class="btn btn-primary" aria-label="Close" (click)="activeModal.dismiss('Cross')">Close</button>
 </div>
index bea0fcd..33d2b33 100644 (file)
@@ -2,7 +2,8 @@ import { Component, OnInit } from '@angular/core';
 import { FormBuilder, FormGroup, Validators } from '@angular/forms';
 import { MustMatch } from 'src/app/shared/helpers/must-match-validator';
 import { UsersService } from 'src/app/shared/services';
-import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
+import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
+import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component';
 
 @Component({
   selector: 'app-user-details-form',
@@ -13,9 +14,10 @@ export class UserDetailsFormComponent implements OnInit {
   addNewUserForm: FormGroup;
   submitted = false;
 
-  constructor(private formBuilder: FormBuilder, 
+  constructor(private formBuilder: FormBuilder,
     private usersService: UsersService,
-    public activeModal: NgbActiveModal) { }
+    public activeModal: NgbActiveModal,
+    public ngbModal: NgbModal) { }
 
   ngOnInit() {
     this.addNewUserForm = this.formBuilder.group({
@@ -24,7 +26,7 @@ export class UserDetailsFormComponent implements OnInit {
       lastName: ['', Validators.required],
       email: ['', [Validators.required, Validators.email]],
       loginId: ['', Validators.required],
-      loginPwd: ['', [Validators.required, Validators.minLength(6)]],
+      loginPwd: ['', Validators.required],
       confirmPassword: ['', Validators.required]
     }, {
         validator: MustMatch('loginPwd', 'confirmPassword')
@@ -44,7 +46,17 @@ export class UserDetailsFormComponent implements OnInit {
     console.log("New user Json : " + JSON.stringify(this.addNewUserForm.value));
     console.log("Get Raw value : " + this.addNewUserForm.getRawValue());
     let newUserFormData = JSON.stringify(this.addNewUserForm.getRawValue());
-    this.usersService.addNewUser(newUserFormData);
+    this.usersService.addNewUser(newUserFormData).subscribe(result => {
+      console.log("Result : ", result);
+      const modalSuccess = this.ngbModal.open(ConfirmationModalComponent);
+      modalSuccess.componentInstance.title = "Success";
+      modalSuccess.componentInstance.message = 'User added Successfully!';
+    }, error => {
+      console.log("Error : ", error);
+      const modalErrorRef = this.ngbModal.open(ConfirmationModalComponent);
+      modalErrorRef.componentInstance.title = "Error";
+      modalErrorRef.componentInstance.message = 'Something went wrong. Error Message: ' + error.message;
+    })
     this.activeModal.close();
   }
 
index d2c5e0f..cb712eb 100644 (file)
Binary files a/portal-FE-os/src/favicon.ico and b/portal-FE-os/src/favicon.ico differ