diff options
206 files changed, 4635 insertions, 9053 deletions
diff --git a/3.2.1-container-portal-docker.yaml b/3.2.1-container-portal-docker.yaml new file mode 100644 index 00000000..8872a0a6 --- /dev/null +++ b/3.2.1-container-portal-docker.yaml @@ -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 diff --git a/deliveries/.env b/deliveries/.env index 614aeb0c..333eb9eb 100644 --- a/deliveries/.env +++ b/deliveries/.env @@ -38,11 +38,11 @@ CLI_IMG_NAME=onap/cli # This is the first portion of the Docker image tag # that is published to the ONAP registry. -PORTAL_VERSION=3.2.0 +PORTAL_VERSION=3.3.0 # This is used during builds and in docker-compose; # it is never published to the ONAP registry. -PORTAL_TAG=elalto +PORTAL_TAG=guilin # Name of directory in apps container (NOT host) WEBAPPS_DIR=/opt/apache-tomcat-8.0.37/webapps diff --git a/deliveries/build_portalapps_dockers.sh b/deliveries/build_portalapps_dockers.sh index fdaf9a15..d2349b8e 100755 --- a/deliveries/build_portalapps_dockers.sh +++ b/deliveries/build_portalapps_dockers.sh @@ -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." diff --git a/docs/conf.py b/docs/conf.py index 8f40e8b8..5371015c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,4 +12,4 @@ intersphinx_mapping = {} html_last_updated_fmt = '%d-%b-%y %H:%M' def setup(app): - app.add_stylesheet("css/ribbon_onap.css") + app.add_stylesheet("css/ribbon.css") diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 4ada1c3b..42617c22 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -28,6 +28,12 @@ This release contains an Angular upgrade, bug fixes and security enhancements. * Fixed Sonar reported critical issues. **Known Issues** + * User management pages do not work properly. We will be addressing this in the Guilin release. So, the work around is: + + 1. If we try to add user role by navigating directly to an application, like A&AI, we are unable to add roles. + 2. However, With Portal admin privileges a user (in this case Demo user) can navigate to User screen and select Portal/Default from the drop down. + 3. Then update user roles for A&AI and other applications in the popup. + 4. We validated that this operation is correctly updating the role in AAF. **Security Notes** @@ -67,11 +73,11 @@ Quick Links: **Other** * Below are the docker images released as part of Portal Platform project: - * onap/portal-app:3.2.0 - * onap/portal-db:3.2.0 - * onap/portal-sdk:3.0.0 - * onap/portal-wms:3.2.0 - * portal/sdk java artifacts - (Release branch: “release-3.0.0”) + * onap/portal-app:3.2.3 + * onap/portal-db:3.2.3 + * onap/portal-sdk:3.2.0 + * onap/portal-wms:3.2.3 + * portal/sdk java artifacts - (Release branch: “release-3.2.0”; Jar Version: "3.0.0") Version: 2.6.0 -------------- diff --git a/ecomp-portal-BE-common/pom.xml b/ecomp-portal-BE-common/pom.xml index 19d32431..85cf8757 100644 --- a/ecomp-portal-BE-common/pom.xml +++ b/ecomp-portal-BE-common/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.portal</groupId> <artifactId>onap-portal-parent</artifactId> - <version>3.3.0</version> + <version>3.4.0</version> </parent> <artifactId>portal-be-common</artifactId> @@ -184,17 +184,7 @@ <artifactId>jaxb-api</artifactId> <version>2.4.0-b180830.0359</version> </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter</artifactId> - <version>1.3.1.RELEASE</version> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>log4j-over-slf4j</artifactId> - </exclusion> - </exclusions> - </dependency> + <!-- Hibernate --> <dependency> <groupId>org.hibernate</groupId> @@ -284,23 +274,23 @@ <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> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> - <version>2.8.10</version> + <version>2.10.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> - <version>2.8.10</version> + <version>2.10.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> - <version>2.8.11.4</version> + <version>2.10.0</version> </dependency> <dependency> <groupId>postgresql</groupId> @@ -740,8 +730,6 @@ <artifactId>jersey-servlet</artifactId> </exclusion> </exclusions> - - </dependency> <dependency> <groupId>org.projectlombok</groupId> 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 d36cf6cb..15539912 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 @@ -51,9 +51,10 @@ 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; +import org.springframework.web.bind.annotation.PostMapping; import io.swagger.annotations.ApiOperation; @@ -75,14 +76,14 @@ public class SessionCommunicationController extends EPRestrictedRESTfulBaseCont @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 46f96d66..12deabe3 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 class MusicSessionRepositoryHandler { 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 class MusicSessionRepositoryHandler { 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 class MusicSessionRepositoryHandler { 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 557e4dc3..714d3aba 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 @@ -59,9 +59,10 @@ 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; + @RestController @org.springframework.context.annotation.Configuration @@ -90,7 +91,7 @@ public class AppCatalogController extends EPRestrictedBaseController { * @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 +126,7 @@ public class AppCatalogController extends EPRestrictedBaseController { * @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 8f456fde..0bf75fbe 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 @@ -61,8 +61,9 @@ 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; @RestController @RequestMapping("/portalApi/contactus") @@ -94,7 +95,7 @@ public class AppContactUsController extends EPRestrictedBaseController { * @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 +124,7 @@ public class AppContactUsController extends EPRestrictedBaseController { * @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 +146,7 @@ public class AppContactUsController extends EPRestrictedBaseController { * @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 +168,7 @@ public class AppContactUsController extends EPRestrictedBaseController { * @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 +191,7 @@ public class AppContactUsController extends EPRestrictedBaseController { * @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 +211,7 @@ public class AppContactUsController extends EPRestrictedBaseController { 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 +238,7 @@ public class AppContactUsController extends EPRestrictedBaseController { * @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 c34311c3..99b4fcee 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.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.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 @@ public class AppsController extends EPRestrictedBaseController { * 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 @@ public class AppsController extends EPRestrictedBaseController { * @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 @@ public class AppsController extends EPRestrictedBaseController { * 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 @@ public class AppsController extends EPRestrictedBaseController { * 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 @@ public class AppsController extends EPRestrictedBaseController { * @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 @@ public class AppsController extends EPRestrictedBaseController { 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 @@ public class AppsController extends EPRestrictedBaseController { * 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 @@ public class AppsController extends EPRestrictedBaseController { 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 @@ public class AppsController extends EPRestrictedBaseController { 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 @@ public class AppsController extends EPRestrictedBaseController { * 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 @@ public class AppsController extends EPRestrictedBaseController { 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 @@ public class AppsController extends EPRestrictedBaseController { 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 @@ public class AppsController extends EPRestrictedBaseController { * 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 @@ public class AppsController extends EPRestrictedBaseController { 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 @@ public class AppsController extends EPRestrictedBaseController { * 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 @@ public class AppsController extends EPRestrictedBaseController { * 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 @@ public class AppsController extends EPRestrictedBaseController { * 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 @@ public class AppsController extends EPRestrictedBaseController { * 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 @@ public class AppsController extends EPRestrictedBaseController { * @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 @@ public class AppsController extends EPRestrictedBaseController { * @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); @@ -666,7 +667,7 @@ public class AppsController extends EPRestrictedBaseController { String appId = request.getParameter("appParam"); app = appService.getApp(Long.valueOf(appId)); if(!EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) { - app.setCentralAuth(false); + app.setRolesInAAF(false); } if (user != null && (adminRolesService.isAccountAdminOfApplication(user, app) || (adminRolesService.isSuperAdmin(user) && app.getId().equals(PortalConstants.PORTAL_APP_ID)))) @@ -690,7 +691,7 @@ public class AppsController extends EPRestrictedBaseController { * 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; @@ -720,7 +721,7 @@ public class AppsController extends EPRestrictedBaseController { /** * * @param request - * HTTP servlet request + * HTTP servlet request‰ * @param response * HTTP servlet response * @param modifiedOnboardingApp @@ -728,12 +729,12 @@ public class AppsController extends EPRestrictedBaseController { * @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; EPUser user = null; - EPApp oldEPApp = appService.getApp(modifiedOnboardingApp.id); + EPApp oldEPApp = appService.getApp(modifiedOnboardingApp.getId()); try { user = EPUserUtils.getUserSession(request); @@ -745,7 +746,7 @@ public class AppsController extends EPRestrictedBaseController { response.getStatus()); return fieldsValidator; } else { - if((oldEPApp.getCentralAuth() && modifiedOnboardingApp.isCentralAuth && !oldEPApp.getNameSpace().equalsIgnoreCase(modifiedOnboardingApp.nameSpace) && modifiedOnboardingApp.nameSpace!= null ) || (!oldEPApp.getCentralAuth() && modifiedOnboardingApp.isCentralAuth && modifiedOnboardingApp.nameSpace!= null)) + if((oldEPApp.getRolesInAAF() && modifiedOnboardingApp.getRolesInAAF() && !oldEPApp.getNameSpace().equalsIgnoreCase(modifiedOnboardingApp.getNameSpace()) && modifiedOnboardingApp.getNameSpace()!= null ) || (!oldEPApp.getRolesInAAF() && modifiedOnboardingApp.getRolesInAAF() && modifiedOnboardingApp.getNameSpace() != null)) { checkIfNameSpaceIsValid(modifiedOnboardingApp, fieldsValidator, response); } @@ -784,7 +785,7 @@ public class AppsController extends EPRestrictedBaseController { * 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; @@ -794,7 +795,7 @@ public class AppsController extends EPRestrictedBaseController { EcompPortalUtils.setBadPermissions(user, response, "postOnboardingApps"); } else { newOnboardingApp.normalize(); - if(newOnboardingApp.isCentralAuth != null && newOnboardingApp.isCentralAuth) + if(newOnboardingApp.getRolesInAAF() != null && newOnboardingApp.getRolesInAAF()) checkIfNameSpaceIsValid(newOnboardingApp, fieldsValidator, response); fieldsValidator = appService.addOnboardingApp(newOnboardingApp, user); response.setStatus(fieldsValidator.httpStatusCode.intValue()); @@ -845,8 +846,7 @@ public class AppsController extends EPRestrictedBaseController { * 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; @@ -883,7 +883,7 @@ public class AppsController extends EPRestrictedBaseController { * Application ID * @return Bytes with the app thumbnail image; null if not available. */ - @RequestMapping(value = { "/portalApi/appThumbnail/{appId}" }, method = { RequestMethod.GET }) + @GetMapping(value = { "/portalApi/appThumbnail/{appId}" }) public HttpEntity<byte[]> getAppThumbnail(HttpServletRequest request, @PathVariable("appId") Long appId, HttpServletResponse response) { EPApp app = appService.getApp(appId); @@ -911,7 +911,7 @@ public class AppsController extends EPRestrictedBaseController { private void checkIfNameSpaceIsValid(OnboardingApp modifiedOnboardingApp, FieldsValidator fieldsValidator, HttpServletResponse response) throws InvalidApplicationException { try { - ResponseEntity<String> res = appService.checkIfNameSpaceIsValid(modifiedOnboardingApp.nameSpace); + ResponseEntity<String> res = appService.checkIfNameSpaceIsValid(modifiedOnboardingApp.getNameSpace()); } catch (HttpClientErrorException e) { logger.error(EELFLoggerDelegate.errorLogger, "checkIfNameSpaceExists failed", e); EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode()); 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 d5438f41..a88728a0 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,7 +65,9 @@ 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.GetMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; @@ -126,7 +128,7 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl * @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,13 +202,13 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl * @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) { EPApp epApp = appService.getApp(appId); OnboardingApp obApp = new OnboardingApp(); - epApp.setAppPassword(EPCommonSystemProperties.APP_DISPLAY_PASSWORD); //to hide password from get request + epApp.setAppBasicAuthPassword(EPCommonSystemProperties.APP_DISPLAY_PASSWORD); //to hide password from get request appService.createOnboardingFromApp(epApp, obApp); EcompPortalUtils.logAndSerializeObject(logger, "getOnboardAppExternal", RESPONSE, obApp); return obApp; @@ -234,7 +236,7 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl * @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) { @@ -250,7 +252,7 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl return portalResponse; } // Validate fields - if (newOnboardApp.id != null) { + if (newOnboardApp.getId() != null) { portalResponse.setStatus(PortalRestStatusEnum.ERROR); portalResponse.setMessage("Unexpected field: id"); return portalResponse; @@ -264,10 +266,10 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl try { List<EPUser> userList; - userList = userService.getUserByUserId(newOnboardApp.myLoginsAppOwner); + userList = userService.getUserByUserId(newOnboardApp.getMyLoginsAppOwner()); if (userList == null || userList.size() != 1) { portalResponse.setStatus(PortalRestStatusEnum.ERROR); - portalResponse.setMessage("Failed to find user: " + newOnboardApp.myLoginsAppOwner); + portalResponse.setMessage("Failed to find user: " + newOnboardApp.getMyLoginsAppOwner()); return portalResponse; } @@ -322,7 +324,7 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl * @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) { @@ -341,7 +343,7 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl // Validate fields. - if (appId == null || !appId.equals(oldOnboardApp.id)) { + if (appId == null || !appId.equals(oldOnboardApp.getId())) { portalResponse.setStatus(PortalRestStatusEnum.ERROR); portalResponse.setMessage("Unexpected value for field: id"); return portalResponse; @@ -356,10 +358,10 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl try { List<EPUser> userList; - userList = userService.getUserByUserId(oldOnboardApp.myLoginsAppOwner); + userList = userService.getUserByUserId(oldOnboardApp.getMyLoginsAppOwner()); if (userList == null || userList.size() != 1) { portalResponse.setStatus(PortalRestStatusEnum.ERROR); - portalResponse.setMessage("Failed to find user: " + oldOnboardApp.myLoginsAppOwner); + portalResponse.setMessage("Failed to find user: " + oldOnboardApp.getMyLoginsAppOwner()); return portalResponse; } @@ -396,15 +398,15 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl } private boolean checkIfFieldsAreNull(OnboardingApp onboardingApp) { - return onboardingApp.name == null || onboardingApp.url == null || onboardingApp.restUrl == null - || onboardingApp.myLoginsAppOwner == null || onboardingApp.restrictedApp == null - || onboardingApp.isOpen == null || onboardingApp.isEnabled == null; + return onboardingApp.getAppName() == null || onboardingApp.getLandingPage() == null || onboardingApp.getRestUrl() == null + || onboardingApp.getMyLoginsAppOwner() == null || onboardingApp.getRestrictedApp() == null + || onboardingApp.getIsOpen() == null || onboardingApp.getIsEnabled() == null; } private boolean checkIfFieldsAreEmpty(OnboardingApp onboardingApp) { - return onboardingApp.name.trim().isEmpty() - || onboardingApp.url.trim().isEmpty() - || onboardingApp.restUrl.trim().isEmpty() - || onboardingApp.myLoginsAppOwner.trim().isEmpty(); + return onboardingApp.getAppName().trim().isEmpty() + || onboardingApp.getLandingPage().trim().isEmpty() + || onboardingApp.getRestUrl().trim().isEmpty() + || onboardingApp.getMyLoginsAppOwner().trim().isEmpty(); } } 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 cff8245a..dc5127c6 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,7 +48,7 @@ import org.onap.portalapp.validation.SecureString; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -91,7 +91,7 @@ public class AuditLogController extends EPRestrictedBaseController { * @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 1f0c1f8e..9acb8833 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,7 +84,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.RequestMethod; +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.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; @@ -106,7 +109,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B 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 +131,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +146,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +161,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B } @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 +177,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +192,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +206,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B } @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 +227,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +252,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +275,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +291,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +305,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B } @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 +328,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +342,8 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B } @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); @@ -354,7 +357,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 { @@ -376,7 +379,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B } @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 +391,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B 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 +415,8 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +436,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +456,8 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +477,8 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +499,8 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +520,8 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +542,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B // 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 +562,8 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +583,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +798,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +820,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +842,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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) { @@ -861,7 +864,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 { @@ -884,7 +887,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +909,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B } @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 +925,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +949,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +971,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B } @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 +992,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +1007,8 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +1023,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B @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 +1036,7 @@ public class AuxApiRequestMapperController implements ApplicationContextAware, B } @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 51b1d484..60164967 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,7 +40,7 @@ package org.onap.portalapp.portal.controller; import javax.servlet.http.HttpServletRequest; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.onap.portalapp.portal.domain.BEProperty; @@ -56,7 +56,7 @@ public class BEPropertyReaderController extends FusionBaseController{ 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/BasicAuthAccountController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BasicAuthAccountController.java index f655d352..24c08f3a 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BasicAuthAccountController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BasicAuthAccountController.java @@ -59,8 +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.RequestMethod; +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.RestController; @RestController @@ -96,7 +98,7 @@ public class BasicAuthAccountController extends EPRestrictedBaseController { * @throws Exception * on failure */ - @RequestMapping(value = { "/portalApi/basicAuthAccount" }, method = RequestMethod.POST) + @PostMapping(value = { "/portalApi/basicAuthAccount" }) public PortalRestResponse<String> createBasicAuthAccount(HttpServletRequest request, HttpServletResponse response, @RequestBody BasicAuthCredentials newBasicAuthAccount) throws Exception { @@ -153,7 +155,7 @@ public class BasicAuthAccountController extends EPRestrictedBaseController { * on failure */ - @RequestMapping(value = { "/portalApi/basicAuthAccount" }, method = RequestMethod.GET) + @GetMapping(value = { "/portalApi/basicAuthAccount" }) public PortalRestResponse<List<BasicAuthCredentials>> getBasicAuthAccount(HttpServletRequest request, HttpServletResponse response) throws Exception { @@ -182,7 +184,7 @@ public class BasicAuthAccountController extends EPRestrictedBaseController { * @throws Exception * on failure */ - @RequestMapping(value = { "/portalApi/basicAuthAccount/{accountId}" }, method = RequestMethod.PUT) + @PutMapping(value = { "/portalApi/basicAuthAccount/{accountId}" }) public PortalRestResponse<String> updateAccount(HttpServletRequest request, HttpServletResponse response, @PathVariable("accountId") long accountId, @RequestBody BasicAuthCredentials newBasicAuthAccount) throws Exception { @@ -219,7 +221,7 @@ public class BasicAuthAccountController extends EPRestrictedBaseController { * @throws Exception * on failure */ - @RequestMapping(value = { "/portalApi/basicAuthAccount/{accountId}" }, method = RequestMethod.DELETE) + @DeleteMapping(value = { "/portalApi/basicAuthAccount/{accountId}" }) public PortalRestResponse<String> deleteAccount(HttpServletRequest request, HttpServletResponse response, @PathVariable("accountId") long accountId) throws Exception { diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/CommonWidgetController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/CommonWidgetController.java index ee17ac0a..66b9df20 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/CommonWidgetController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/CommonWidgetController.java @@ -47,8 +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.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -83,7 +82,7 @@ public class CommonWidgetController extends EPRestrictedBaseController implement * Request parameter. * @return Rest response wrapped around a CommonWidgetMeta object. */ - @RequestMapping(value = "/commonWidgets", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/commonWidgets", produces = "application/json") public PortalRestResponse<CommonWidgetMeta> getWidgetData(HttpServletRequest request, @RequestParam String resourceType) { if (!isValidResourceType(resourceType)){ diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/DashboardController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/DashboardController.java index 6137aec9..ff89bb88 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/DashboardController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/DashboardController.java @@ -78,7 +78,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; 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.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -132,7 +133,7 @@ public class DashboardController extends EPRestrictedBaseController { * Request parameter. * @return Rest response wrapped around a CommonWidgetMeta object. */ - @RequestMapping(value = "/widgetData", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/widgetData", produces = "application/json") public PortalRestResponse<CommonWidgetMeta> getWidgetData(HttpServletRequest request, @RequestParam String resourceType) { if (!isValidResourceType(resourceType)) { @@ -154,7 +155,7 @@ public class DashboardController extends EPRestrictedBaseController { * read from POST body. * @return Rest response wrapped around a String; e.g., "success" or "ERROR" */ - @RequestMapping(value = "/widgetDataBulk", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/widgetDataBulk", produces = "application/json") public PortalRestResponse<String> saveWidgetDataBulk(@RequestBody CommonWidgetMeta commonWidgetMeta) { logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetDataBulk: argument is {}", commonWidgetMeta); if (!DATA_VALIDATOR.isValid(commonWidgetMeta)){ @@ -183,7 +184,7 @@ public class DashboardController extends EPRestrictedBaseController { * read from POST body * @return Rest response wrapped around a String; e.g., "success" or "ERROR" */ - @RequestMapping(value = "/widgetData", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/widgetData", produces = "application/json") public PortalRestResponse<String> saveWidgetData(@RequestBody CommonWidget commonWidget, HttpServletRequest request, HttpServletResponse response) { logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetData: argument is {}", commonWidget); EPUser user = EPUserUtils.getUserSession(request); @@ -249,7 +250,7 @@ public class DashboardController extends EPRestrictedBaseController { * read from POST body * @return Rest response wrapped around a String; e.g., "success" or "ERROR" */ - @RequestMapping(value = "/deleteData", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/deleteData", produces = "application/json") public PortalRestResponse<String> deleteWidgetData(@RequestBody CommonWidget commonWidget) { logger.debug(EELFLoggerDelegate.debugLogger, "deleteWidgetData: argument is {}", commonWidget); if (!DATA_VALIDATOR.isValid(commonWidget)){ @@ -269,7 +270,7 @@ public class DashboardController extends EPRestrictedBaseController { * Result Item. */ @EPAuditLog - @RequestMapping(value = "/search", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/search", produces = "application/json") public PortalRestResponse<Map<String, List<SearchResultItem>>> searchPortal(HttpServletRequest request, @RequestParam String searchString) { if (!DATA_VALIDATOR.isValid(new SecureString(searchString))){ @@ -330,7 +331,7 @@ public class DashboardController extends EPRestrictedBaseController { * @param request * @return Rest response wrapped around a list of String */ - @RequestMapping(value = "/activeUsers", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/activeUsers", produces = "application/json") public List<String> getActiveUsers(HttpServletRequest request) { List<String> activeUsers; List<String> onlineUsers = new ArrayList<>(); @@ -358,7 +359,7 @@ public class DashboardController extends EPRestrictedBaseController { * @param request * @return Rest response wrapped around a number that is the number of milliseconds. */ - @RequestMapping(value = "/onlineUserUpdateRate", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/onlineUserUpdateRate", produces = "application/json") public PortalRestResponse<Map<String, String>> getOnlineUserUpdateRate(HttpServletRequest request) { try { String updateRate = SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_RATE); @@ -381,7 +382,7 @@ public class DashboardController extends EPRestrictedBaseController { * @param request * @return Rest response wrapped around a number that is the window width threshold to collapse right menu. */ - @RequestMapping(value = "/windowWidthThresholdRightMenu", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/windowWidthThresholdRightMenu", produces = "application/json") public PortalRestResponse<Map<String, String>> getWindowWidthThresholdForRightMenu(HttpServletRequest request) { try { String windowWidthString = SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_RIGHT_MENU); @@ -402,7 +403,7 @@ public class DashboardController extends EPRestrictedBaseController { * @param request * @return Rest response wrapped around a number that is the window width threshold to collapse the left menu. */ - @RequestMapping(value = "/windowWidthThresholdLeftMenu", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/windowWidthThresholdLeftMenu", produces = "application/json") public PortalRestResponse<Map<String, String>> getWindowWidthThresholdForLeftMenu(HttpServletRequest request) { try { String windowWidthString = SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_LEFT_MENU); @@ -422,7 +423,7 @@ public class DashboardController extends EPRestrictedBaseController { * @param request * @return Rest response wrapped around a List of String */ - @RequestMapping(value = "/relatedUsers", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/relatedUsers", produces = "application/json") public PortalRestResponse<List<String>> activeUsers(HttpServletRequest request) { EPUser user = EPUserUtils.getUserSession(request); try { diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java index 04ee5e0b..6ad88aef 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java @@ -68,7 +68,8 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; 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.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -90,7 +91,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * Request parameter. * @return Rest response wrapped around a CommonWidgetMeta object. */ - @RequestMapping(value = "/widgetData", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/widgetData", produces = "application/json") public PortalRestResponse<CommonWidgetMeta> getWidgetData(HttpServletRequest request, @RequestParam String resourceType) { if (stringIsNotSafeHtml(resourceType)) { @@ -107,7 +108,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * read from POST body. * @return Rest response wrapped around a String; e.g., "success" or "ERROR" */ - @RequestMapping(value = "/widgetDataBulk", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/widgetDataBulk", produces = "application/json") public PortalRestResponse<String> saveWidgetDataBulk(@Valid @RequestBody CommonWidgetMeta commonWidgetMeta) { logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetDataBulk: argument is {}", commonWidgetMeta); if (commonWidgetMeta.getCategory() == null || commonWidgetMeta.getCategory().trim().equals("")){ @@ -137,7 +138,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * read from POST body * @return Rest response wrapped around a String; e.g., "success" or "ERROR" */ - @RequestMapping(value = "/widgetData", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/widgetData", produces = "application/json") public PortalRestResponse<String> saveWidgetData(@Valid @RequestBody CommonWidget commonWidget) { logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetData: argument is {}", commonWidget); if (commonWidget.getCategory() == null || commonWidget.getCategory().trim().equals("")){ @@ -186,7 +187,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * read from POST body * @return Rest response wrapped around a String; e.g., "success" or "ERROR" */ - @RequestMapping(value = "/deleteData", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/deleteData", produces = "application/json") public PortalRestResponse<String> deleteWidgetData(@Valid @RequestBody CommonWidget commonWidget) { if (commonWidget!=null){ Validator validator = VALIDATOR_FACTORY.getValidator(); @@ -208,7 +209,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * @return Rest response wrapped around a Map of String to List of Search * Result Item. */ - @RequestMapping(value = "/allPortal", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/allPortal", produces = "application/json") public PortalRestResponse<Map<String, List<SearchResultItem>>> searchPortal(HttpServletRequest request, @RequestParam String searchString) { @@ -246,7 +247,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * @param request * @return Rest response wrapped around a list of String */ - @RequestMapping(value = "/activeUsers", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/activeUsers", produces = "application/json") public List<String> getActiveUsers(HttpServletRequest request) { List<String> activeUsers = null; List<String> onlineUsers = new ArrayList<>(); @@ -274,7 +275,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * @param request * @return Rest response wrapped around a List of String */ - @RequestMapping(value = "/relatedUsers", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/relatedUsers", produces = "application/json") public PortalRestResponse<List<String>> activeUsers(HttpServletRequest request) { EPUser user = EPUserUtils.getUserSession(request); try { diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/EncryptAdminController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/EncryptAdminController.java index 258a7fd5..4f02f240 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/EncryptAdminController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/EncryptAdminController.java @@ -59,7 +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.RequestMethod; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; @RestController @@ -75,7 +75,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 { diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAccessRolesController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAccessRolesController.java index 7d9f297c..67e71c50 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAccessRolesController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAccessRolesController.java @@ -4,6 +4,8 @@ * =================================================================== * Copyright (C) 2017-2018 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"); @@ -90,7 +92,9 @@ 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.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.RestController; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -124,8 +128,8 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl private UserService userservice = new UserServiceCentalizedImpl(); @ApiOperation(value = "Gets user role for an application.", response = CentralUser.class, responseContainer="List") - @RequestMapping(value = { - "/user/{loginId}" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/user/{loginId}" }, produces = "application/json") public CentralUser getUser(HttpServletRequest request, HttpServletResponse response, @PathVariable("loginId") String loginId) throws Exception { if (!DATA_VALIDATOR.isValid(new SecureString(loginId))){ @@ -145,8 +149,8 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets user roles for an application which is upgraded to newer version.", response = String.class, responseContainer="List") - @RequestMapping(value = { - "/v1/user/{loginId}" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/v1/user/{loginId}" }, produces = "application/json") public String getV2UserList(HttpServletRequest request, HttpServletResponse response, @PathVariable("loginId") String loginId) throws Exception { if (!DATA_VALIDATOR.isValid(new SecureString(loginId))){ @@ -166,8 +170,8 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets roles for an application.", response = CentralRole.class, responseContainer="Json") - @RequestMapping(value = { - "/roles" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/roles" }, produces = "application/json") public List<CentralRole> getRolesForApp(HttpServletRequest request, HttpServletResponse response) throws Exception { logger.debug(EELFLoggerDelegate.debugLogger, "Request received for getRolesForApp"); List<CentralV2Role> v2CenRole = null; @@ -190,8 +194,8 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets roles for an application which is upgraded to newer version.", response = CentralV2Role.class, responseContainer="Json") - @RequestMapping(value = { - "/v1/roles" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/v1/roles" }, produces = "application/json") public List<CentralV2Role> getV2RolesForApp(HttpServletRequest request, HttpServletResponse response) throws Exception { logger.debug(EELFLoggerDelegate.debugLogger, "Request received for getV2RolesForApp"); List<CentralV2Role> answer = null; @@ -212,8 +216,8 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets all role functions for an application for older version.", response = CentralRoleFunction.class, responseContainer="Json") - @RequestMapping(value = { - "/functions" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/functions" }, produces = "application/json") public List<CentralRoleFunction> getRoleFunctionsList(HttpServletRequest request, HttpServletResponse response) throws Exception { List<CentralV2RoleFunction> answer = null; @@ -237,8 +241,8 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets all role functions for an application which is upgraded to newer version.", response = CentralV2RoleFunction.class, responseContainer="Json") - @RequestMapping(value = { - "/v1/functions" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/v1/functions" }, produces = "application/json") public List<CentralV2RoleFunction> getV2RoleFunctionsList(HttpServletRequest request, HttpServletResponse response) throws Exception { List<CentralV2RoleFunction> cenRoleFuncList = null; @@ -261,8 +265,8 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl @ApiOperation(value = "Gets role information for an application.", response = CentralRole.class, responseContainer="Json") - @RequestMapping(value = { - "/role/{role_id}" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/role/{role_id}" }, produces = "application/json") public CentralRole getRoleInfo(HttpServletRequest request, HttpServletResponse response, @PathVariable("role_id") Long roleId) throws Exception { CentralV2Role answer = null; @@ -281,8 +285,8 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets v2 role information for an application which is upgraded to newer version.", response = CentralV2Role.class, responseContainer="Json") - @RequestMapping(value = { - "/v1/role/{role_id}" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/v1/role/{role_id}" }, produces = "application/json") public CentralV2Role getV2RoleInfo(HttpServletRequest request, HttpServletResponse response, @PathVariable("role_id") Long roleId) throws Exception { CentralV2Role answer = null; @@ -299,7 +303,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets role information for an application provided by function code.", response = CentralRoleFunction.class, responseContainer = "Json") - @RequestMapping(value = { "/function/{code}" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/function/{code}" }, produces = "application/json") public CentralRoleFunction getRoleFunction(HttpServletRequest request, HttpServletResponse response, @PathVariable("code") String code) throws Exception { CentralV2RoleFunction centralV2RoleFunction = null; @@ -322,7 +326,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets role information for an application provided by function code.", response = CentralV2RoleFunction.class, responseContainer = "Json") - @RequestMapping(value = { "/v1/function/{code}" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/v1/function/{code}" }, produces = "application/json") public CentralV2RoleFunction getV2RoleFunction(HttpServletRequest request, HttpServletResponse response, @PathVariable("code") String code) throws Exception { CentralV2RoleFunction centralV2RoleFunction = null; @@ -344,7 +348,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Saves role function for an application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/roleFunction" }, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { "/roleFunction" }, produces = "application/json") public PortalRestResponse<String> saveRoleFunction(HttpServletRequest request, HttpServletResponse response, @RequestBody String roleFunc) { String status = "Successfully saved!"; @@ -437,7 +441,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Deletes role function for an application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/roleFunction/{code}" }, method = RequestMethod.DELETE, produces = "application/json") + @DeleteMapping(value = { "/roleFunction/{code}" }, produces = "application/json") public PortalRestResponse<String> deleteRoleFunction(HttpServletRequest request, HttpServletResponse response, @PathVariable("code") String code) { if(!DATA_VALIDATOR.isValid(new SecureString(code))){ @@ -492,7 +496,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Saves role for an application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/role" }, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { "/role" }, produces = "application/json") public PortalRestResponse<String> saveRole(HttpServletRequest request, HttpServletResponse response, @RequestBody Role role) { try { @@ -553,7 +557,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Deletes role for an application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/deleteRole/{code}" }, method = RequestMethod.DELETE, produces = "application/json") + @DeleteMapping(value = { "/deleteRole/{code}" }, produces = "application/json") public PortalRestResponse<String> deleteRole(HttpServletRequest request, HttpServletResponse response, @PathVariable String code) { if(!DATA_VALIDATOR.isValid(new SecureString(code))){ @@ -608,7 +612,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets active roles for an application.", response = CentralRole.class, responseContainer = "Json") - @RequestMapping(value = { "/activeRoles" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/activeRoles" }, produces = "application/json") public List<CentralRole> getActiveRoles(HttpServletRequest request, HttpServletResponse response) throws Exception { List<CentralRole> roles = null; try { @@ -624,7 +628,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets active roles for an application.", response = CentralV2Role.class, responseContainer = "Json") - @RequestMapping(value = { "/v1/activeRoles" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/v1/activeRoles" }, produces = "application/json") public List<CentralV2Role> getV2ActiveRoles(HttpServletRequest request, HttpServletResponse response) throws Exception { List<CentralV2Role> cenRole = null; try { @@ -639,7 +643,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "deletes user roles for an application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/deleteDependcyRoleRecord/{roleId}" }, method = RequestMethod.DELETE, produces = "application/json") + @DeleteMapping(value = { "/deleteDependcyRoleRecord/{roleId}" }, produces = "application/json") public PortalRestResponse<String> deleteDependencyRoleRecord(HttpServletRequest request, HttpServletResponse response, @PathVariable("roleId") Long roleId) { ExternalRequestFieldsValidator removeResult = null; @@ -666,7 +670,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl @ApiOperation(value = "deletes roles for an application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/v2/deleteRole/{roleId}" }, method = RequestMethod.DELETE, produces = "application/json") + @DeleteMapping(value = { "/v2/deleteRole/{roleId}" }, produces = "application/json") public PortalRestResponse<String> deleteRole(HttpServletRequest request, HttpServletResponse response, @PathVariable("roleId") Long roleId) { ExternalRequestFieldsValidator removeResult = null; @@ -693,7 +697,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl @ApiOperation(value = "Bulk upload functions for an application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/upload/portal/functions" }, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { "/upload/portal/functions" }, produces = "application/json") public PortalRestResponse<String> bulkUploadFunctions(HttpServletRequest request, HttpServletResponse response) { Integer result = 0; try { @@ -707,7 +711,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Bulk upload roles for an application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/upload/portal/roles" }, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { "/upload/portal/roles" }, produces = "application/json") public PortalRestResponse<String> bulkUploadRoles(HttpServletRequest request, HttpServletResponse response) { Integer result = 0; try { @@ -721,7 +725,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Bulk upload role functions for an application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/upload/portal/roleFunctions" }, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { "/upload/portal/roleFunctions" }, produces = "application/json") public PortalRestResponse<String> bulkUploadRoleFunctions(HttpServletRequest request, HttpServletResponse response) { Integer result = 0; try { @@ -735,7 +739,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Bulk upload user roles for an application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/upload/portal/userRoles" }, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { "/upload/portal/userRoles" }, produces = "application/json") public PortalRestResponse<String> bulkUploadUserRoles(HttpServletRequest request, HttpServletResponse response) { Integer result = 0; try { @@ -749,7 +753,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Bulk upload users for renamed role of an application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/upload/portal/userRole/{roleId}" }, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { "/upload/portal/userRole/{roleId}" }, produces = "application/json") public PortalRestResponse<String> bulkUploadUsersSingleRole(HttpServletRequest request, HttpServletResponse response, @PathVariable Long roleId) { Integer result = 0; try { @@ -764,7 +768,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Bulk upload functions for an partner application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/upload/partner/functions" }, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { "/upload/partner/functions" }, produces = "application/json") public PortalRestResponse<String> bulkUploadPartnerFunctions(HttpServletRequest request, HttpServletResponse response) { Integer addedFunctions = 0; try { @@ -779,7 +783,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Bulk upload roles for an partner application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/upload/partner/roles" }, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { "/upload/partner/roles" }, produces = "application/json") public PortalRestResponse<String> bulkUploadPartnerRoles(HttpServletRequest request, HttpServletResponse response, @RequestBody List<Role> upload) { try { externalAccessRolesService.bulkUploadPartnerRoles(request.getHeader(UEBKEY), upload); @@ -792,7 +796,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Bulk upload role functions for an partner application.", response = PortalRestResponse.class, responseContainer = "Json") - @RequestMapping(value = { "/upload/partner/roleFunctions" }, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { "/upload/partner/roleFunctions" }, produces = "application/json") public PortalRestResponse<String> bulkUploadPartnerRoleFunctions(HttpServletRequest request, HttpServletResponse response) { Integer addedRoleFunctions = 0; try { @@ -808,7 +812,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets all functions along with global functions", response = List.class, responseContainer = "Json") - @RequestMapping(value = { "/menuFunctions" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/menuFunctions" }, produces = "application/json") public List<String> getMenuFunctions(HttpServletRequest request, HttpServletResponse response) throws Exception { List<String> functionsList = null; try { @@ -822,7 +826,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets all active Users of application", response = String.class, responseContainer = "Json") - @RequestMapping(value = { "/users" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/users" }, produces = "application/json") public List<EcompUser> getUsersOfApplication(HttpServletRequest request, HttpServletResponse response) throws Exception { List<EcompUser> users = null; try { @@ -847,7 +851,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl if(app.isEmpty()){ throw new Exception(INVALID_UEB_KEY); } - if(!app.isEmpty() && app.get(0).getCentralAuth()){ + if(!app.isEmpty() && app.get(0).getRolesInAAF()){ ResponseEntity<String> response = externalAccessRolesService.getNameSpaceIfExists(app.get(0)); if (response.getStatusCode().value() == HttpServletResponse.SC_NOT_FOUND) throw new Exception("Invalid NameSpace"); @@ -882,7 +886,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets ecompUser of an application.", response = CentralUser.class, responseContainer = "List") - @RequestMapping(value = { "/v2/user/{loginId}" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/v2/user/{loginId}" }, produces = "application/json") public String getEcompUser(HttpServletRequest request, HttpServletResponse response, @PathVariable("loginId") String loginId) throws Exception { if(!DATA_VALIDATOR.isValid(new SecureString(loginId))){ @@ -913,7 +917,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl } @ApiOperation(value = "Gets user ecomp role for an application.", response = CentralUser.class, responseContainer = "List") - @RequestMapping(value = { "/v2/roles" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/v2/roles" }, produces = "application/json") public List<EcompRole> getEcompRolesOfApplication(HttpServletRequest request, HttpServletResponse response) throws Exception { List<EcompRole> ecompRoles = null; diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java index d77475ca..d43d9f3e 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java @@ -6,6 +6,8 @@ * =================================================================== * Modifications Copyright (c) 2019 Samsung * =================================================================== + * Modification Copyright © 2020 IBM. + * =================================================================== * * Unless otherwise specified, all software contained herein is licensed * under the Apache License, Version 2.0 (the "License"); @@ -82,7 +84,8 @@ import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ExceptionHandler; 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.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; @@ -114,7 +117,7 @@ public class ExternalAppsRestfulController extends EPRestrictedRESTfulBaseContro private EPRoleService epRoleService; @ApiOperation(value = "Creates a Portal user notification for roles identified in the content from an external application.", response = PortalAPIResponse.class) - @RequestMapping(value = { "/publishNotification" }, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { "/publishNotification" }, produces = "application/json") @ResponseBody public PortalAPIResponse publishNotification(HttpServletRequest request, @RequestBody EpNotificationItem notificationItem) throws Exception { @@ -174,7 +177,7 @@ public class ExternalAppsRestfulController extends EPRestrictedRESTfulBaseContro } @ApiOperation(value = "Gets favorite items within the functional menu for the current user.", response = FavoritesFunctionalMenuItemJson.class, responseContainer="List") - @RequestMapping(value = { "/getFavorites" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/getFavorites" }, produces = "application/json") public List<FavoritesFunctionalMenuItemJson> getFavoritesForUser(HttpServletRequest request, HttpServletResponse response) throws Exception { String loginId = ""; @@ -203,8 +206,8 @@ public class ExternalAppsRestfulController extends EPRestrictedRESTfulBaseContro } @ApiOperation(value = "Gets functional menu items appropriate for the current user.", response = FunctionalMenuItem.class, responseContainer="List") - @RequestMapping(value = { - "/functionalMenuItemsForUser" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/functionalMenuItemsForUser" }, produces = "application/json") public List<FunctionalMenuItem> getFunctionalMenuItemsForUser(HttpServletRequest request, HttpServletResponse response) throws Exception { String loginId = ""; @@ -246,7 +249,7 @@ public class ExternalAppsRestfulController extends EPRestrictedRESTfulBaseContro } @EPAuditLog - @RequestMapping(value = { "/validateCookie" }, method = RequestMethod.POST) + @PostMapping(value = { "/validateCookie" }) public boolean validateCookie(@RequestBody EPServiceCookie epServiceCookie, HttpServletRequest request) throws Exception { Map<String,String> epServiceCookieValueMap = epServiceCookie.getValue(); if(epServiceCookieValueMap!=null) { 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 4a94748b..3442d5a6 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 @@ -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"); @@ -81,8 +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.RequestMethod; +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.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -116,7 +120,7 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * HttpServletResponse * @return List of FunctionalMenuItem objects */ - @RequestMapping(value = { "/portalApi/functionalMenu" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/portalApi/functionalMenu" }, produces = "application/json") public List<FunctionalMenuItem> getMenuItems(HttpServletRequest request, HttpServletResponse response) { // TODO: should only the superuser be allowed to use this API? List<FunctionalMenuItem> menuItems = null; @@ -139,7 +143,7 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * HttpServletResponse * @return PortalRestResponse of ONAP portal title */ - @RequestMapping(value = { "/portalApi/ecompTitle" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/portalApi/ecompTitle" }, produces = "application/json") public PortalRestResponse<String> getECOMPTitle(HttpServletRequest request, HttpServletResponse response) { PortalRestResponse<String> portalRestResponse = null; try { @@ -164,8 +168,8 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * HttpServletResponse * @return List of FunctionalMenuItem objects */ - @RequestMapping(value = { - "/portalApi/functionalMenuForEditing" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/functionalMenuForEditing" }, produces = "application/json") public List<FunctionalMenuItem> getMenuItemsForEditing(HttpServletRequest request, HttpServletResponse response) { // TODO: should only the superuser be allowed to use this API? EPUser user = EPUserUtils.getUserSession(request); @@ -194,8 +198,8 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * HttpServletResponse * @return List of FunctionalMenuItem objects */ - @RequestMapping(value = { - "/portalApi/functionalMenuForNotificationTree" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/functionalMenuForNotificationTree" }, produces = "application/json") public List<FunctionalMenuItem> getMenuItemsForNotifications(HttpServletRequest request, HttpServletResponse response) { // TODO: should only the superuser be allowed to use this API? @@ -221,8 +225,8 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * application ID * @return List of FunctionalMenuItem objects */ - @RequestMapping(value = { - "/portalApi/functionalMenuForApp/{appId}" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/functionalMenuForApp/{appId}" }, produces = "application/json") public List<FunctionalMenuItem> getMenuItemsForApp(HttpServletRequest request, @PathVariable("appId") Integer appId) { // TODO: should only the superuser be allowed to use this API? @@ -248,8 +252,8 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * user ID * @return List of FunctionalMenuItem objects */ - @RequestMapping(value = { - "/portalApi/functionalMenuForUser/{orgUserId}" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/functionalMenuForUser/{orgUserId}" }, produces = "application/json") public List<FunctionalMenuItem> getMenuItemsForUser(HttpServletRequest request, @PathVariable("orgUserId") String orgUserId) { // TODO: should only the superuser be allowed to use this API? @@ -276,8 +280,8 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * HttpServletResponse * @return List of FunctionalMenuItem objects */ - @RequestMapping(value = { - "/portalApi/functionalMenuForAuthUser" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/functionalMenuForAuthUser" }, produces = "application/json") public List<FunctionalMenuItem> getMenuItemsForAuthUser(HttpServletRequest request, HttpServletResponse response) { EPUser user = EPUserUtils.getUserSession(request); @@ -313,8 +317,8 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * menu ID * @return FunctionalMenuItem object */ - @RequestMapping(value = { - "/portalApi/functionalMenuItemDetails/{menuId}" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/functionalMenuItemDetails/{menuId}" }, produces = "application/json") public FunctionalMenuItem getFunctionalMenuItemDetails(HttpServletRequest request, @PathVariable("menuId") Long menuId, HttpServletResponse response) { // TODO: return FunctionalMenuItemJson @@ -349,7 +353,7 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * FunctionalMenuItemWithRoles * @return FieldsValidator */ - @RequestMapping(value = { "/portalApi/functionalMenuItem" }, method = RequestMethod.POST) + @PostMapping(value = { "/portalApi/functionalMenuItem" }) public FieldsValidator createFunctionalMenuItem(HttpServletRequest request, @RequestBody FunctionalMenuItemWithRoles menuItemJson, HttpServletResponse response) { EPUser user = EPUserUtils.getUserSession(request); @@ -389,7 +393,7 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * FunctionalMenuItemWithRoles * @return FieldsValidator */ - @RequestMapping(value = { "/portalApi/functionalMenuItem" }, method = RequestMethod.PUT) + @PutMapping(value = { "/portalApi/functionalMenuItem" }) public FieldsValidator editFunctionalMenuItem(HttpServletRequest request, @RequestBody FunctionalMenuItemWithRoles menuItemJson, HttpServletResponse response) { EPUser user = EPUserUtils.getUserSession(request); @@ -425,7 +429,7 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * menu identifier * @return FieldsValidator */ - @RequestMapping(value = { "/portalApi/functionalMenuItem/{menuId}" }, method = RequestMethod.DELETE) + @DeleteMapping(value = { "/portalApi/functionalMenuItem/{menuId}" }) public FieldsValidator deleteFunctionalMenuItem(HttpServletRequest request, @PathVariable("menuId") Long menuId, HttpServletResponse response) { EPUser user = EPUserUtils.getUserSession(request); @@ -451,7 +455,7 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * HttpServletResponse * @return FieldsValidator */ - @RequestMapping(value = { "/portalApi/regenerateFunctionalMenuAncestors" }, method = RequestMethod.GET) + @GetMapping(value = { "/portalApi/regenerateFunctionalMenuAncestors" }) public FieldsValidator regenerateAncestorTable(HttpServletRequest request, HttpServletResponse response) { // TODO: should only the superuser be allowed to use this API? EPUser user = EPUserUtils.getUserSession(request); @@ -480,7 +484,7 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * FunctionalMenuItemWithRoles * @return FieldsValidator */ - @RequestMapping(value = { "/portalApi/setFavoriteItem" }, method = RequestMethod.POST) + @PostMapping(value = { "/portalApi/setFavoriteItem" }) public FieldsValidator addFavoriteItem(HttpServletRequest request, @RequestBody FavoritesFunctionalMenuItem menuItemJson, HttpServletResponse response) { EPUser user = EPUserUtils.getUserSession(request); @@ -504,8 +508,8 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * HttpServletResponse * @return List of FavoritesFunctionalMenuItemJson */ - @RequestMapping(value = { - "/portalApi/getFavoriteItems" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/getFavoriteItems" }, produces = "application/json") public List<FavoritesFunctionalMenuItemJson> getFavoritesForUser(HttpServletRequest request, HttpServletResponse response) { EPUser user = EPUserUtils.getUserSession(request); @@ -529,7 +533,7 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * menu identifier * @return FieldsValidator */ - @RequestMapping(value = { "/portalApi/removeFavoriteItem/{menuId}" }, method = RequestMethod.DELETE) + @DeleteMapping(value = { "/portalApi/removeFavoriteItem/{menuId}" }) public FieldsValidator deleteFavoriteItem(HttpServletRequest request, @PathVariable("menuId") Long menuId, HttpServletResponse response) { EPUser user = EPUserUtils.getUserSession(request); @@ -556,8 +560,8 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * HttpServletResponse * @return JSON collection of key-value pairs shown below. */ - @RequestMapping(value = { - "/portalApi/functionalMenuStaticInfo" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/functionalMenuStaticInfo" }, produces = "application/json") public String getFunctionalMenuStaticInfo(HttpServletRequest request, HttpServletResponse response) { // Get user details from session @@ -569,14 +573,20 @@ public class FunctionalMenuController extends EPRestrictedBaseController { 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(); @@ -616,6 +626,7 @@ public class FunctionalMenuController extends EPRestrictedBaseController { 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 @@ -648,8 +659,8 @@ public class FunctionalMenuController extends EPRestrictedBaseController { * @throws IOException * on error */ - @RequestMapping(value = { - "/portalApi/userApplicationRoles" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/userApplicationRoles" }, produces = "application/json") public List<BusinessCardApplicationRolesList> getAppList(HttpServletRequest request, HttpServletResponse response, @RequestParam("userId") String userId) throws IOException { diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/GetAccessController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/GetAccessController.java index d8bf7ddf..6124544e 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/GetAccessController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/GetAccessController.java @@ -46,8 +46,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.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.onap.portalapp.controller.EPUnRestrictedBaseController; import org.onap.portalapp.portal.domain.EPUser; @@ -78,7 +77,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); diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/HealthCheckController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/HealthCheckController.java index ca66809f..0acfabfe 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/HealthCheckController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/HealthCheckController.java @@ -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"); @@ -45,8 +47,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.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.onap.music.main.MusicUtil; import org.onap.portalapp.controller.EPUnRestrictedBaseController; @@ -118,7 +119,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 +230,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 +244,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 +256,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()); diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java index 508b1be2..0046bc59 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java @@ -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,7 +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.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; import com.alibaba.fastjson.JSONObject; @@ -33,19 +36,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); diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ManifestController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ManifestController.java index 471ebe55..5e3212ec 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ManifestController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ManifestController.java @@ -47,7 +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.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import org.onap.portalapp.portal.logging.aop.EPAuditLog; @@ -91,7 +91,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>(); diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceController.java index 89e8fe75..a80a3b42 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceController.java @@ -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"); @@ -63,8 +65,10 @@ import org.springframework.http.HttpMethod; 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.RequestMethod; +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.RestController; import org.springframework.web.client.RestTemplate; @@ -85,7 +89,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 +112,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 +139,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 { diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceProxyController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceProxyController.java index fed3b98e..8bf93549 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceProxyController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceProxyController.java @@ -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"); @@ -51,8 +53,7 @@ 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.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.HttpClientErrorException; @@ -69,8 +70,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 +83,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); @@ -104,9 +103,16 @@ public class MicroserviceProxyController extends EPUnRestrictedBaseController { */ private boolean isValidJSON(String response) { try { + if(response != null && !response.isEmpty()) + { final ObjectMapper mapper = new ObjectMapper(); mapper.readTree(response); return true; + } + else + { + return false; + } } catch (IOException e) { logger.debug(EELFLoggerDelegate.debugLogger, "isValidJSON failed", e); return false; diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java index 32b28c7d..0cc3e3fa 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java @@ -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"); @@ -68,8 +70,9 @@ 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.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.RestController; @RestController @@ -92,7 +95,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 +123,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 +170,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 +228,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); 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 e2dd6588..4b983d8d 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"); + * 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 @@ -95,8 +97,8 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy; 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.RequestMethod; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -154,7 +156,7 @@ public class RoleManageController extends EPRestrictedBaseController { * @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 { @@ -162,7 +164,7 @@ public class RoleManageController extends EPRestrictedBaseController { EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth()) { + if (requestedApp.getRolesInAAF()) { List<CentralV2Role> answer = null; Map<String, Object> model = new HashMap<>(); ObjectMapper mapper = new ObjectMapper(); @@ -183,7 +185,7 @@ public class RoleManageController extends EPRestrictedBaseController { } } - @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 +229,7 @@ public class RoleManageController extends EPRestrictedBaseController { 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 { @@ -240,7 +242,7 @@ public class RoleManageController extends EPRestrictedBaseController { requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth()) { + if (requestedApp.getRolesInAAF()) { externalRequestFieldsValidator = externalAccessRolesService.deleteDependencyRoleRecord(roleId, requestedApp.getUebKey(), user.getOrgUserId()); boolean deleteResponse = externalRequestFieldsValidator.isResult(); @@ -293,7 +295,7 @@ public class RoleManageController extends EPRestrictedBaseController { 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); @@ -303,7 +305,7 @@ public class RoleManageController extends EPRestrictedBaseController { EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp != null && requestedApp.getCentralAuth().equals(true)) { + if (requestedApp != null && requestedApp.getRolesInAAF().equals(true)) { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); JsonNode root = mapper.readTree(request.getReader()); @@ -415,29 +417,29 @@ public class RoleManageController extends EPRestrictedBaseController { 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 { @@ -446,7 +448,7 @@ public class RoleManageController extends EPRestrictedBaseController { EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth()) { + if (requestedApp.getRolesInAAF()) { CentralV2Role answer = externalAccessRolesService.getRoleInfo(roleId, requestedApp.getUebKey()); logger.info(EELFLoggerDelegate.applicationLogger, "role_id" + roleId); Map<String, Object> model = new HashMap<>(); @@ -471,7 +473,7 @@ public class RoleManageController extends EPRestrictedBaseController { } } - @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 { @@ -479,7 +481,7 @@ public class RoleManageController extends EPRestrictedBaseController { EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth()) { + if (requestedApp.getRolesInAAF()) { List<CentralV2RoleFunction> answer = null; Map<String, Object> model = new HashMap<>(); ObjectMapper mapper = new ObjectMapper(); @@ -502,7 +504,7 @@ public class RoleManageController extends EPRestrictedBaseController { } } - @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) { @@ -521,7 +523,7 @@ public class RoleManageController extends EPRestrictedBaseController { EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth() && roleFunc!=null) { + if (requestedApp.getRolesInAAF() && roleFunc!=null) { String code = roleFunc.getType() + PIPE + roleFunc.getCode() + PIPE + roleFunc.getAction(); CentralV2RoleFunction domainRoleFunction = externalAccessRolesService.getRoleFunction(code, requestedApp.getUebKey()); @@ -599,7 +601,7 @@ public class RoleManageController extends EPRestrictedBaseController { } } - @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); @@ -620,7 +622,7 @@ public class RoleManageController extends EPRestrictedBaseController { EPApp requestedApp = appService.getApp(appId); if (isAuthorizedUser(user, requestedApp)) { fieldsValidation(requestedApp); - if (requestedApp.getCentralAuth()) { + if (requestedApp.getRolesInAAF()) { ObjectMapper mapper = new ObjectMapper(); String data = roleFunc; boolean getDelFuncResponse = false; @@ -676,7 +678,7 @@ public class RoleManageController extends EPRestrictedBaseController { 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 +721,7 @@ public class RoleManageController extends EPRestrictedBaseController { 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 +743,7 @@ public class RoleManageController extends EPRestrictedBaseController { 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); @@ -807,7 +809,7 @@ public class RoleManageController extends EPRestrictedBaseController { throw new InvalidApplicationException("Invalid credentials"); } if (!appInfo.isEmpty() && EcompPortalUtils.checkIfRemoteCentralAccessAllowed() - && appInfo.get(0).getCentralAuth()) { + && appInfo.get(0).getRolesInAAF()) { ResponseEntity<String> response = externalAccessRolesService.getNameSpaceIfExists(appInfo.get(0)); if (response.getStatusCode().value() == HttpServletResponse.SC_NOT_FOUND) throw new InvalidApplicationException("Invalid NameSpace"); @@ -826,8 +828,8 @@ public class RoleManageController extends EPRestrictedBaseController { 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 5562caac..5b953b6e 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 @@ -56,7 +56,9 @@ import org.springframework.context.annotation.Configuration; 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.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.RestController; import io.swagger.annotations.ApiOperation; @@ -81,7 +83,7 @@ public class RolesApprovalSystemController implements BasicAuthenticationControl * @return PortalRestResponse with appropriate status value and message */ @ApiOperation(value = "Creates an application user with the specified roles.", response = PortalRestResponse.class) - @RequestMapping(value = { "/userProfile" }, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { "/userProfile" }, produces = "application/json") public PortalRestResponse<String> postUserProfile(HttpServletRequest request, @RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) { ExternalRequestFieldsValidator reqResult = null; @@ -129,7 +131,7 @@ public class RolesApprovalSystemController implements BasicAuthenticationControl * @return PortalRestResponse with appropriate status value and message */ @ApiOperation(value = "Updates an application user to have only the specified roles.", response = PortalRestResponse.class) - @RequestMapping(value = { "/userProfile" }, method = RequestMethod.PUT, produces = "application/json") + @PutMapping(value = { "/userProfile" }, produces = "application/json") public PortalRestResponse<String> putUserProfile(HttpServletRequest request, @RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) { ExternalRequestFieldsValidator reqResult = null; @@ -176,7 +178,7 @@ public class RolesApprovalSystemController implements BasicAuthenticationControl * @return PortalRestResponse with appropriate status value and message */ @ApiOperation(value = "Processes a request to delete one or more application roles for one specified user who has roles.", response = PortalRestResponse.class) - @RequestMapping(value = { "/userProfile" }, method = RequestMethod.DELETE, produces = "application/json") + @DeleteMapping(value = { "/userProfile" }, produces = "application/json") public PortalRestResponse<String> deleteUserProfile(HttpServletRequest request, @RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) { ExternalRequestFieldsValidator reqResult = null; @@ -219,9 +221,9 @@ public class RolesApprovalSystemController implements BasicAuthenticationControl * 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 c99953fa..20fddf91 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; @@ -61,6 +58,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; 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; @@ -78,7 +76,7 @@ public class SchedulerAuxController extends EPRestrictedBaseController { /** The logger. */ private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerAuxController.class); - @RequestMapping(value = "/get_policy", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/get_policy", produces = "application/json") public ResponseEntity<String> getPolicyInfo(HttpServletRequest request) throws Exception { try { diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerController.java index 69f25683..53275763 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerController.java @@ -77,6 +77,8 @@ 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.RequestMethod; import org.springframework.web.bind.annotation.RestController; @@ -102,7 +104,7 @@ public class SchedulerController extends EPRestrictedBaseController { this.adminRolesService = adminRolesService; } - @RequestMapping(value = "/get_time_slots/{scheduler_request}", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/get_time_slots/{scheduler_request}", produces = "application/json") public ResponseEntity<String> getTimeSlots(HttpServletRequest request, @PathVariable("scheduler_request") String schedulerRequest) throws Exception { if (checkIfUserISValidToMakeSchedule(request)) { @@ -169,7 +171,7 @@ public class SchedulerController extends EPRestrictedBaseController { } @SuppressWarnings("unchecked") - @RequestMapping(value = "/post_create_new_vnf_change", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/post_create_new_vnf_change", produces = "application/json") public ResponseEntity<String> postCreateNewVNFChange(HttpServletRequest request, @RequestBody JSONObject schedulerRequest) throws Exception { if (checkIfUserISValidToMakeSchedule(request)) { @@ -249,7 +251,7 @@ public class SchedulerController extends EPRestrictedBaseController { } } - @RequestMapping(value = "/submit_vnf_change_timeslots", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/submit_vnf_change_timeslots", produces = "application/json") public ResponseEntity<String> postSubmitVnfChangeTimeslots(HttpServletRequest request, @RequestBody JSONObject schedulerRequest) throws Exception { if (checkIfUserISValidToMakeSchedule(request)) { @@ -335,7 +337,7 @@ public class SchedulerController extends EPRestrictedBaseController { * @return Rest response wrapped around a String; e.g., "success" or "ERROR" * @throws Exception */ - @RequestMapping(value = "/get_scheduler_constant", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/get_scheduler_constant", produces = "application/json") public PortalRestResponse<Map<String, String>> getSchedulerConstant(HttpServletRequest request, HttpServletResponse response) throws Exception { logger.debug(EELFLoggerDelegate.debugLogger, "get scheduler constant"); diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SharedContextRestController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SharedContextRestController.java index 9e3428e6..232b691f 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SharedContextRestController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SharedContextRestController.java @@ -63,6 +63,8 @@ import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ExceptionHandler; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -114,7 +116,7 @@ public class SharedContextRestController extends EPRestrictedRESTfulBaseControll * on bad arguments */ @ApiOperation(value = "Gets a value for the specified context and key.", response = SharedContext.class) - @RequestMapping(value = { "/get" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/get" }, produces = "application/json") public String getContext(HttpServletRequest request, @RequestParam String context_id, @RequestParam String ckey) throws Exception { logger.debug(EELFLoggerDelegate.debugLogger, "getContext for ID " + context_id + ", key " + ckey); @@ -151,7 +153,7 @@ public class SharedContextRestController extends EPRestrictedRESTfulBaseControll * on bad arguments */ @ApiOperation(value = "Gets user information for the specified context.", response = SharedContext.class, responseContainer = "List") - @RequestMapping(value = { "/get_user" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/get_user" }, produces = "application/json") public String getUserContext(HttpServletRequest request, @RequestParam String context_id) throws Exception { logger.debug(EELFLoggerDelegate.debugLogger, "getUserContext for ID " + context_id); @@ -197,7 +199,7 @@ public class SharedContextRestController extends EPRestrictedRESTfulBaseControll * on bad arguments */ @ApiOperation(value = "Tests for presence of the specified key in the specified context.", response = SharedContextJsonResponse.class) - @RequestMapping(value = { "/check" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/check" }, produces = "application/json") public String checkContext(HttpServletRequest request, @RequestParam String context_id, @RequestParam String ckey) throws Exception { @@ -236,7 +238,7 @@ public class SharedContextRestController extends EPRestrictedRESTfulBaseControll * on bad arguments */ @ApiOperation(value = "Removes the specified key in the specified context.", response = SharedContextJsonResponse.class) - @RequestMapping(value = { "/remove" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/remove" }, produces = "application/json") public String removeContext(HttpServletRequest request, @RequestParam String context_id, @RequestParam String ckey) throws Exception { @@ -275,7 +277,7 @@ public class SharedContextRestController extends EPRestrictedRESTfulBaseControll * on bad arguments */ @ApiOperation(value = "Clears all key-value pairs in the specified context.", response = SharedContextJsonResponse.class) - @RequestMapping(value = { "/clear" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/clear" }, produces = "application/json") public String clearContext(HttpServletRequest request, @RequestParam String context_id) throws Exception { logger.debug(EELFLoggerDelegate.debugLogger, "clearContext for " + context_id); @@ -311,7 +313,7 @@ public class SharedContextRestController extends EPRestrictedRESTfulBaseControll * on bad arguments */ @ApiOperation(value = "Sets a context value for the specified context and key. Creates the context if no context with the specified ID-key pair exists, overwrites the value if it exists already.", response = SharedContextJsonResponse.class) - @RequestMapping(value = { "/set" }, method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = { "/set" }, produces = "application/json") public String setContext(HttpServletRequest request, @RequestBody String userJson) throws Exception { if (userJson !=null){ SecureString secureUserJson = new SecureString(userJson); diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/TicketEventController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/TicketEventController.java index 56a4df3d..26559ae9 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/TicketEventController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/TicketEventController.java @@ -67,6 +67,7 @@ import org.springframework.context.annotation.Configuration; 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.PostMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @@ -105,7 +106,7 @@ public class TicketEventController implements BasicAuthenticationController { @ApiOperation( value = "Accepts messages from external ticketing systems and creates notifications for Portal users.", response = PortalRestResponse.class) - @RequestMapping(value = { "/ticketevent" }, method = RequestMethod.POST) + @PostMapping(value = { "/ticketevent" }) public PortalRestResponse<String> handleRequest(HttpServletRequest request, HttpServletResponse response, @RequestBody String ticketEventJson) throws Exception { diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserController.java index fc76a0e6..eec14f71 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserController.java @@ -55,6 +55,8 @@ 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.GetMapping; +import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @@ -79,7 +81,7 @@ public class UserController extends EPRestrictedBaseController { * * @return PortalRestResponse of EPUser */ - @RequestMapping(value = { "/portalApi/loggedinUser" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/portalApi/loggedinUser" }, produces = "application/json") public PortalRestResponse<ProfileDetail> getLoggedinUser(HttpServletRequest request) { PortalRestResponse<ProfileDetail> portalRestResponse = null; try { @@ -106,8 +108,8 @@ public class UserController extends EPRestrictedBaseController { * Body with user information * @return PortalRestResponse of String */ - @RequestMapping(value = { - "/portalApi/modifyLoggedinUser" }, method = RequestMethod.PUT, produces = "application/json") + @PutMapping(value = { + "/portalApi/modifyLoggedinUser" }, produces = "application/json") public PortalRestResponse<String> modifyLoggedinUser(HttpServletRequest request, @RequestBody ProfileDetail profileDetail) { PortalRestResponse<String> portalRestResponse = null; 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 0dfccc9c..8b874621 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, @@ -49,8 +51,8 @@ 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.RequestMethod; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.onap.portalapp.controller.EPRestrictedBaseController; @@ -87,8 +89,8 @@ public class UserNotificationController extends EPRestrictedBaseController { 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 +98,8 @@ public class UserNotificationController extends EPRestrictedBaseController { 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 +116,8 @@ public class UserNotificationController extends EPRestrictedBaseController { 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 +125,7 @@ public class UserNotificationController extends EPRestrictedBaseController { 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 +162,8 @@ public class UserNotificationController extends EPRestrictedBaseController { 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 +180,8 @@ public class UserNotificationController extends EPRestrictedBaseController { } } - @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 +193,8 @@ public class UserNotificationController extends EPRestrictedBaseController { } } - @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 +202,7 @@ public class UserNotificationController extends EPRestrictedBaseController { 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 +212,7 @@ public class UserNotificationController extends EPRestrictedBaseController { 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 +225,8 @@ public class UserNotificationController extends EPRestrictedBaseController { 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 aa180b0e..906563cf 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.HttpServletRequest; 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.aop.EPEELFLoggerAdvice; 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; @@ -84,8 +82,8 @@ 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.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -119,7 +117,7 @@ public class UserRolesController extends EPRestrictedBaseController { * @param response HttpServletResponse * @return array of found users as json */ - @RequestMapping(value = { "/portalApi/queryUsers" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/portalApi/queryUsers" }, produces = "application/json") public String getPhoneBookSearchResult(HttpServletRequest request, @RequestParam("search") String searchString, HttpServletResponse response) { EPUser user = EPUserUtils.getUserSession(request); @@ -149,8 +147,7 @@ public class UserRolesController extends EPRestrictedBaseController { * @param response HttpServletResponse * @return for GET: array of all applications with boolean isAdmin=true/false for each application */ - @RequestMapping(value = { "/portalApi/adminAppsRoles" }, method = { - RequestMethod.GET }, produces = "application/json") + @GetMapping(value = { "/portalApi/adminAppsRoles" }, produces = "application/json") public AppsListWithAdminRole getAppsWithAdminRoleStateForUser(HttpServletRequest request, @RequestParam("user") String orgUserId, HttpServletResponse response) { @@ -200,8 +197,7 @@ public class UserRolesController extends EPRestrictedBaseController { * @param response HttpServletResponse * @return FieldsValidator */ - @RequestMapping(value = { "/portalApi/adminAppsRoles" }, method = { - RequestMethod.PUT }, produces = "application/json") + @PutMapping(value = { "/portalApi/adminAppsRoles" }, produces = "application/json") public FieldsValidator putAppsWithAdminRoleStateForUser(HttpServletRequest request, @RequestBody AppsListWithAdminRole newAppsListWithAdminRoles, HttpServletResponse response) { @@ -277,8 +273,7 @@ public class UserRolesController extends EPRestrictedBaseController { * @param extRequestValue set to false if request is from users page otherwise true * @return List<RoleInAppForUser> */ - @RequestMapping(value = { "/portalApi/userAppRoles" }, method = { - RequestMethod.GET }, produces = "application/json") + @GetMapping(value = { "/portalApi/userAppRoles" }, produces = "application/json") public List<RoleInAppForUser> getAppRolesForUser(HttpServletRequest request, @RequestParam("user") String orgUserId, @RequestParam("app") Long appid, @RequestParam("externalRequest") Boolean extRequestValue, @RequestParam("isSystemUser") Boolean isSystemUser, @@ -356,8 +351,7 @@ public class UserRolesController extends EPRestrictedBaseController { return result; } - @RequestMapping(value = { "/portalApi/userAppRoles" }, method = { - RequestMethod.PUT }, produces = "application/json") + @PutMapping(value = { "/portalApi/userAppRoles" }, produces = "application/json") public PortalRestResponse<String> putAppWithUserRoleStateForUser(HttpServletRequest request, @RequestBody AppWithRolesForUser newAppRolesForUser, HttpServletResponse response) { // FieldsValidator fieldsValidator = new FieldsValidator(); @@ -437,8 +431,7 @@ public class UserRolesController extends EPRestrictedBaseController { return portalResponse; } - @RequestMapping(value = { "/portalApi/updateRemoteUserProfile" }, method = { - RequestMethod.GET }, produces = "application/json") + @GetMapping(value = { "/portalApi/updateRemoteUserProfile" }, produces = "application/json") public PortalRestResponse<String> updateRemoteUserProfile(HttpServletRequest request, HttpServletResponse response) { @@ -457,8 +450,7 @@ public class UserRolesController extends EPRestrictedBaseController { } - @RequestMapping(value = { "/portalApi/app/{appId}/users" }, method = { - RequestMethod.GET }, produces = "application/json") + @GetMapping(value = { "/portalApi/app/{appId}/users" }, produces = "application/json") public List<UserApplicationRoles> getUsersFromAppEndpoint(HttpServletRequest request, @PathVariable("appId") Long appId) throws HTTPException { try { @@ -470,8 +462,7 @@ public class UserRolesController extends EPRestrictedBaseController { } } - @RequestMapping(value = { "/portalApi/app/{appId}/roles" }, method = { - RequestMethod.GET }, produces = "application/json") + @GetMapping(value = { "/portalApi/app/{appId}/roles" }, produces = "application/json") public List<EcompRole> testGetRoles(HttpServletRequest request, @PathVariable("appId") Long appId) throws HTTPException { EcompRole[] appRoles = applicationsRestClientService.get(EcompRole[].class, appId, "/roles"); @@ -482,8 +473,7 @@ public class UserRolesController extends EPRestrictedBaseController { return rolesList; } - @RequestMapping(value = { "/portalApi/admin/import/app/{appId}/roles" }, method = { - RequestMethod.GET }, produces = "application/json") + @GetMapping(value = { "/portalApi/admin/import/app/{appId}/roles" }, produces = "application/json") public List<EPRole> importRolesFromRemoteApplication(HttpServletRequest request, @PathVariable("appId") Long appId) throws HTTPException { List<EPRole> rolesList = userRolesService.importRolesFromRemoteApplication(appId); @@ -493,8 +483,7 @@ public class UserRolesController extends EPRestrictedBaseController { return rolesList; } - @RequestMapping(value = { "/portalApi/app/{appId}/user/{orgUserId}/roles" }, method = { - RequestMethod.GET }, produces = "application/json") + @GetMapping(value = { "/portalApi/app/{appId}/user/{orgUserId}/roles" }, produces = "application/json") public EcompRole testGetRoles(HttpServletRequest request, @PathVariable("appId") Long appId, @PathVariable("orgUserId") String orgUserId) throws Exception { if (!EcompPortalUtils.legitimateUserId(orgUserId)) { @@ -515,8 +504,7 @@ public class UserRolesController extends EPRestrictedBaseController { return roles[0]; } - @RequestMapping(value = { "/portalApi/saveUserAppRoles" }, method = { - RequestMethod.PUT }, produces = "application/json") + @PutMapping(value = { "/portalApi/saveUserAppRoles" }, produces = "application/json") public FieldsValidator putAppWithUserRoleRequest(HttpServletRequest request, @RequestBody AppWithRolesForUser newAppRolesForUser, HttpServletResponse response) { FieldsValidator fieldsValidator = null; @@ -536,8 +524,7 @@ public class UserRolesController extends EPRestrictedBaseController { return fieldsValidator; } - @RequestMapping(value = { "/portalApi/appCatalogRoles" }, method = { - RequestMethod.GET }, produces = "application/json") + @GetMapping(value = { "/portalApi/appCatalogRoles" }, produces = "application/json") public List<EPUserAppCatalogRoles> getUserAppCatalogRoles(HttpServletRequest request, @RequestParam("appName") String appName) { EPUser user = EPUserUtils.getUserSession(request); @@ -562,7 +549,7 @@ public class UserRolesController extends EPRestrictedBaseController { } }; - @RequestMapping(value = "/portalApi/externalRequestAccessSystem", method = RequestMethod.GET, + @GetMapping(value = "/portalApi/externalRequestAccessSystem", produces = "application/json") public ExternalSystemAccess readExternalRequestAccess(HttpServletRequest request) { ExternalSystemAccess result = null; @@ -576,8 +563,7 @@ public class UserRolesController extends EPRestrictedBaseController { return result; } - @RequestMapping(value = { "/portalApi/checkIfUserIsSuperAdmin" }, method = RequestMethod.GET, - produces = "application/json") + @GetMapping(value = { "/portalApi/checkIfUserIsSuperAdmin" }, produces = "application/json") public boolean checkIfUserIsSuperAdmin(HttpServletRequest request, HttpServletResponse response) { EPUser user = EPUserUtils.getUserSession(request); 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 92449a3a..929ac474 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,7 +79,8 @@ import org.springframework.util.concurrent.ListenableFuture; 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.RequestMethod; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.AsyncRestTemplate; @@ -117,7 +120,7 @@ public class WebAnalyticsExtAppController extends EPRestrictedRESTfulBaseControl * @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 +165,7 @@ public class WebAnalyticsExtAppController extends EPRestrictedRESTfulBaseControl * 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/WidgetMSController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetMSController.java index eab811ab..9ba56224 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetMSController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetMSController.java @@ -48,7 +48,7 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController @@ -60,7 +60,7 @@ public class WidgetMSController extends EPRestrictedBaseController { private WidgetMService widgetMService; // Get location of a healthy node running our service - @RequestMapping(value = { "/service/{service}" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/service/{service}" }, produces = "application/json") public PortalRestResponse<String> getServiceLocation(HttpServletRequest request, HttpServletResponse response, @PathVariable("service") String service) { 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 015e6c46..e2cd13c8 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 @@ package org.onap.portalapp.portal.controller; 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; @@ -81,8 +80,10 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; 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.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.RestController; import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; @@ -136,7 +137,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController { }); } - @RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{loginName}" }, method = RequestMethod.GET) + @GetMapping(value = { "/portalApi/microservices/widgetCatalog/{loginName}" }) public List<WidgetCatalog> getUserWidgetCatalog(@PathVariable("loginName") String loginName) { List<WidgetCatalog> widgets = new ArrayList<>(); try { @@ -156,7 +157,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController { return widgets; } - @RequestMapping(value = { "/portalApi/microservices/widgetCatalog" }, method = RequestMethod.GET) + @GetMapping(value = { "/portalApi/microservices/widgetCatalog" }) public List<WidgetCatalog> getWidgetCatalog() { List<WidgetCatalog> widgets = new ArrayList<>(); try { @@ -176,8 +177,8 @@ public class WidgetsCatalogController extends EPRestrictedBaseController { return widgets; } - @RequestMapping(value = { - "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.PUT, produces = "application/json") + @PutMapping(value = { + "/portalApi/microservices/widgetCatalog/{widgetId}" }, produces = "application/json") public void updateWidgetCatalog(@RequestBody WidgetCatalog newWidgetCatalog, @PathVariable("widgetId") long widgetId) throws Exception { template.exchange( EcompPortalUtils.widgetMsProtocol() + "://" @@ -187,7 +188,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController { HttpMethod.PUT, new HttpEntity<>(newWidgetCatalog, WidgetServiceHeaders.getInstance()), String.class); } - @RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.DELETE) + @DeleteMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" }) public void deleteOnboardingWidget(@PathVariable("widgetId") long widgetId) throws Exception { template.exchange( EcompPortalUtils.widgetMsProtocol() + "://" @@ -197,7 +198,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController { HttpMethod.DELETE, new HttpEntity<>(WidgetServiceHeaders.getInstance()), String.class); } - @RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.POST) + @PostMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" }) public String updateWidgetCatalogWithFiles(HttpServletRequest request, @PathVariable("widgetId") long widgetId) throws RestClientException, Exception { MultipartHttpServletRequest mRequest; @@ -231,7 +232,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController { return respond; } - @RequestMapping(value = { "/portalApi/microservices/widgetCatalog" }, method = RequestMethod.POST) + @PostMapping(value = { "/portalApi/microservices/widgetCatalog" }) public String createWidgetCatalog(HttpServletRequest request) throws Exception { @@ -273,7 +274,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController { return respond; } - @RequestMapping(value = "/portalApi/microservices/{widgetId}/framework.js", method = RequestMethod.GET) + @GetMapping(value = "/portalApi/microservices/{widgetId}/framework.js") public String getWidgetFramework(@PathVariable("widgetId") long widgetId) throws Exception { return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://" + widgetMService.getServiceLocation(whatService, @@ -281,17 +282,8 @@ public class WidgetsCatalogController extends EPRestrictedBaseController { + MS_WIDGET_URL + widgetId + "/framework.js", String.class, WidgetServiceHeaders.getInstance()); } - - @RequestMapping(value = "/portalApi/microservices/{widgetId}/controller.js", method = RequestMethod.GET) - public String getWidgetController(@PathVariable("widgetId") long widgetId) throws Exception { - return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://" - + widgetMService.getServiceLocation(whatService, - SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT)) - + MS_WIDGET_URL + widgetId + "/controller.js", String.class, - WidgetServiceHeaders.getInstance()); - } - - @RequestMapping(value = "/portalApi/microservices/{widgetId}/style.css", method = RequestMethod.GET) + + @GetMapping(value = "/portalApi/microservices/{widgetId}/style.css") public String getWidgetCSS(@PathVariable("widgetId") long widgetId) throws Exception { return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://" + widgetMService.getServiceLocation(whatService, @@ -300,7 +292,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController { WidgetServiceHeaders.getInstance()); } - @RequestMapping(value = { "/portalApi/microservices/parameters/{widgetId}" }, method = RequestMethod.GET) + @GetMapping(value = { "/portalApi/microservices/parameters/{widgetId}" }) public PortalRestResponse<List<WidgetParameterResult>> getWidgetParameterResult(HttpServletRequest request, @PathVariable("widgetId") long widgetId) throws Exception { EPUser user = EPUserUtils.getUserSession(request); @@ -336,17 +328,17 @@ public class WidgetsCatalogController extends EPRestrictedBaseController { return new PortalRestResponse<>(PortalRestStatusEnum.OK, "SUCCESS", list); } - @RequestMapping(value = { "/portalApi/microservices/services/{paramId}" }, method = RequestMethod.GET) + @GetMapping(value = { "/portalApi/microservices/services/{paramId}" }) public List<WidgetCatalogParameter> getUserParameterById( @PathVariable("paramId") long paramId) { return widgetParameterService.getUserParameterById(paramId); } - @RequestMapping(value = { "/portalApi/microservices/services/{paramId}" }, method = RequestMethod.DELETE) + @DeleteMapping(value = { "/portalApi/microservices/services/{paramId}" }) public void deleteUserParameterById(@PathVariable("paramId") long paramId) { widgetParameterService.deleteUserParameterById(paramId); } - @RequestMapping(value = { "/portalApi/microservices/download/{widgetId}" }, method = RequestMethod.GET) + @GetMapping(value = { "/portalApi/microservices/download/{widgetId}" }) public void doDownload(HttpServletRequest request, HttpServletResponse response, @PathVariable("widgetId") long widgetId) throws Exception { @@ -395,7 +387,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController { } } - @RequestMapping(value = { "/portalApi/microservices/parameters" }, method = RequestMethod.POST) + @PostMapping(value = { "/portalApi/microservices/parameters" }) public PortalRestResponse<String> saveWidgetParameter(HttpServletRequest request, @RequestBody WidgetCatalogParameter widgetParameters) { EPUser user = EPUserUtils.getUserSession(request); @@ -415,7 +407,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController { return new PortalRestResponse<>(PortalRestStatusEnum.OK, "SUCCESS", ""); } - @RequestMapping(value = { "/portalApi/microservices/uploadFlag" }, method = RequestMethod.GET) + @GetMapping(value = { "/portalApi/microservices/uploadFlag" }) public String getUploadFlag() { String uplaodFlag=""; try { diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogMarkupController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogMarkupController.java index 0c464fbf..eba0faf4 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogMarkupController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogMarkupController.java @@ -51,8 +51,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; 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.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; @@ -89,7 +88,7 @@ public class WidgetsCatalogMarkupController extends EPUnRestrictedBaseController }); } - @RequestMapping(value = "/portalApi/microservices/markup/{widgetId}", method = RequestMethod.GET) + @GetMapping(value = "/portalApi/microservices/markup/{widgetId}") public String getWidgetMarkup(HttpServletRequest request, HttpServletResponse response, @PathVariable("widgetId") long widgetId) throws RestClientException, Exception { return template diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogUnRestrictedController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogUnRestrictedController.java new file mode 100644 index 00000000..55cb08df --- /dev/null +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogUnRestrictedController.java @@ -0,0 +1,133 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2020 AT&T 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.controller; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang.StringUtils; +import org.onap.portalapp.controller.EPUnRestrictedBaseController; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.domain.MicroserviceParameter; +import org.onap.portalapp.portal.domain.WidgetCatalog; +import org.onap.portalapp.portal.domain.WidgetCatalogParameter; +import org.onap.portalapp.portal.domain.WidgetParameterResult; +import org.onap.portalapp.portal.domain.WidgetServiceHeaders; +import org.onap.portalapp.portal.ecomp.model.PortalRestResponse; +import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum; +import org.onap.portalapp.portal.logging.aop.EPAuditLog; +import org.onap.portalapp.portal.service.WidgetMService; +import org.onap.portalapp.portal.utils.EPCommonSystemProperties; +import org.onap.portalapp.portal.utils.EcompPortalUtils; +import org.onap.portalapp.util.EPUserUtils; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.util.SystemProperties; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.EnableAspectJAutoProxy; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.multipart.commons.CommonsMultipartResolver; + +@SuppressWarnings("unchecked") +@RestController +@org.springframework.context.annotation.Configuration +@EnableAspectJAutoProxy +@EPAuditLog +public class WidgetsCatalogUnRestrictedController extends EPUnRestrictedBaseController { + + private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetsCatalogUnRestrictedController.class); + + private static final String MS_WIDGET_LOCAL_PORT = "microservices.widget.local.port"; + + private static final String MS_WIDGET_URL = "/widget/microservices/"; + + private RestTemplate template = new RestTemplate(); + + private String whatService = "widgets-service"; + + @Autowired + private WidgetMService widgetMService; + + + @Bean + public CommonsMultipartResolver multipartResolver() { + return new CommonsMultipartResolver(); + } + + static { + // for localhost testing only + javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(new javax.net.ssl.HostnameVerifier() { + public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) { + if ("localhost".equals(hostname)) + return true; + return false; + } + }); + } + @GetMapping(value = "/portalApi/microservices/{widgetId}/controller.js") + public String getWidgetController(@PathVariable("widgetId") long widgetId) throws Exception { + return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://" + + widgetMService.getServiceLocation(whatService, + SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT)) + + MS_WIDGET_URL + widgetId + "/controller.js", String.class, + WidgetServiceHeaders.getInstance()); + } +} 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 404784fe..306a0efb 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"); @@ -62,8 +64,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.RequestMethod; +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.RestController; @RestController @@ -86,7 +90,7 @@ public class WidgetsController extends EPRestrictedBaseController { 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 +122,7 @@ public class WidgetsController extends EPRestrictedBaseController { // 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 +151,7 @@ public class WidgetsController extends EPRestrictedBaseController { // 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 +177,7 @@ public class WidgetsController extends EPRestrictedBaseController { 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 +203,7 @@ public class WidgetsController extends EPRestrictedBaseController { * @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/EPApp.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPApp.java index 8227d9ab..61fcfaee 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPApp.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPApp.java @@ -52,45 +52,72 @@ import org.onap.portalsdk.core.domain.support.DomainVo; public class EPApp extends DomainVo { private static final long serialVersionUID = 1L; + @SafeHtml private String name; + @SafeHtml private String imageUrl; + @SafeHtml - private String description; + private String appDescription; + @SafeHtml - private String notes; + private String appNotes; + @SafeHtml - private String url; + private String landingPage; + @SafeHtml - private String alternateUrl; + private String alternateLandingPage; + @SafeHtml private String appRestEndpoint; + @SafeHtml private String mlAppName; + @SafeHtml private String mlAppAdminId; private Long motsId; + @SafeHtml - private String username; + private String appBasicAuthUsername; + @SafeHtml - private String appPassword; + private String appBasicAuthPassword; + @Lob private byte[] thumbnail; + private Boolean open; + private Boolean enabled; + @SafeHtml private String uebTopicName; + @SafeHtml private String uebKey; + @SafeHtml private String uebSecret; + private Integer appType; + @Valid private AppContactUs contactUs; - private Boolean centralAuth; + + private Boolean rolesInAAF; @SafeHtml - private String nameSpace; + private String nameSpace; + + @SafeHtml + private String modeOfIntegration; + + private Boolean appAck; + + private Boolean usesCadi; public EPApp() { // Attention!!! @@ -102,8 +129,8 @@ public class EPApp extends DomainVo { this.name = ""; this.mlAppName = ""; this.mlAppAdminId = ""; - this.username = ""; - this.appPassword = ""; + this.appBasicAuthUsername = ""; + this.appBasicAuthPassword = ""; this.open = new Boolean(false); this.enabled = new Boolean(true); this.uebTopicName = ""; @@ -131,8 +158,6 @@ public class EPApp extends DomainVo { this.imageUrl = imageUrl; } - - public byte[] getThumbnail() { return this.thumbnail; } @@ -141,36 +166,36 @@ public class EPApp extends DomainVo { this.thumbnail = thumbnail; } - public String getDescription() { - return description; + public String getAppDescription() { + return appDescription; } - public void setDescription(String description) { - this.description = description; + public void setAppDescription(String appDescription) { + this.appDescription = appDescription; } - public String getNotes() { - return notes; + public String getAppNotes() { + return appNotes; } - public void setNotes(String notes) { - this.notes = notes; + public void setAppNotes(String appNotes) { + this.appNotes = appNotes; } - public String getUrl() { - return url; + public String getLandingPage() { + return landingPage; } - public void setUrl(String url) { - this.url = url; + public void setLandingPage(String landingPage) { + this.landingPage = landingPage; } - public String getAlternateUrl() { - return alternateUrl; + public String getAlternateLandingPage() { + return alternateLandingPage; } - public void setAlternateUrl(String alternateUrl) { - this.alternateUrl = alternateUrl; + public void setAlternateLandingPage(String alternateLandingPage) { + this.alternateLandingPage = alternateLandingPage; } public String getAppRestEndpoint() { @@ -211,25 +236,25 @@ public class EPApp extends DomainVo { this.motsId = motsId; } - public String getUsername() { - return username; + public String getAppBasicAuthUsername() { + return appBasicAuthUsername; } - public void setUsername(String username) { - this.username = username; + public void setAppBasicAuthUsername(String appBasicAuthUsername) { + this.appBasicAuthUsername = appBasicAuthUsername; } - public String getAppPassword() { - return appPassword; + public String getAppBasicAuthPassword() { + return appBasicAuthPassword; } - public void setAppPassword(String appPassword) { - if (StringUtils.isEmpty(appPassword)) { - appPassword = ""; + public void setAppBasicAuthPassword(String appBasicAuthPassword) { + if (StringUtils.isEmpty(appBasicAuthPassword)) { + appBasicAuthPassword = ""; } - this.appPassword = appPassword; + this.appBasicAuthPassword = appBasicAuthPassword; } - + public Boolean getOpen() { return open; } @@ -252,25 +277,6 @@ public class EPApp extends DomainVo { this.enabled = enabled; } - public Integer getAppType() { - return appType; - } - - public void setAppType(Integer appType) { - if (appType == null) { - appType = new Integer(1); - } - this.appType = appType; - } - - public void setRestrictedApp(Boolean restrictedApp) { - Integer result = 1; - if (restrictedApp) { - result = 2; - } - this.appType = result; - } - public Boolean isRestrictedApp() { return (this.appType == 2 ? true : false); } @@ -308,6 +314,14 @@ public class EPApp extends DomainVo { return this.uebSecret; } + public Integer getAppType() { + return appType; + } + + public void setAppType(Integer appType) { + this.appType = appType; + } + public void setUebSecret(String uebSecret) { if (StringUtils.isEmpty(uebSecret)) { this.uebSecret = ""; @@ -322,18 +336,18 @@ public class EPApp extends DomainVo { public void setContactUs(AppContactUs contactUs) { this.contactUs = contactUs; } - - public Boolean getCentralAuth() { - return centralAuth; + + public Boolean getRolesInAAF() { + return rolesInAAF; } - public void setCentralAuth(Boolean centralAuth) { - if (centralAuth == null) { - centralAuth = new Boolean(false); + public void setRolesInAAF(Boolean rolesInAAF) { + if (rolesInAAF == null) { + rolesInAAF = new Boolean(false); } - this.centralAuth = centralAuth; + this.rolesInAAF = rolesInAAF; } - + public String getNameSpace() { return nameSpace; } @@ -345,38 +359,71 @@ public class EPApp extends DomainVo { this.nameSpace = nameSpace; } + public String getModeOfIntegration() { + return modeOfIntegration; + } + + public void setModeOfIntegration(String modeOfIntegration) { + this.modeOfIntegration = modeOfIntegration; + } + + public Boolean getAppAck() { + return appAck; + } + + public void setAppAck(Boolean appAck) { + this.appAck = appAck; + } + + public Boolean getUsesCadi() { + return usesCadi; + } + + public void setUsesCadi(Boolean usesCadi) { + this.usesCadi = usesCadi; + } + @Override public String toString() { - String str = "[" + getId() + ":" + getName() + "]"; - return str; + return "EPApp [name=" + name + ", imageUrl=" + imageUrl + ", appDescription=" + appDescription + ", appNotes=" + + appNotes + ", landingPage=" + landingPage + ", alternateLandingPage=" + alternateLandingPage + + ", appRestEndpoint=" + appRestEndpoint + ", mlAppName=" + mlAppName + ", mlAppAdminId=" + mlAppAdminId + + ", motsId=" + motsId + ", appBasicAuthUsername=" + appBasicAuthUsername + ", appBasicAuthPassword=" + + appBasicAuthPassword + ", thumbnail=" + Arrays.toString(thumbnail) + ", open=" + open + ", enabled=" + + enabled + ", uebTopicName=" + uebTopicName + ", uebKey=" + uebKey + ", uebSecret=" + uebSecret + + ", appType=" + appType + ", contactUs=" + contactUs + ", rolesInAAF=" + rolesInAAF + ", nameSpace=" + + nameSpace + ", modeOfIntegration=" + modeOfIntegration + ", appAck=" + appAck + ", usesCadi=" + + usesCadi + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + ((alternateUrl == null) ? 0 : alternateUrl.hashCode()); - result = prime * result + ((appPassword == null) ? 0 : appPassword.hashCode()); + result = prime * result + ((alternateLandingPage == null) ? 0 : alternateLandingPage.hashCode()); + result = prime * result + ((appAck == null) ? 0 : appAck.hashCode()); + result = prime * result + ((appBasicAuthPassword == null) ? 0 : appBasicAuthPassword.hashCode()); + result = prime * result + ((appBasicAuthUsername == null) ? 0 : appBasicAuthUsername.hashCode()); + result = prime * result + ((appDescription == null) ? 0 : appDescription.hashCode()); + result = prime * result + ((appNotes == null) ? 0 : appNotes.hashCode()); result = prime * result + ((appRestEndpoint == null) ? 0 : appRestEndpoint.hashCode()); result = prime * result + ((appType == null) ? 0 : appType.hashCode()); - result = prime * result + ((centralAuth == null) ? 0 : centralAuth.hashCode()); - result = prime * result + ((contactUs == null) ? 0 : contactUs.hashCode()); - result = prime * result + ((description == null) ? 0 : description.hashCode()); result = prime * result + ((enabled == null) ? 0 : enabled.hashCode()); result = prime * result + ((imageUrl == null) ? 0 : imageUrl.hashCode()); + result = prime * result + ((landingPage == null) ? 0 : landingPage.hashCode()); result = prime * result + ((mlAppAdminId == null) ? 0 : mlAppAdminId.hashCode()); result = prime * result + ((mlAppName == null) ? 0 : mlAppName.hashCode()); + result = prime * result + ((modeOfIntegration == null) ? 0 : modeOfIntegration.hashCode()); result = prime * result + ((motsId == null) ? 0 : motsId.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((nameSpace == null) ? 0 : nameSpace.hashCode()); - result = prime * result + ((notes == null) ? 0 : notes.hashCode()); result = prime * result + ((open == null) ? 0 : open.hashCode()); + result = prime * result + ((rolesInAAF == null) ? 0 : rolesInAAF.hashCode()); result = prime * result + Arrays.hashCode(thumbnail); result = prime * result + ((uebKey == null) ? 0 : uebKey.hashCode()); result = prime * result + ((uebSecret == null) ? 0 : uebSecret.hashCode()); result = prime * result + ((uebTopicName == null) ? 0 : uebTopicName.hashCode()); - result = prime * result + ((url == null) ? 0 : url.hashCode()); - result = prime * result + ((username == null) ? 0 : username.hashCode()); + result = prime * result + ((usesCadi == null) ? 0 : usesCadi.hashCode()); return result; } @@ -384,45 +431,50 @@ public class EPApp extends DomainVo { public boolean equals(Object obj) { if (this == obj) return true; - if (obj == null) + if (!super.equals(obj)) return false; - if (getClass() != obj.getClass()) + if (!(obj instanceof EPApp)) return false; EPApp other = (EPApp) obj; - if (alternateUrl == null) { - if (other.alternateUrl != null) + if (alternateLandingPage == null) { + if (other.alternateLandingPage != null) return false; - } else if (!alternateUrl.equals(other.alternateUrl)) + } else if (!alternateLandingPage.equals(other.alternateLandingPage)) return false; - if (appPassword == null) { - if (other.appPassword != null) + if (appAck == null) { + if (other.appAck != null) return false; - } else if (!appPassword.equals(other.appPassword)) + } else if (!appAck.equals(other.appAck)) return false; - if (appRestEndpoint == null) { - if (other.appRestEndpoint != null) + if (appBasicAuthPassword == null) { + if (other.appBasicAuthPassword != null) return false; - } else if (!appRestEndpoint.equals(other.appRestEndpoint)) + } else if (!appBasicAuthPassword.equals(other.appBasicAuthPassword)) return false; - if (appType == null) { - if (other.appType != null) + if (appBasicAuthUsername == null) { + if (other.appBasicAuthUsername != null) return false; - } else if (!appType.equals(other.appType)) + } else if (!appBasicAuthUsername.equals(other.appBasicAuthUsername)) return false; - if (centralAuth == null) { - if (other.centralAuth != null) + if (appDescription == null) { + if (other.appDescription != null) return false; - } else if (!centralAuth.equals(other.centralAuth)) + } else if (!appDescription.equals(other.appDescription)) return false; - if (contactUs == null) { - if (other.contactUs != null) + if (appNotes == null) { + if (other.appNotes != null) return false; - } else if (!contactUs.equals(other.contactUs)) + } else if (!appNotes.equals(other.appNotes)) return false; - if (description == null) { - if (other.description != null) + if (appRestEndpoint == null) { + if (other.appRestEndpoint != null) return false; - } else if (!description.equals(other.description)) + } else if (!appRestEndpoint.equals(other.appRestEndpoint)) + return false; + if (appType == null) { + if (other.appType != null) + return false; + } else if (!appType.equals(other.appType)) return false; if (enabled == null) { if (other.enabled != null) @@ -434,6 +486,11 @@ public class EPApp extends DomainVo { return false; } else if (!imageUrl.equals(other.imageUrl)) return false; + if (landingPage == null) { + if (other.landingPage != null) + return false; + } else if (!landingPage.equals(other.landingPage)) + return false; if (mlAppAdminId == null) { if (other.mlAppAdminId != null) return false; @@ -444,6 +501,11 @@ public class EPApp extends DomainVo { return false; } else if (!mlAppName.equals(other.mlAppName)) return false; + if (modeOfIntegration == null) { + if (other.modeOfIntegration != null) + return false; + } else if (!modeOfIntegration.equals(other.modeOfIntegration)) + return false; if (motsId == null) { if (other.motsId != null) return false; @@ -459,16 +521,16 @@ public class EPApp extends DomainVo { return false; } else if (!nameSpace.equals(other.nameSpace)) return false; - if (notes == null) { - if (other.notes != null) - return false; - } else if (!notes.equals(other.notes)) - return false; if (open == null) { if (other.open != null) return false; } else if (!open.equals(other.open)) return false; + if (rolesInAAF == null) { + if (other.rolesInAAF != null) + return false; + } else if (!rolesInAAF.equals(other.rolesInAAF)) + return false; if (!Arrays.equals(thumbnail, other.thumbnail)) return false; if (uebKey == null) { @@ -486,16 +548,13 @@ public class EPApp extends DomainVo { return false; } else if (!uebTopicName.equals(other.uebTopicName)) return false; - if (url == null) { - if (other.url != null) - return false; - } else if (!url.equals(other.url)) - return false; - if (username == null) { - if (other.username != null) + if (usesCadi == null) { + if (other.usesCadi != null) return false; - } else if (!username.equals(other.username)) + } else if (!usesCadi.equals(other.usesCadi)) return false; return true; } + + } diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EpAppType.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EpAppType.java new file mode 100644 index 00000000..ae6d12cd --- /dev/null +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EpAppType.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2017 AT&T 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; + +public interface EpAppType { + public static final int GUI = 1; + public static final int HYPERLINK = 2; + public static final int NONGUI = 3; + + public static final String GUI_STR = "gui"; + public static final String HYPERLINK_STR = "hyperlink"; + public static final String NONGUI_STR = "nongui"; +} 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 9900827f..583b43ad 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.GeneratedValue; 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 b8f79d06..6db834eb 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 @@ package org.onap.portalapp.portal.domain; 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/main/java/org/onap/portalapp/portal/domain/SharedContext.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/SharedContext.java index 421a2fbc..14837dbf 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/SharedContext.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/SharedContext.java @@ -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; diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptor.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptor.java index 3209f35a..e96485d8 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptor.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptor.java @@ -39,19 +39,12 @@ */ 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; @@ -81,6 +72,8 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler; import org.onap.portalsdk.core.onboarding.util.AuthUtil; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; import org.onap.portalsdk.core.util.SystemProperties; @@ -262,7 +255,7 @@ public class PortalResourceInterceptor extends ResourceInterceptor { throw new Exception("Invalid credentials!"); } else { - final String appUsername = application.getUsername(); + final String appUsername = application.getAppBasicAuthUsername(); logger.debug(EELFLoggerDelegate.debugLogger, "appUsername : {}",appUsername); String[] accountNamePassword = EcompPortalUtils.getUserNamePassword(authHeader); @@ -326,8 +319,8 @@ public class PortalResourceInterceptor extends ResourceInterceptor { throw new Exception("Invalid credentials!"); } else { - final String appUsername = application.getUsername(); - final String dbDecryptedPwd = CipherUtil.decryptPKC(application.getAppPassword()); + final String appUsername = application.getAppBasicAuthUsername(); + final String dbDecryptedPwd = CipherUtil.decryptPKC(application.getAppBasicAuthPassword()); if (appUsername.equals(accountNamePassword[0]) && dbDecryptedPwd.equals(accountNamePassword[1])) { return true; } @@ -379,7 +372,7 @@ public class PortalResourceInterceptor extends ResourceInterceptor { String result = ""; if (encrypted != null && encrypted.length() > 0) { try { - result = CipherUtil.decryptPKC(encrypted, SystemProperties.getProperty(SystemProperties.Decryption_Key)); + result = CipherUtil.decryptPKC(encrypted, KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e); throw e; @@ -393,7 +386,7 @@ public class PortalResourceInterceptor extends ResourceInterceptor { if (decryptedPwd != null && decryptedPwd.length() > 0) { try { result = CipherUtil.encryptPKC(decryptedPwd, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword() failed", e); throw e; diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInterface.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInterface.java index afcb7abb..0f6f3cea 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInterface.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInterface.java @@ -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; diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxUtil.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxUtil.java index 4d81c6d0..869a9de5 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxUtil.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxUtil.java @@ -40,7 +40,6 @@ package org.onap.portalapp.portal.scheduleraux; import org.glassfish.jersey.client.ClientResponse; -import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; public class SchedulerAuxUtil { diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java index 6950bdda..969ccc5f 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java @@ -349,7 +349,7 @@ public class AdminRolesServiceImpl implements AdminRolesService { for (AppNameIdIsAdmin appNameIdIsAdmin : newAppsWhereUserIsAdmin) { EPApp app = (EPApp) localSession.get(EPApp.class, appNameIdIsAdmin.id); try { - if (app.getCentralAuth()) { + if (app.getRolesInAAF()) { String extRole = app.getNameSpace() + "." + PortalConstants.ADMIN_ROLE.replaceAll(" ", "_"); HttpEntity<String> entity = new HttpEntity<>(headers); String name = ""; diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java index 09d78046..ab504fba 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java @@ -67,6 +67,8 @@ import org.onap.portalapp.util.SystemType; 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.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.util.SystemProperties; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; @@ -176,8 +178,8 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient if (externalApp != null) { String appBaseUri = (type == SystemType.APPLICATION) ? externalApp.getAppRestEndpoint() : ""; - String username = (type == SystemType.APPLICATION) ? externalApp.getUsername(): ""; - String encriptedPwd = (type == SystemType.APPLICATION) ? externalApp.getAppPassword(): ""; + String username = (type == SystemType.APPLICATION) ? externalApp.getAppBasicAuthUsername(): ""; + String encriptedPwd = (type == SystemType.APPLICATION) ? externalApp.getAppBasicAuthPassword(): ""; String appName = (type == SystemType.APPLICATION) ? externalApp.getName(): ""; String decreptedAppPwd = StringUtils.EMPTY; @@ -194,7 +196,7 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient if(!encriptedPwd.isEmpty() || encriptedPwd != null || StringUtils.isEmpty(encriptedPwd)){ try { decreptedAppPwd = CipherUtil.decryptPKC(encriptedPwd, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "createClientFor failed to decrypt", e); } @@ -202,20 +204,20 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient WebClient client = createClientForPath(appBaseUri, restPath); - if(externalApp.getAppPassword().isEmpty() || externalApp.getAppPassword()==null){ + if(externalApp.getAppBasicAuthPassword().isEmpty() || externalApp.getAppBasicAuthPassword()==null){ logger.debug(EELFLoggerDelegate.debugLogger, "Entering in the externalApp get app password contains null : {}"); externalApp = appsCacheService.getApp(1L); logger.debug(EELFLoggerDelegate.debugLogger, "external App Information : {}",externalApp); - String mechidUsername=externalApp.getUsername(); + String mechidUsername=externalApp.getAppBasicAuthUsername(); logger.debug(EELFLoggerDelegate.debugLogger, "external App mechidUsername Information : {}",mechidUsername); - String password=externalApp.getAppPassword(); + String password=externalApp.getAppBasicAuthPassword(); String decreptedexternalAppPwd = StringUtils.EMPTY; try { decreptedexternalAppPwd = CipherUtil.decryptPKC(password, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (CipherUtilException e) { logger.error(EELFLoggerDelegate.errorLogger, "failed to decreptedexternalAppPwd when external app pwd is null", e); } diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppsCacheServiceImple.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppsCacheServiceImple.java index 3a70da84..94498f6e 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppsCacheServiceImple.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppsCacheServiceImple.java @@ -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 diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImpl.java index 98b0f127..151430d3 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImpl.java @@ -52,6 +52,8 @@ import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.onap.portalapp.validation.DataValidator; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.service.DataAccessService; import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.beans.factory.annotation.Autowired; @@ -229,7 +231,7 @@ public class BasicAuthAccountServiceImpl implements BasicAuthAccountService{ if (encryptedPwd != null && encryptedPwd.length() > 0) { try { result = CipherUtil.decryptPKC(encryptedPwd, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword() failed", e); throw e; @@ -243,7 +245,7 @@ public class BasicAuthAccountServiceImpl implements BasicAuthAccountService{ if (decryptedPwd != null && decryptedPwd.length() > 0) { try { result = CipherUtil.encryptPKC(decryptedPwd, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword() failed", e); throw e; diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthenticationCredentialServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthenticationCredentialServiceImpl.java index da09c172..618e9ba9 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthenticationCredentialServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthenticationCredentialServiceImpl.java @@ -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; diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java index 126d6276..a4463c7f 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java @@ -75,6 +75,7 @@ import org.onap.portalapp.portal.domain.EPUserAppsManualSortPreference; import org.onap.portalapp.portal.domain.EPUserAppsSortPreference; import org.onap.portalapp.portal.domain.EPWidgetsManualSortPreference; import org.onap.portalapp.portal.domain.EcompApp; +import org.onap.portalapp.portal.domain.MicroserviceData; import org.onap.portalapp.portal.domain.UserRole; import org.onap.portalapp.portal.domain.UserRoles; import org.onap.portalapp.portal.ecomp.model.AppCatalogItem; @@ -94,6 +95,8 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.ueb.Helper; import org.onap.portalsdk.core.onboarding.ueb.TopicManager; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; import org.onap.portalsdk.core.onboarding.util.PortalApiProperties; import org.onap.portalsdk.core.service.DataAccessService; @@ -147,17 +150,17 @@ public class EPAppCommonServiceImpl implements EPAppService { public Boolean onboardingAppFieldsValidation(OnboardingApp onboardingApp) { //FieldsValidator fieldsValidator = new FieldsValidator(); - if ((!onboardingApp.restrictedApp) &&( onboardingApp.name == null || onboardingApp.name.length() == 0 || onboardingApp.restrictedApp == null - || onboardingApp.url == null || onboardingApp.url.length() == 0 || onboardingApp.restUrl == null || onboardingApp.restUrl.length() == 0 - || onboardingApp.username == null || onboardingApp.username.length() == 0 - || onboardingApp.isOpen == null - || (onboardingApp.id != null && onboardingApp.id.equals(ECOMP_APP_ID))) + if ((!onboardingApp.getRestrictedApp()) &&( onboardingApp.getAppName() == null || onboardingApp.getAppName().length() == 0 || onboardingApp.getRestrictedApp() == null + || onboardingApp.getLandingPage() == null || onboardingApp.getLandingPage().length() == 0 || onboardingApp.getRestUrl() == null || onboardingApp.getRestUrl().length() == 0 + || onboardingApp.getAppBasicAuthUsername() == null || onboardingApp.getAppBasicAuthUsername().length() == 0 + || onboardingApp.getIsOpen() == null + || (onboardingApp.getId() != null && onboardingApp.getId().equals(ECOMP_APP_ID))) // For a normal app (appType == PortalConstants.PortalAppId), // these fields must be filled // in. // For a restricted app (appType==2), they will be empty. - || ((onboardingApp.restrictedApp) && (onboardingApp.name == null || onboardingApp.name.length() == 0 - || onboardingApp.url == null || onboardingApp.url.length() == 0 || onboardingApp.isOpen == null))) { + || ((onboardingApp.getRestrictedApp()) && (onboardingApp.getAppName() == null || onboardingApp.getAppName().length() == 0 + || onboardingApp.getLandingPage() == null || onboardingApp.getLandingPage().length() == 0 || onboardingApp.getIsOpen() == null))) { return false; } return true; @@ -165,8 +168,8 @@ public class EPAppCommonServiceImpl implements EPAppService { } private Boolean onboardingInactiveAppFieldsForValidation(OnboardingApp onboardingApp) { - if (onboardingApp.name == null || onboardingApp.name.length() == 0 - || onboardingApp.isOpen == null) { + if (onboardingApp.getAppName() == null || onboardingApp.getAppName().length() == 0 + || onboardingApp.getIsOpen() == null) { return false; } return true; @@ -174,28 +177,28 @@ public class EPAppCommonServiceImpl implements EPAppService { protected FieldsValidator onboardingAppFieldsChecker(OnboardingApp onboardingApp) { FieldsValidator fieldsValidator = new FieldsValidator(); - if (onboardingApp.isCentralAuth) { - if (!onboardingApp.isEnabled) { + if (onboardingApp.getRolesInAAF()) { + if (!onboardingApp.getIsEnabled()) { if (!onboardingInactiveAppFieldsForValidation(onboardingApp)) { fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST); } - } else if (onboardingApp.isEnabled) { - if (onboardingAppFieldsValidation(onboardingApp) == false || onboardingApp.nameSpace == null - || onboardingApp.nameSpace.length() == 0) { + } else if (onboardingApp.getIsEnabled()) { + if (onboardingAppFieldsValidation(onboardingApp) == false || onboardingApp.getNameSpace() == null + || onboardingApp.getNameSpace().length() == 0) { fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST); } } } else { - if (!onboardingApp.isEnabled) { + if (!onboardingApp.getIsEnabled()) { if (!onboardingInactiveAppFieldsForValidation(onboardingApp)) { fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST); } - } else if (onboardingApp.isEnabled) { - if(onboardingApp.restrictedApp && onboardingAppFieldsValidation(onboardingApp) == false){ + } else if (onboardingApp.getIsEnabled()) { + if(onboardingApp.getRestrictedApp() && onboardingAppFieldsValidation(onboardingApp) == false){ fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST); } - else if (!onboardingApp.restrictedApp && (onboardingAppFieldsValidation(onboardingApp) == false || onboardingApp.appPassword == null - || onboardingApp.appPassword.length() == 0)) { + else if (!onboardingApp.getRestrictedApp() && (onboardingAppFieldsValidation(onboardingApp) == false || onboardingApp.getAppBasicAuthPassword() == null + || onboardingApp.getAppBasicAuthPassword().length() == 0)) { fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST); } } @@ -268,15 +271,15 @@ public class EPAppCommonServiceImpl implements EPAppService { ecompApp.setId(app.getId()); ecompApp.setName(app.getName()); ecompApp.setImageUrl(app.getImageUrl()); - ecompApp.setDescription(app.getDescription()); - ecompApp.setNotes(app.getNotes()); - ecompApp.setUrl(app.getUrl()); - ecompApp.setAlternateUrl(app.getAlternateUrl()); + ecompApp.setDescription(app.getAppDescription()); + ecompApp.setNotes(app.getAppNotes()); + ecompApp.setUrl(app.getLandingPage()); + ecompApp.setAlternateUrl(app.getAlternateLandingPage()); ecompApp.setUebTopicName(app.getUebTopicName()); //ecompApp.setUebKey(app.getUebKey()); ecompApp.setUebSecret(app.getUebSecret()); ecompApp.setEnabled(app.getEnabled()); - ecompApp.setCentralAuth(app.getCentralAuth()); + ecompApp.setCentralAuth(app.getRolesInAAF()); ecompApp.setNameSpace(app.getNameSpace()); ecompApp.setRestrictedApp(app.isRestrictedApp()); ecompAppList.add(ecompApp); @@ -381,7 +384,7 @@ public class EPAppCommonServiceImpl implements EPAppService { if (apps.size() > 0) { EPApp app = apps.get(0); if (!EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) { - app.setCentralAuth(false); + app.setRolesInAAF(false); } return app; } else{ @@ -582,14 +585,14 @@ public class EPAppCommonServiceImpl implements EPAppService { FieldsValidator fieldsValidator = new FieldsValidator(); if(onboardingApp.isCentralAuth){ if (onboardingApp.name == null || onboardingApp.name.length() == 0 || onboardingApp.url == null - || onboardingApp.url.length() == 0 || onboardingApp.restrictedApp == null - || onboardingApp.isOpen == null || onboardingApp.isEnabled == null - || (onboardingApp.id != null && ECOMP_APP_ID.equals(onboardingApp.id.toString())) + || onboardingApp.url.length() == 0 || onboardingApp.getRestrictedApp() == null + || onboardingApp.getIsOpen() == null || onboardingApp.getIsEnabled() == null + || (onboardingApp.getId() != null && ECOMP_APP_ID.equals(onboardingApp.getId().toString())) // For a normal app (appType == PortalConstants.PortalAppId), // these fields must be filled // in. // For a restricted app (appType==2), they will be empty. - || ((!onboardingApp.restrictedApp) && (onboardingApp.myLoginsAppName == null + || ((!onboardingApp.getRestrictedApp()) && (onboardingApp.myLoginsAppName == null || onboardingApp.myLoginsAppName.length() == 0 || onboardingApp.myLoginsAppOwner == null || onboardingApp.myLoginsAppOwner.length() == 0 || onboardingApp.username == null || onboardingApp.username.length() == 0 ))) { @@ -598,14 +601,14 @@ public class EPAppCommonServiceImpl implements EPAppService { }else{ if (onboardingApp.name == null || onboardingApp.name.length() == 0 || onboardingApp.url == null - || onboardingApp.url.length() == 0 || onboardingApp.restrictedApp == null - || onboardingApp.isOpen == null || onboardingApp.isEnabled == null - || (onboardingApp.id != null && ECOMP_APP_ID.equals(onboardingApp.id.toString())) + || onboardingApp.url.length() == 0 || onboardingApp.getRestrictedApp() == null + || onboardingApp.getIsOpen() == null || onboardingApp.getIsEnabled() == null + || (onboardingApp.getId() != null && ECOMP_APP_ID.equals(onboardingApp.getId().toString())) // For a normal app (appType == PortalConstants.PortalAppId), // these fields must be filled // in. // For a restricted app (appType==2), they will be empty. - || ((!onboardingApp.restrictedApp) && (onboardingApp.myLoginsAppName == null + || ((!onboardingApp.getRestrictedApp()) && (onboardingApp.myLoginsAppName == null || onboardingApp.myLoginsAppName.length() == 0 || onboardingApp.myLoginsAppOwner == null || onboardingApp.myLoginsAppOwner.length() == 0 || onboardingApp.username == null || onboardingApp.username.length() == 0 || onboardingApp.appPassword == null @@ -815,7 +818,7 @@ public class EPAppCommonServiceImpl implements EPAppService { } return finalsortedAppsByManual; } - + @Override public List<OnboardingApp> getOnboardingApps() { @SuppressWarnings("unchecked") @@ -823,7 +826,7 @@ public class EPAppCommonServiceImpl implements EPAppService { List<OnboardingApp> onboardingAppsList = new ArrayList<OnboardingApp>(); for (EPApp app : apps) { OnboardingApp onboardingApp = new OnboardingApp(); - app.setAppPassword(EPCommonSystemProperties.APP_DISPLAY_PASSWORD);//to hide password from get request + app.setAppBasicAuthPassword(EPCommonSystemProperties.APP_DISPLAY_PASSWORD);//to hide password from get request createOnboardingFromApp(app, onboardingApp); onboardingAppsList.add(onboardingApp); } @@ -846,7 +849,7 @@ public class EPAppCommonServiceImpl implements EPAppService { onboardingAppsList = getOnboardingApps(); final List<Integer> userAdminApps1 = userAdminApps; - List<OnboardingApp> userApplicationAdmins = onboardingAppsList.stream().filter(x -> userAdminApps1.contains((int) (long)x.id)).collect(Collectors.toList()); + List<OnboardingApp> userApplicationAdmins = onboardingAppsList.stream().filter(x -> userAdminApps1.contains((int) (long)x.getId())).collect(Collectors.toList()); return userApplicationAdmins; } @@ -855,7 +858,8 @@ public class EPAppCommonServiceImpl implements EPAppService { public List<OnboardingApp> getEnabledNonOpenOnboardingApps() { @SuppressWarnings("unchecked") List<EPApp> apps = dataAccessService.getList(EPApp.class, - " where enabled = true and open = false and id!=" + ECOMP_APP_ID, null, null); + " where enabled = true and open = false and app_type!= 3 and id!=" + ECOMP_APP_ID, null, null); + List<OnboardingApp> onboardingAppsList = new ArrayList<OnboardingApp>(); for (EPApp app : apps) { OnboardingApp onboardingApp = new OnboardingApp(); @@ -870,13 +874,13 @@ public class EPAppCommonServiceImpl implements EPAppService { boolean duplicatedNameSpace = false; boolean duplicatedName = false; List<EPApp> apps; - if (onboardingApp.id == null) { + if (onboardingApp.getId() == null) { List<Criterion> restrictionsList = new ArrayList<Criterion>(); - Criterion nameCrit = Restrictions.eq("name",onboardingApp.name); + Criterion nameCrit = Restrictions.eq("name",onboardingApp.getAppName()); Criterion nameSpaceCrit = null; Criterion orCrit = null; - if (onboardingApp.isCentralAuth) { - nameSpaceCrit = Restrictions.eq("nameSpace", onboardingApp.nameSpace); + if (onboardingApp.getRolesInAAF()) { + nameSpaceCrit = Restrictions.eq("nameSpace", onboardingApp.getNameSpace()); orCrit = Restrictions.or(nameCrit, nameSpaceCrit); } else orCrit = Restrictions.or(nameCrit); @@ -884,12 +888,12 @@ public class EPAppCommonServiceImpl implements EPAppService { apps = (List<EPApp>) dataAccessService.getList(EPApp.class, null, restrictionsList, null); } else { List<Criterion> restrictionsList = new ArrayList<Criterion>(); - Criterion idCrit =Restrictions.eq("id", onboardingApp.id); - Criterion nameCrit = Restrictions.eq("name",onboardingApp.name); + Criterion idCrit =Restrictions.eq("id", onboardingApp.getId()); + Criterion nameCrit = Restrictions.eq("name",onboardingApp.getAppName()); Criterion nameSpaceCrit = null; Criterion orCrit= null; - if (onboardingApp.isCentralAuth) { - nameSpaceCrit = Restrictions.eq("nameSpace",onboardingApp.nameSpace); + if (onboardingApp.getRolesInAAF()) { + nameSpaceCrit = Restrictions.eq("nameSpace",onboardingApp.getNameSpace()); orCrit = Restrictions.or(idCrit, nameSpaceCrit, nameCrit); } else @@ -900,16 +904,16 @@ public class EPAppCommonServiceImpl implements EPAppService { } for (EPApp app : apps) { - if (onboardingApp.id != null && onboardingApp.id.equals(app.getId())) { + if (onboardingApp.getId() != null && onboardingApp.getId().equals(app.getId())) { continue; } - if (!duplicatedName && app.getName().equalsIgnoreCase(onboardingApp.name)) { + if (!duplicatedName && app.getName().equalsIgnoreCase(onboardingApp.getAppName())) { duplicatedName = true; if (duplicatedName) { break; } } - if (!duplicatedNameSpace && app.getNameSpace().equalsIgnoreCase(onboardingApp.nameSpace)) { + if (!duplicatedNameSpace && app.getNameSpace().equalsIgnoreCase(onboardingApp.getNameSpace())) { duplicatedNameSpace = true; if (duplicatedNameSpace) { break; @@ -937,8 +941,8 @@ public class EPAppCommonServiceImpl implements EPAppService { validateOnboardingApp(modifiedOnboardingApp, fieldsValidator); } if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) { - if (modifiedOnboardingApp.id != null) { - updateApp(modifiedOnboardingApp.id, modifiedOnboardingApp, fieldsValidator, user); + if (modifiedOnboardingApp.getId() != null) { + updateApp(modifiedOnboardingApp.getId(), modifiedOnboardingApp, fieldsValidator, user); } else { fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST); } @@ -953,7 +957,7 @@ public class EPAppCommonServiceImpl implements EPAppService { validateOnboardingApp(newOnboardingApp, fieldsValidator); } if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) { - if (newOnboardingApp.id == null) { + if (newOnboardingApp.getId() == null) { updateApp(null, newOnboardingApp, fieldsValidator, user); } else { fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST); @@ -972,6 +976,16 @@ public class EPAppCommonServiceImpl implements EPAppService { } final Map<String, Long> params = new HashMap<>(); params.put("app_id", appid); + + //Checking if App is associated with any exiting microservices- ep_microservice: + final Map<String, Long> queryparams = new HashMap<>(); + queryparams.put("applicationId", appid); + List<MicroserviceData> microservicesList = dataAccessService.executeNamedQuery( "getMicroservicesByAppId", queryparams, null); + if(microservicesList!=null && microservicesList.size()>0) { + fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_METHOD_NOT_ALLOWED); + return fieldsValidator; + } + List<EPUserAppRolesRequest> EPUserAppRolesRequestList= new ArrayList<>(); EPUserAppRolesRequestList = dataAccessService.executeNamedQuery( "getRequestIdsForApp", params, null); for(int i=0;i<EPUserAppRolesRequestList.size();i++) @@ -1211,7 +1225,7 @@ public class EPAppCommonServiceImpl implements EPAppService { logger.debug(EELFLoggerDelegate.debugLogger, "LR: entering updateApp"); // Separate out the code for a restricted app, since it doesn't need any // of the UEB code. - if (onboardingApp.restrictedApp) { + if (Boolean.TRUE.equals(onboardingApp.getRestrictedApp())) { boolean result = false; Session localSession = null; Transaction transaction = null; @@ -1234,7 +1248,7 @@ public class EPAppCommonServiceImpl implements EPAppService { createAppFromOnboarding(app, onboardingApp, localSession); localSession.saveOrUpdate(app); // Enable or disable all menu items associated with this app - setFunctionalMenuItemsEnabled(localSession, onboardingApp.isEnabled, appId); + setFunctionalMenuItemsEnabled(localSession, onboardingApp.getIsEnabled(), appId); transaction.commit(); result = true; } catch (Exception e) { @@ -1300,7 +1314,7 @@ public class EPAppCommonServiceImpl implements EPAppService { logger.debug(EELFLoggerDelegate.debugLogger, "updateRestrictedApp: finished calling localSession.saveOrUpdate"); // Enable or disable all menu items associated with this app - setFunctionalMenuItemsEnabled(localSession, onboardingApp.isEnabled, appId); + setFunctionalMenuItemsEnabled(localSession, onboardingApp.getIsEnabled(), appId); logger.debug(EELFLoggerDelegate.debugLogger, "updateRestrictedApp: finished calling setFunctionalMenuItemsEnabled"); transaction.commit(); @@ -1405,10 +1419,10 @@ public class EPAppCommonServiceImpl implements EPAppService { topicManager.createTopic( PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY), PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET), - appMailboxName, "ECOMP outbox for app" + onboardingApp.name); + appMailboxName, "ECOMP outbox for app" + onboardingApp.getAppName()); successfullyCreatedMailbox = true; logger.debug(EELFLoggerDelegate.debugLogger, - "Successfully created " + appMailboxName + " for App " + onboardingApp.name); + "Successfully created " + appMailboxName + " for App " + onboardingApp.getAppName()); logger.debug(EELFLoggerDelegate.debugLogger, " Key = " + appKey + " Secret = " + appSecret + " generated using = " + user.getEmail()); break; @@ -1487,7 +1501,7 @@ public class EPAppCommonServiceImpl implements EPAppService { logger.debug(EELFLoggerDelegate.debugLogger, "LR: updateApp: finished calling localSession.saveOrUpdate"); // Enable or disable all menu items associated with this app - setFunctionalMenuItemsEnabled(localSession, onboardingApp.isEnabled, appId); + setFunctionalMenuItemsEnabled(localSession, onboardingApp.getIsEnabled(), appId); logger.debug(EELFLoggerDelegate.debugLogger, "LR: updateApp: finished calling setFunctionalMenuItemsEnabled"); transaction.commit(); @@ -1528,27 +1542,35 @@ public class EPAppCommonServiceImpl implements EPAppService { */ @Override public void createOnboardingFromApp(EPApp app, OnboardingApp onboardingApp) { - onboardingApp.id = app.getId(); - onboardingApp.name = app.getName(); - onboardingApp.imageUrl = app.getImageUrl(); - onboardingApp.description = app.getDescription(); - onboardingApp.notes = app.getNotes(); - onboardingApp.url = app.getUrl(); - onboardingApp.alternateUrl = app.getAlternateUrl(); - onboardingApp.restUrl = app.getAppRestEndpoint(); - onboardingApp.isOpen = app.getOpen(); - onboardingApp.isEnabled = app.getEnabled(); - onboardingApp.username = app.getUsername(); - onboardingApp.appPassword = (app.getAppPassword().equals(EPCommonSystemProperties.APP_DISPLAY_PASSWORD)) ? EPCommonSystemProperties.APP_DISPLAY_PASSWORD :decryptedPassword(app.getAppPassword(), app); - onboardingApp.uebTopicName = app.getUebTopicName(); - onboardingApp.uebKey = app.getUebKey(); - onboardingApp.uebSecret = app.getUebSecret(); - onboardingApp.isCentralAuth = app.getCentralAuth(); - onboardingApp.nameSpace = app.getNameSpace(); + onboardingApp.setId(app.getId()); + onboardingApp.setAppName(app.getName()); + onboardingApp.setImageUrl(app.getImageUrl()); + onboardingApp.setAppDescription(app.getAppDescription()); + onboardingApp.setAppNotes(app.getAppNotes()); + onboardingApp.setLandingPage(app.getLandingPage()); + onboardingApp.setAlternateLandingPage(app.getAlternateLandingPage()); + onboardingApp.setRestUrl(app.getAppRestEndpoint()); + onboardingApp.setIsOpen(app.getOpen()); + onboardingApp.setIsEnabled(app.getEnabled()); + onboardingApp.setAppBasicAuthUsername(app.getAppBasicAuthUsername()); + + String effectivePwd = null; + if (app.getAppBasicAuthPassword().equals(EPCommonSystemProperties.APP_DISPLAY_PASSWORD)) + effectivePwd = EPCommonSystemProperties.APP_DISPLAY_PASSWORD; + else + effectivePwd = decryptedPassword(app.getAppBasicAuthPassword(), app); + + onboardingApp.setAppBasicAuthPassword(effectivePwd); + onboardingApp.setUebTopicName(app.getUebTopicName()); + onboardingApp.setUebKey(app.getUebKey()); + onboardingApp.setUebSecret(app.getUebSecret()); + onboardingApp.setRolesInAAF(app.getRolesInAAF()); + onboardingApp.setNameSpace(app.getNameSpace()); onboardingApp.setRestrictedApp(app.isRestrictedApp()); - // if (app.getThumbnail() != null) - // onboardingApp.thumbnail = new - // String(Base64.getEncoder().encode(app.getThumbnail())); + onboardingApp.setModeOfIntegration(app.getModeOfIntegration()); + onboardingApp.setAppAck(app.getAppAck()); + onboardingApp.setUsesCadi(app.getUsesCadi()); + onboardingApp.setApplicationType(app.getAppType().toString()); } /** @@ -1561,26 +1583,31 @@ public class EPAppCommonServiceImpl implements EPAppService { * @return The first argument. */ protected EPApp createAppFromOnboarding(EPApp app, OnboardingApp onboardingApp, Session localSession) { - app.setName(onboardingApp.name); - app.setDescription(onboardingApp.description); - app.setNotes(onboardingApp.notes); - app.setUrl(onboardingApp.url); - app.setAlternateUrl(onboardingApp.alternateUrl); - app.setAppRestEndpoint(onboardingApp.restUrl); - app.setOpen(onboardingApp.isOpen); - app.setEnabled(onboardingApp.isEnabled); - app.setUsername(onboardingApp.username); - if(!onboardingApp.appPassword.equals(EPCommonSystemProperties.APP_DISPLAY_PASSWORD)) - app.setAppPassword(this.encryptedPassword(onboardingApp.appPassword, app)); + app.setName(onboardingApp.getAppName()); + app.setAppDescription(onboardingApp.getAppDescription()); + app.setAppNotes(onboardingApp.getAppNotes()); + app.setLandingPage(onboardingApp.getLandingPage()); + app.setAlternateLandingPage(onboardingApp.getAlternateLandingPage()); + app.setAppRestEndpoint(onboardingApp.getRestUrl()); + app.setOpen(onboardingApp.getIsOpen()); + app.setEnabled(onboardingApp.getIsEnabled()); + app.setAppBasicAuthUsername(onboardingApp.getAppBasicAuthUsername()); + if(!onboardingApp.getAppBasicAuthPassword().equals(EPCommonSystemProperties.APP_DISPLAY_PASSWORD)) + app.setAppBasicAuthPassword(this.encryptedPassword(onboardingApp.getAppBasicAuthPassword(), app)); //app.setUebTopicName(onboardingApp.uebTopicName); - app.setUebKey(onboardingApp.uebKey); - app.setUebSecret(onboardingApp.uebSecret); - app.setCentralAuth(onboardingApp.isCentralAuth); - app.setNameSpace(onboardingApp.nameSpace); - app.setRestrictedApp(onboardingApp.restrictedApp); - if (!StringUtils.isEmpty(onboardingApp.thumbnail)) { + app.setUebKey(onboardingApp.getUebKey()); + app.setUebSecret(onboardingApp.getUebSecret()); + app.setRolesInAAF(onboardingApp.getRolesInAAF()); + app.setNameSpace(onboardingApp.getNameSpace()); + app.setAppType(new Integer(onboardingApp.getApplicationType())); + app.setModeOfIntegration(onboardingApp.getModeOfIntegration()); + app.setAppAck(onboardingApp.getAppAck()); + app.setUsesCadi(onboardingApp.getUsesCadi()); + + + if (!StringUtils.isEmpty(onboardingApp.getThumbnail())) { logger.debug(EELFLoggerDelegate.debugLogger, "createAppFromOnboarding: onboarding thumbnail is NOT empty"); - String[] splitBase64Thumbnail = onboardingApp.thumbnail.split("base64,"); + String[] splitBase64Thumbnail = onboardingApp.getThumbnail().split("base64,"); logger.debug(EELFLoggerDelegate.debugLogger, "createAppFromOnboarding: length of splitBase64Thumbnail: " + splitBase64Thumbnail.length); if (splitBase64Thumbnail.length > 1) { @@ -1592,7 +1619,7 @@ public class EPAppCommonServiceImpl implements EPAppService { app.setImageUrl(constructImageName(onboardingApp)); app.setThumbnail(decodedImage); } - } else if (app.getThumbnail() != null && onboardingApp.imageLink == null) { + } else if (app.getThumbnail() != null && onboardingApp.getImageLink() == null) { // The thumbnail that came in from the json is empty; the previous // thumbnail is NOT empty. Must delete it. logger.debug(EELFLoggerDelegate.debugLogger, @@ -1607,7 +1634,7 @@ public class EPAppCommonServiceImpl implements EPAppService { } protected String constructImageName(OnboardingApp onboardingApp) { - return "portal_" + String.valueOf(onboardingApp.url.hashCode() + "_" + (int) (Math.random() * 100000.0)) + return "portal_" + String.valueOf(onboardingApp.getLandingPage().hashCode() + "_" + (int) (Math.random() * 100000.0)) + ".png"; } @@ -1617,7 +1644,7 @@ public class EPAppCommonServiceImpl implements EPAppService { if (encryptedAppPwd != null && !encryptedAppPwd.isEmpty()) { try { result = CipherUtil.decryptPKC(encryptedAppPwd, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed for app " + app.getName(), e); } @@ -1630,7 +1657,7 @@ public class EPAppCommonServiceImpl implements EPAppService { if (decryptedAppPwd != null && !decryptedAppPwd.isEmpty()) { try { result = CipherUtil.encryptPKC(decryptedAppPwd, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword failed for app " + app.getName(), e); } @@ -1929,9 +1956,11 @@ public class EPAppCommonServiceImpl implements EPAppService { logger.debug(EELFLoggerDelegate.debugLogger, "checkIfNameSpaceExists: Connecting to External Auth system for : "+namespace); ResponseEntity<String> response = null; try { - response = template - .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) - + "nss/" + namespace, HttpMethod.GET, entity, String.class); + + String namespaceUrl = SystemProperties. + getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "nss/" + namespace; + + response = template.exchange(namespaceUrl, HttpMethod.GET, entity, String.class); logger.debug(EELFLoggerDelegate.debugLogger, "checkIfNameSpaceExists for"+ namespace , response.getStatusCode().value()); if (response.getStatusCode().value() == 200) { diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImpl.java index 241468c3..ad06dd96 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImpl.java @@ -1183,13 +1183,13 @@ public class ExternalAccessRolesServiceImpl implements ExternalAccessRolesServic .setModified(epApp.getModified()).setCreatedId(epApp.getCreatedId()) .setModifiedId(epApp.getModifiedId()).setRowNum(epApp.getRowNum()) .setName(epApp.getName()).setImageUrl(epApp.getImageUrl()) - .setDescription(epApp.getDescription()).setNotes(epApp.getNotes()) - .setUrl(epApp.getUrl()).setAlternateUrl(epApp.getAlternateUrl()) + .setDescription(epApp.getAppDescription()).setNotes(epApp.getAppNotes()) + .setUrl(epApp.getLandingPage()).setAlternateUrl(epApp.getLandingPage()) .setRestEndpoint(epApp.getAppRestEndpoint()).setMlAppName(epApp.getMlAppName()) .setMlAppAdminId(epApp.getMlAppAdminId()).setMotsId(String.valueOf(epApp.getMotsId())) - .setAppPassword(epApp.getAppPassword()).setOpen(String.valueOf(epApp.getOpen())) + .setAppPassword(epApp.getAppBasicAuthPassword()).setOpen(String.valueOf(epApp.getOpen())) .setEnabled(String.valueOf(epApp.getEnabled())).setThumbnail(epApp.getThumbnail()) - .setUsername(epApp.getUsername()).setUebKey(epApp.getUebKey()) + .setUsername(epApp.getAppBasicAuthUsername()).setUebKey(epApp.getUebKey()) .setUebSecret(epApp.getUebSecret()).setUebTopicName(epApp.getUebTopicName()) .createCentralApp(); cenApp.setAppPassword(EPCommonSystemProperties.APP_DISPLAY_PASSWORD); @@ -3005,7 +3005,7 @@ public class ExternalAccessRolesServiceImpl implements ExternalAccessRolesServic params.put("uebKey", app.getUebKey()); List<BulkUploadUserRoles> userRolesList = null; Integer userRolesAdded = 0; - if (app.getCentralAuth()) { + if (app.getRolesInAAF()) { userRolesList = dataAccessService.executeNamedQuery("getBulkUserRoles", params, null); for (BulkUploadUserRoles userRolesUpload : userRolesList) { if (!userRolesUpload.getOrgUserId().equals("su1234")) { @@ -3602,7 +3602,7 @@ public class ExternalAccessRolesServiceImpl implements ExternalAccessRolesServic params.put("roleId", String.valueOf(roleId)); List<BulkUploadUserRoles> userRolesList = null; Integer userRolesAdded = 0; - if (app.getCentralAuth()) { + if (app.getRolesInAAF()) { userRolesList = dataAccessService.executeNamedQuery("getBulkUsersForSingleRole", params, null); for (BulkUploadUserRoles userRolesUpload : userRolesList) { userRolesUpload.setRoleName(modifiedRoleName); diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageService.java index 570d1e92..ee39dd48 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageService.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/LanguageService.java @@ -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 { diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceProxyServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceProxyServiceImpl.java index 31cb8a45..df8b59d8 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceProxyServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceProxyServiceImpl.java @@ -50,6 +50,8 @@ import org.onap.portalapp.portal.logging.aop.EPMetricsLog; import org.onap.portalapp.portal.utils.EcompPortalUtils; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; @@ -177,7 +179,7 @@ public class MicroserviceProxyServiceImpl implements MicroserviceProxyService { if (encryptedPwd != null && encryptedPwd.length() > 0) { try { result = CipherUtil.decryptPKC(encryptedPwd, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e); throw e; diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java index 451500d6..9d9fde3a 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java @@ -52,6 +52,8 @@ import org.onap.portalapp.portal.logging.aop.EPMetricsLog; import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.service.DataAccessService; import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.beans.factory.annotation.Autowired; @@ -197,7 +199,7 @@ public class MicroserviceServiceImpl implements MicroserviceService { if (encryptedPwd != null && !encryptedPwd.isEmpty()) { try { result = CipherUtil.decryptPKC(encryptedPwd, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e); throw e; @@ -211,7 +213,7 @@ public class MicroserviceServiceImpl implements MicroserviceService { if (decryptedPwd != null && !decryptedPwd.isEmpty()) { try { result = CipherUtil.encryptPKC(decryptedPwd, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword failed", e); throw e; diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java index c766106d..07c1ea64 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java @@ -40,8 +40,6 @@ package org.onap.portalapp.portal.service; import java.util.ArrayList; import java.util.List; -import org.onap.portalapp.portal.service.SearchService; -import org.onap.portalapp.portal.service.SearchServiceImpl; import org.onap.portalapp.portal.domain.EPUser; import org.onap.portalapp.portal.logging.aop.EPMetricsLog; import org.onap.portalapp.portal.transport.UserWithNameSurnameTitle; diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java index 4924e654..7a7f9ee4 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java @@ -376,7 +376,7 @@ public class UserRolesCommonServiceImpl { .setParameter("appId",appId) .list(); for (EPRole role : roles) { - if (!extRequestValue && app.getCentralAuth()) { + if (!extRequestValue && app.getRolesInAAF()) { rolesMap.put(role.getId(), role); } else { rolesMap.put(role.getAppRoleId(), role); @@ -1086,12 +1086,11 @@ public class UserRolesCommonServiceImpl { } } } - applyChangesToUserAppRolesForMyLoginsRequest(user, appId); Boolean systemUser = (newAppRolesForUser.getIsSystemUser() != null ? newAppRolesForUser.getIsSystemUser() : false); - if ((app.getCentralAuth() || app.getId().equals(PortalConstants.PORTAL_APP_ID)) && systemUser) { + if ((app.getRolesInAAF() || app.getId().equals(PortalConstants.PORTAL_APP_ID)) && systemUser) { Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper, applicationsRestClientService, appId, userId); @@ -1108,13 +1107,16 @@ public class UserRolesCommonServiceImpl { result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, epRequestValue, "Portal", systemUser,rolesGotDeletedByApprover,false); - }else if (!app.getCentralAuth() && systemUser) + }else if (!app.getRolesInAAF() && systemUser) { throw new Exception("For non-centralized application we cannot add systemUser"); } else{ // if centralized app - if (app.getCentralAuth()) { - if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)) { + if (app.getRolesInAAF()) { + + if (!app.getId().equals(PortalConstants.PORTAL_APP_ID) && (app.getAppAck() != null && app.getAppAck())) { + logger.debug(EELFLoggerDelegate.debugLogger,"setAppWithUserRoleStateForUser: calling pushRemoteUser method for Central application"); + logger.debug(EELFLoggerDelegate.debugLogger,"setAppWithUserRoleStateForUser:"+app.getAppAck()); pushRemoteUser(roleInAppForUserList, userId, app, mapper, searchService, applicationsRestClientService,false); } @@ -1125,7 +1127,6 @@ public class UserRolesCommonServiceImpl { userRolesInLocalApp); List<RoleInAppForUser> roleAppUserList = rolesInAppForUser.roles; if (EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) { - // Apply changes in external Access system updateUserRolesInExternalSystem(app, rolesInAppForUser.orgUserId, roleAppUserList, epRequestValue,false,rolesGotDeletedFromApprover,checkIfUserisOnlyRoleAdmin); @@ -1133,7 +1134,7 @@ public class UserRolesCommonServiceImpl { result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, epRequestValue, "Portal", systemUser,rolesGotDeletedFromApprover,checkIfUserisOnlyRoleAdmin); } // In case if portal is not centralized then follow existing approach - else if(!app.getCentralAuth() && app.getId().equals(PortalConstants.PORTAL_APP_ID)){ + else if(!app.getRolesInAAF() && app.getId().equals(PortalConstants.PORTAL_APP_ID)){ Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper, applicationsRestClientService, appId, userId); RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(userId, appId, @@ -1142,10 +1143,10 @@ public class UserRolesCommonServiceImpl { result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, epRequestValue, "Portal",false,rolesGotDeletedByApprover,false); } else{// remote app EPUser remoteAppUser = null; - if(!app.getCentralAuth() && !app.getId().equals(PortalConstants.PORTAL_APP_ID)){ + if(!app.getRolesInAAF() && !app.getId().equals(PortalConstants.PORTAL_APP_ID)){ remoteAppUser = checkIfRemoteUserExits(userId, app, applicationsRestClientService); - + if (remoteAppUser == null) { remoteAppUser = addRemoteUser(roleInAppForUserList, userId, app, mapper, searchService, applicationsRestClientService); } @@ -1620,7 +1621,7 @@ public class UserRolesCommonServiceImpl { } //If Non-Centralized app make sure you sync app roles before assigning to user - if (!app.getId().equals(PortalConstants.PORTAL_APP_ID) && !app.getCentralAuth()) { + if (!app.getId().equals(PortalConstants.PORTAL_APP_ID) && !app.getRolesInAAF()) { logger.debug(EELFLoggerDelegate.debugLogger, "setExternalRequestUserAppRole: Starting GET roles for app {}",app.getId()); EcompRole[] appRoles = applicationsRestClientService.get(EcompRole[].class, app.getId(), "/roles"); logger.debug(EELFLoggerDelegate.debugLogger, "setExternalRequestUserAppRole: Finshed GET roles for app {} and payload {}",app.getId(), appRoles); @@ -1647,12 +1648,13 @@ public class UserRolesCommonServiceImpl { .anyMatch(roleList -> roleList.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID)); } // if Centralized app - if (app.getCentralAuth()) { + if (app.getRolesInAAF()) { // We should add If user does not exist in remote application try { // If adding just account admin role dont make remote application user call or // if request has only single non admin role then make remote call if (!(app.getId().equals(PortalConstants.PORTAL_APP_ID) && reqType.equals("DELETE")) + && (app.getAppAck() != null && app.getAppAck()) && ((checkIfAdminRoleExists && roleInAppForUserList.size() > 1) || (!checkIfAdminRoleExists && roleInAppForUserList.size() >= 1))) { // check if admin role exist then delete @@ -1662,6 +1664,7 @@ public class UserRolesCommonServiceImpl { return (role.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID)); }); String orgUserIdNewOrExist = (userInfo.size() != 0 || !userInfo.isEmpty()) ? user.getOrgUserId() : orgUserId; + pushRemoteUser(remoteUserRoles, orgUserIdNewOrExist , app, mapper, searchService, applicationsRestClientService,true); } @@ -1686,7 +1689,7 @@ public class UserRolesCommonServiceImpl { result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, externalSystemRequest, reqType,false,rolesGotDeletedByApprover,false); } // If local application is not centralized - else if(!app.getCentralAuth() && app.getId().equals(PortalConstants.PORTAL_APP_ID)){ + else if(!app.getRolesInAAF() && app.getId().equals(PortalConstants.PORTAL_APP_ID)){ Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper, applicationsRestClientService, app.getId(), orgUserId); RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(orgUserId, app.getId(), @@ -1896,7 +1899,7 @@ public class UserRolesCommonServiceImpl { // for onap portal app, no need to make a remote call List<Role> roleList = new ArrayList<>(); if (appId == PortalConstants.PORTAL_APP_ID) { - if(app.getCentralAuth()){ + if(app.getRolesInAAF()){ List<CentralV2Role> cenRoleList = externalAccessRolesService.getRolesForApp(app.getUebKey()); for(CentralV2Role cenRole : cenRoleList){ Role role = new Role(); @@ -1935,7 +1938,7 @@ public class UserRolesCommonServiceImpl { EcompRole[] appRoles = null; boolean checkIfUserisApplicationAccAdmin = false; List<EcompRole> roles = new ArrayList<>(); - if (app.getCentralAuth()) { + if (app.getRolesInAAF()) { final Map<String, Long> appParams = new HashMap<>(); appParams.put("appId", app.getId()); List<EPRole> applicationRoles = dataAccessService.executeNamedQuery("getActiveRolesOfApplication", @@ -2038,14 +2041,14 @@ public class UserRolesCommonServiceImpl { // If there is an exception in the rest client api, then null will // be returned. if (appRoles != null) { - if(!app.getCentralAuth()) { + if(!app.getRolesInAAF()) { syncAppRoles(sessionFactory, appId, appRoles); } EcompRole[] userAppRoles = null; try { try { - if(app.getCentralAuth()){ + if(app.getRolesInAAF()){ final Map<String, String> params = new HashMap<>(); final Map<String, Long> userParams = new HashMap<>(); params.put("orgUserIdValue", userId); @@ -2315,7 +2318,7 @@ public class UserRolesCommonServiceImpl { EPApp app = appsService.getApp(appId); //If local or centralized application - if (appId == PortalConstants.PORTAL_APP_ID || app.getCentralAuth()) { + if (appId == PortalConstants.PORTAL_APP_ID || app.getRolesInAAF()) { Map<String, Object> params = new HashMap<>(); params.put("id", app.getId()); params.put("active", true); diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java index 37ad5add..d1b2a568 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java @@ -38,6 +38,7 @@ package org.onap.portalapp.portal.transport; import org.hibernate.validator.constraints.SafeHtml; +import org.onap.portalapp.portal.domain.EpAppType; /** * Model of rows in the fn_app table; serialized as a message add or update an @@ -45,81 +46,301 @@ import org.hibernate.validator.constraints.SafeHtml; */ public class OnboardingApp { - public Long id; + private Long id; @SafeHtml - public String name; + private String appName; @SafeHtml - public String imageUrl; + private String imageUrl; @SafeHtml - public String imageLink; + private String imageLink; @SafeHtml - public String description; + private String appDescription; @SafeHtml - public String notes; + private String appNotes; @SafeHtml - public String url; + private String landingPage; @SafeHtml - public String alternateUrl; + private String alternateLandingPage; @SafeHtml - public String restUrl; + private String restUrl; - public Boolean isOpen; + @SafeHtml + private String applicationType; + + private Boolean isOpen; - public Boolean isEnabled; + private Boolean isEnabled; - public Long motsId; + private Long motsId; @SafeHtml - public String myLoginsAppName; + private String myLoginsAppName; @SafeHtml - public String myLoginsAppOwner; + private String myLoginsAppOwner; @SafeHtml - public String username; + private String appBasicAuthUsername; @SafeHtml - public String appPassword; + private String appBasicAuthPassword; @SafeHtml - public String thumbnail; + private String thumbnail; @SafeHtml - public String uebTopicName; + private String uebTopicName; @SafeHtml - public String uebKey; + private String uebKey; @SafeHtml - public String uebSecret; + private String uebSecret; - public Boolean restrictedApp; + private Boolean restrictedApp; - public Boolean isCentralAuth; + private Boolean rolesInAAF; + @SafeHtml + private String nameSpace; + @SafeHtml - public String nameSpace; + private String modeOfIntegration; + private Boolean appAck; + + private Boolean usesCadi; + /** * Sets the name, myLoginsAppName, myLoginsAppOwner, username and * appPassword fields to the empty string OR trims leading/trailing space, * as appropriate. */ public void normalize() { - this.name = (this.name == null) ? "" : this.name.trim(); + this.appName = (this.appName == null) ? "" : this.appName.trim(); this.myLoginsAppName = (this.myLoginsAppName == null) ? "" : this.myLoginsAppName.trim(); this.myLoginsAppOwner = (this.myLoginsAppOwner == null) ? "" : this.myLoginsAppOwner.trim(); - this.username = (this.username == null) ? "" : this.username.trim(); - this.appPassword = (this.appPassword == null) ? "" : this.appPassword.trim(); + this.appBasicAuthUsername = (this.appBasicAuthUsername == null) ? "" : this.appBasicAuthUsername.trim(); + this.appBasicAuthPassword = (this.appBasicAuthPassword == null) ? "" : this.appBasicAuthPassword.trim(); + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName; + } + + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + public String getImageLink() { + return imageLink; + } + + public void setImageLink(String imageLink) { + this.imageLink = imageLink; + } + + public String getAppDescription() { + return appDescription; + } + + public void setAppDescription(String appDescription) { + this.appDescription = appDescription; + } + + public String getAppNotes() { + return appNotes; + } + + public void setAppNotes(String appNotes) { + this.appNotes = appNotes; + } + + public String getLandingPage() { + return landingPage; + } + + public void setLandingPage(String landingPage) { + this.landingPage = landingPage; } - public void setUebTopicName(String topicName) { - this.uebTopicName = topicName; + public String getAlternateLandingPage() { + return alternateLandingPage; } - public void setUebKey(String key) { - this.uebKey = key; + public void setAlternateLandingPage(String alternateLandingPage) { + this.alternateLandingPage = alternateLandingPage; } - public void setUebSecret(String secret) { - this.uebSecret = secret; + public String getRestUrl() { + return restUrl; } - // Hide the implementation of restricted and normal app from the front end. - // The json sent and received will include restrictedApp but not appType. + public void setRestUrl(String restUrl) { + this.restUrl = restUrl; + } + + public Boolean getIsOpen() { + return isOpen; + } + + public void setIsOpen(Boolean isOpen) { + this.isOpen = isOpen; + } + + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + public Long getMotsId() { + return motsId; + } + + public void setMotsId(Long motsId) { + this.motsId = motsId; + } + + public String getMyLoginsAppName() { + return myLoginsAppName; + } + + public void setMyLoginsAppName(String myLoginsAppName) { + this.myLoginsAppName = myLoginsAppName; + } + + public String getMyLoginsAppOwner() { + return myLoginsAppOwner; + } + + public void setMyLoginsAppOwner(String myLoginsAppOwner) { + this.myLoginsAppOwner = myLoginsAppOwner; + } + + public String getAppBasicAuthUsername() { + return appBasicAuthUsername; + } + + public void setAppBasicAuthUsername(String appBasicAuthUsername) { + this.appBasicAuthUsername = appBasicAuthUsername; + } + + public String getAppBasicAuthPassword() { + return appBasicAuthPassword; + } + + public void setAppBasicAuthPassword(String appBasicAuthPassword) { + this.appBasicAuthPassword = appBasicAuthPassword; + } + + public String getThumbnail() { + return thumbnail; + } + + public void setThumbnail(String thumbnail) { + this.thumbnail = thumbnail; + } + + public String getUebTopicName() { + return uebTopicName; + } + + public void setUebTopicName(String uebTopicName) { + this.uebTopicName = uebTopicName; + } + + public String getUebKey() { + return uebKey; + } + + public void setUebKey(String uebKey) { + this.uebKey = uebKey; + } + + public String getUebSecret() { + return uebSecret; + } + + public void setUebSecret(String uebSecret) { + this.uebSecret = uebSecret; + } + + public Boolean getRestrictedApp() { + return restrictedApp; + } public void setRestrictedApp(Boolean restrictedApp) { this.restrictedApp = restrictedApp; } + + public Boolean getRolesInAAF() { + return rolesInAAF; + } + + public void setRolesInAAF(Boolean rolesInAAF) { + this.rolesInAAF = rolesInAAF; + } + + public String getNameSpace() { + return nameSpace; + } + + public void setNameSpace(String nameSpace) { + this.nameSpace = nameSpace; + } + + public String getModeOfIntegration() { + return modeOfIntegration; + } + + public void setModeOfIntegration(String modeOfIntegration) { + this.modeOfIntegration = modeOfIntegration; + } + + public Boolean getAppAck() { + return appAck; + } + + public void setAppAck(Boolean appAck) { + this.appAck = appAck; + } + + public Boolean getUsesCadi() { + return usesCadi; + } + + public void setUsesCadi(Boolean usesCadi) { + this.usesCadi = usesCadi; + } + + public String getApplicationType() { + return applicationType; + } + + public void setApplicationType(String applicationType) { + this.applicationType = applicationType; + } + + public Integer appTypePersistedValue() { + switch (this.getApplicationType()) { + case EpAppType.GUI_STR: + return EpAppType.GUI; + case EpAppType.HYPERLINK_STR: + return EpAppType.HYPERLINK; + case EpAppType.NONGUI_STR: + return EpAppType.NONGUI; + default: + return 0; + } + } } diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java index e5543a36..3fc8c393 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java @@ -61,6 +61,8 @@ import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum; import org.onap.portalapp.portal.logging.logic.EPLogUtil; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.util.SystemProperties; import org.slf4j.MDC; import org.springframework.http.HttpHeaders; @@ -435,7 +437,7 @@ public class EcompPortalUtils { if (encrypted != null && encrypted.length() > 0) { try { result = CipherUtil.decryptPKC(encrypted, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e); throw e; diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/MusicCookieCsrfTokenRepository.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/MusicCookieCsrfTokenRepository.java index 891f6d78..afe56368 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/MusicCookieCsrfTokenRepository.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/MusicCookieCsrfTokenRepository.java @@ -62,7 +62,6 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.HashMap; import java.util.Map; -import org.onap.portalapp.portal.utils.EPCommonSystemProperties; public final class MusicCookieCsrfTokenRepository implements CsrfTokenRepository { diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java index 14616b31..f65199c7 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java @@ -61,6 +61,8 @@ import org.onap.portalsdk.core.exception.UrlAccessRestrictedException; 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.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.util.SystemProperties; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; @@ -85,12 +87,12 @@ public class SessionCommunication { String appResponse = ""; String appName = ""; int responseCode = 0; - if (app != null && app.name != null && app.name != "") { + if (app != null && app.getAppName() != null && app.getAppName() != "") { try { - appName = app.name; - String url = app.restUrl + "/sessionTimeOuts"; - String encriptedPwdDB = app.appPassword; - String appUserName = app.username; + appName = app.getAppName(); + String url = app.getRestUrl() + "/sessionTimeOuts"; + String encriptedPwdDB = app.getAppBasicAuthPassword(); + String appUserName = app.getAppBasicAuthUsername(); setLocalMDCContext(app, "/sessionTimeOuts", url); @@ -157,12 +159,12 @@ public class SessionCommunication { try { if (app == null) throw new Exception("SessionCommunication.pingSession: app is null"); - if (app != null && app.name != null && app.name != "") { - appName = app.name; + if (app != null && app.getAppName() != null && app.getAppName() != "") { + appName = app.getAppName(); } - String url = app.restUrl + "/updateSessionTimeOuts"; - String encriptedPwdDB = app.appPassword; - String appUserName = app.username; + String url = app.getRestUrl() + "/updateSessionTimeOuts"; + String encriptedPwdDB = app.getAppBasicAuthPassword(); + String appUserName = app.getAppBasicAuthUsername(); setLocalMDCContext(app, "/updateSessionTimeOuts", url); @@ -218,13 +220,13 @@ public class SessionCommunication { public Boolean timeoutSession(OnboardingApp app, String portalJSessionId) throws Exception { String appName = "Unknwon"; int responseCode = 0; - if (app != null && app.name != null && app.name != "") { + if (app != null && app.getAppName() != null && app.getAppName() != "") { try { - appName = app.name; - String url = app.restUrl + "/timeoutSession" + "?portalJSessionId=" + portalJSessionId; + appName = app.getAppName(); + String url = app.getRestUrl() + "/timeoutSession" + "?portalJSessionId=" + portalJSessionId; - String encriptedPwdDB = app.appPassword; - String appUserName = app.username; + String encriptedPwdDB = app.getAppBasicAuthPassword(); + String appUserName = app.getAppBasicAuthUsername(); // String decreptedPwd = CipherUtil.decrypt(encriptedPwdDB, // SystemProperties.getProperty(SystemProperties.Decryption_Key)); @@ -287,7 +289,7 @@ public class SessionCommunication { MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTPS); } MDC.put(EPCommonSystemProperties.FULL_URL, url); - MDC.put(EPCommonSystemProperties.TARGET_ENTITY, app.myLoginsAppName); + MDC.put(EPCommonSystemProperties.TARGET_ENTITY, app.getMyLoginsAppName()); MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, restPath); } @@ -332,19 +334,19 @@ public class SessionCommunication { Map<String,String> headersMap = new HashMap<>(); EPApp externalApp = null; - if(app.appPassword.isEmpty() || app.appPassword==null){ + if(app.getAppBasicAuthPassword().isEmpty() || app.getAppBasicAuthPassword()==null){ logger.debug(EELFLoggerDelegate.debugLogger, "Entering in the externalApp get app password contains null : {}"); externalApp = appsCacheService.getApp(1L); logger.debug(EELFLoggerDelegate.debugLogger, "external App Information : {}",externalApp); - String mechidUsername=externalApp.getUsername(); + String mechidUsername=externalApp.getAppBasicAuthUsername(); logger.debug(EELFLoggerDelegate.debugLogger, "external App mechidUsername Information : {}",mechidUsername); - String password=externalApp.getAppPassword(); + String password=externalApp.getAppBasicAuthPassword(); String decreptedexternalAppPwd = StringUtils.EMPTY; try { decreptedexternalAppPwd = CipherUtil.decryptPKC(password, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } catch (CipherUtilException e) { logger.error(EELFLoggerDelegate.errorLogger, "failed to decreptedexternalAppPwd when external app pwd is null", e); } @@ -353,8 +355,8 @@ public class SessionCommunication { encriptedPwdDB = decreptedexternalAppPwd; }else{ - appUserName = app.username; - encriptedPwdDB = app.appPassword; + appUserName = app.getAppBasicAuthUsername(); + encriptedPwdDB = app.getAppBasicAuthPassword(); } headersMap.put("username", appUserName); diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/TimeoutHandler.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/TimeoutHandler.java index a60266cf..2b8d6d43 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/TimeoutHandler.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/TimeoutHandler.java @@ -132,19 +132,19 @@ public class TimeoutHandler extends QuartzJobBean { Map<Long, Map<String, TimeoutVO>> appSessionTimeOutMap = new Hashtable<Long, Map<String, TimeoutVO>>(); // determine the Max TimeOut Time for each of the managed sessions for (OnboardingApp app : appList) { - if (app.restUrl == null) { - logger.info(EELFLoggerDelegate.debugLogger, "Session Management: null restUrl, not fetching from app " + app.name); + if (app.getRestUrl() == null) { + logger.info(EELFLoggerDelegate.debugLogger, "Session Management: null restUrl, not fetching from app " + app.getAppName()); continue; } - logger.info(EELFLoggerDelegate.debugLogger, "Session Management: Calling App " + app.name + " at URL " + app.restUrl); + logger.info(EELFLoggerDelegate.debugLogger, "Session Management: Calling App " + app.getAppName() + " at URL " + app.getRestUrl()); String jsonSessionStr = fetchAppSessions(app); - logger.info(EELFLoggerDelegate.debugLogger, "Session Management: App " + app.name + " returned " + jsonSessionStr); + logger.info(EELFLoggerDelegate.debugLogger, "Session Management: App " + app.getAppName() + " returned " + jsonSessionStr); if (jsonSessionStr == null || jsonSessionStr.isEmpty()) continue; try { Map<String, TimeoutVO> sessionTimeoutMap = mapper.readValue(jsonSessionStr, typeRef); - appSessionTimeOutMap.put(app.id, sessionTimeoutMap); + appSessionTimeOutMap.put(app.getId(), sessionTimeoutMap); for (String portalJSessionId : sessionTimeoutMap.keySet()) { final TimeoutVO maxTimeoutVO = portalSessionTimeoutMap.get(portalJSessionId); final TimeoutVO compareTimeoutVO = sessionTimeoutMap.get(portalJSessionId); @@ -168,12 +168,12 @@ public class TimeoutHandler extends QuartzJobBean { // post the updated session timeouts back to the Apps for (OnboardingApp app : appList) { - if (app.restUrl == null) { - logger.warn(EELFLoggerDelegate.errorLogger, "Session Management: null restUrl, not posting back to app " + app.name); + if (app.getRestUrl() == null) { + logger.warn(EELFLoggerDelegate.errorLogger, "Session Management: null restUrl, not posting back to app " + app.getAppName()); continue; } - Map<String, TimeoutVO> sessionTimeoutMap = appSessionTimeOutMap.get(app.id); + Map<String, TimeoutVO> sessionTimeoutMap = appSessionTimeOutMap.get(app.getId()); if (sessionTimeoutMap == null || sessionTimeoutMap.isEmpty()) continue; @@ -184,7 +184,7 @@ public class TimeoutHandler extends QuartzJobBean { if (maxTimeoutVO == null || setTimeoutVO == null) { String message = String.format( "Session Management: Failed to update the session timeouts for the app: %s and the sessionId: %s.", - app.name, portalJSessionId); + app.getAppName(), portalJSessionId); logger.warn(EELFLoggerDelegate.errorLogger, message); continue; } @@ -194,7 +194,7 @@ public class TimeoutHandler extends QuartzJobBean { continue; } } - logger.info(EELFLoggerDelegate.debugLogger, "Session Management: Updating App " + app.restUrl); + logger.info(EELFLoggerDelegate.debugLogger, "Session Management: Updating App " + app.getRestUrl()); String sessionTimeoutMapStr = ""; try { sessionTimeoutMapStr = mapper.writeValueAsString(sessionTimeoutMap); diff --git a/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml b/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml index 961006cc..14156f46 100644 --- a/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml +++ b/ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml @@ -328,10 +328,10 @@ <column name="app_name" not-null="true" default="?"></column> </property> <property name="imageUrl" column="app_image_url" /> - <property name="description" column="app_description" /> - <property name="notes" column="app_notes" /> - <property name="url" column="app_url" /> - <property name="alternateUrl" column="app_alternate_url" /> + <property name="appDescription" column="app_description" /> + <property name="appNotes" column="app_notes" /> + <property name="landingPage" column="app_url" /> + <property name="alternateLandingPage" column="app_alternate_url" /> <property name="appRestEndpoint" column="app_rest_endpoint" /> <property name="mlAppName" type="string"> <column name="ml_app_name" not-null="true" default="?"></column> @@ -340,11 +340,11 @@ <column name="ml_app_admin_id" not-null="true" default="?"></column> </property> <property name="motsId" column="mots_id" /> - <property name="appPassword" type="string"> + <property name="appBasicAuthPassword" type="string"> <column name="app_password" not-null="true" default="?"></column> </property> <property name="thumbnail" column="thumbnail" /> - <property name="username" type="string"> + <property name="appBasicAuthUsername" type="string"> <column name="app_username" not-null="true" default="?"></column> </property> <property name="open" type="yes_no"> @@ -365,12 +365,22 @@ <property name="appType" type="integer"> <column name="app_type"></column> </property> - <property name="centralAuth" type="yes_no"> + <property name="rolesInAAF" type="yes_no"> <column name="auth_central"></column> </property> <property name="nameSpace" type="string"> <column name="auth_namespace"></column> </property> + <property name="modeOfIntegration" type="string"> + <column name="mode_of_integration"></column> + </property> + <property name="appAck" type="yes_no"> + <column name="ack_app"></column> + </property> + <property name="usesCadi" type="yes_no"> + <column name="uses_cadi"></column> + </property> + <one-to-one name="contactUs" class="AppContactUs" cascade="save-update"></one-to-one> </class> @@ -1248,7 +1258,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y a.ML_APP_NAME , a.ML_APP_ADMIN_ID , a.MOTS_ID , a.APP_PASSWORD , a.THUMBNAIL , a.APP_USERNAME , a.OPEN , a.ENABLED , a.UEB_TOPIC_NAME , a.UEB_KEY , a.UEB_SECRET , a.APP_TYPE , a.AUTH_CENTRAL , - a.AUTH_NAMESPACE + a.AUTH_NAMESPACE , a.MODE_OF_INTEGRATION, a.ACK_APP , a.USES_CADI from FN_APP a -- Portal assigns role 999 to app administrator left outer join FN_USER_ROLE r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999 @@ -1261,6 +1271,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y or (a.OPEN = 'N' and r.ROLE_ID is null and p.STATUS_CD = 'S') ) + and a.app_type != 3 union select distinct -- multiple roles yield multiple rows b.APP_ID , b.APP_NAME , b.APP_IMAGE_URL ,b.APP_DESCRIPTION , @@ -1268,7 +1279,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y b.ML_APP_NAME , b.ML_APP_ADMIN_ID , b.MOTS_ID , b.APP_PASSWORD , b.THUMBNAIL , b.APP_USERNAME , b.OPEN , b.ENABLED , b.UEB_TOPIC_NAME , b.UEB_KEY , b.UEB_SECRET , b.APP_TYPE , b.AUTH_CENTRAL , - b.AUTH_NAMESPACE + b.AUTH_NAMESPACE , b.MODE_OF_INTEGRATION , b.ACK_APP , b.USES_CADI from fn_user_role a, fn_app b, ep_app_role_function c , fn_role d , ep_app_function e where a.user_id =:userId and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id order by app_name @@ -1289,7 +1300,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y a.ML_APP_NAME , a.ML_APP_ADMIN_ID , a.MOTS_ID , a.APP_PASSWORD , a.THUMBNAIL , a.APP_USERNAME , a.OPEN , a.ENABLED , a.UEB_TOPIC_NAME , a.UEB_KEY , a.UEB_SECRET , a.APP_TYPE , a.AUTH_CENTRAL , - a.AUTH_NAMESPACE + a.AUTH_NAMESPACE , a.MODE_OF_INTEGRATION, a.ACK_APP , a.USES_CADI from FN_APP a -- Portal assigns role 999 to app administrator left outer join FN_USER_ROLE r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999 @@ -1300,6 +1311,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y or (a.OPEN = 'N' and r.USER_ID is not null and (p.STATUS_CD is null or p.STATUS_CD != 'H')) ) + and a.app_type != 3 union select distinct -- multiple roles yield multiple rows b.APP_ID , b.APP_NAME , b.APP_IMAGE_URL ,b.APP_DESCRIPTION , @@ -1307,7 +1319,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y b.ML_APP_NAME , b.ML_APP_ADMIN_ID , b.MOTS_ID , b.APP_PASSWORD , b.THUMBNAIL , b.APP_USERNAME , b.OPEN , b.ENABLED , b.UEB_TOPIC_NAME , b.UEB_KEY , b.UEB_SECRET , b.APP_TYPE , b.AUTH_CENTRAL , - b.AUTH_NAMESPACE + b.AUTH_NAMESPACE , b.MODE_OF_INTEGRATION, b.ACK_APP , b.USES_CADI from fn_user_role a, fn_app b, ep_app_role_function c , fn_role d , ep_app_function e where a.user_id =:userId and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id order by app_name @@ -1331,7 +1343,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y a.ML_APP_NAME , a.ML_APP_ADMIN_ID , a.MOTS_ID , a.APP_PASSWORD , a.THUMBNAIL , a.APP_USERNAME , a.OPEN , a.ENABLED , a.UEB_TOPIC_NAME , a.UEB_KEY , a.UEB_SECRET , a.APP_TYPE , a.AUTH_CENTRAL , - a.AUTH_NAMESPACE + a.AUTH_NAMESPACE , a.MODE_OF_INTEGRATION, a.ACK_APP , a.USES_CADI from FN_APP a -- Portal assigns role 999 to app administrator left outer join FN_USER_ROLE r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999 @@ -1344,6 +1356,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y or (a.OPEN = 'N' and r.ROLE_ID is null and p.STATUS_CD = 'S') ) + and a.app_type != 3 union select distinct -- multiple roles yield multiple rows b.APP_ID , b.APP_NAME , b.APP_IMAGE_URL ,b.APP_DESCRIPTION , @@ -1351,7 +1364,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y b.ML_APP_NAME , b.ML_APP_ADMIN_ID , b.MOTS_ID , b.APP_PASSWORD , b.THUMBNAIL , b.APP_USERNAME , b.OPEN , b.ENABLED , b.UEB_TOPIC_NAME , b.UEB_KEY , b.UEB_SECRET , b.APP_TYPE , b.AUTH_CENTRAL , - b.AUTH_NAMESPACE + b.AUTH_NAMESPACE , b.MODE_OF_INTEGRATION, b.ACK_APP , b.USES_CADI from fn_user_role a, fn_app b, ep_app_role_function c , fn_role d , ep_app_function e where a.user_id =:userId and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id ) A @@ -1379,7 +1392,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y a.ML_APP_NAME , a.ML_APP_ADMIN_ID , a.MOTS_ID , a.APP_PASSWORD , a.THUMBNAIL , a.APP_USERNAME , a.OPEN , a.ENABLED , a.UEB_TOPIC_NAME , a.UEB_KEY , a.UEB_SECRET , a.APP_TYPE , a.AUTH_CENTRAL , - a.AUTH_NAMESPACE + a.AUTH_NAMESPACE , a.MODE_OF_INTEGRATION, a.ACK_APP , a.USES_CADI from FN_APP a -- Portal assigns role 999 to app administrator left outer join FN_USER_ROLE r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999 @@ -1389,14 +1402,16 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y (a.OPEN = 'Y' and p.STATUS_CD = 'S') or (a.OPEN = 'N' and r.USER_ID is not null and (p.STATUS_CD is null or p.STATUS_CD != 'H')) - )union + ) + and a.app_type != 3 + union select distinct -- multiple roles yield multiple rows b.APP_ID , b.APP_NAME , b.APP_IMAGE_URL ,b.APP_DESCRIPTION , b.APP_NOTES , b.APP_URL , b.APP_ALTERNATE_URL , b.APP_REST_ENDPOINT , b.ML_APP_NAME , b.ML_APP_ADMIN_ID , b.MOTS_ID , b.APP_PASSWORD , b.THUMBNAIL , b.APP_USERNAME , b.OPEN , b.ENABLED , b.UEB_TOPIC_NAME , b.UEB_KEY , b.UEB_SECRET , b.APP_TYPE , b.AUTH_CENTRAL , - b.AUTH_NAMESPACE + b.AUTH_NAMESPACE , b.MODE_OF_INTEGRATION, b.ACK_APP , b.USES_CADI from fn_user_role a, fn_app b, ep_app_role_function c , fn_role d , ep_app_function e where a.user_id =:userId and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id @@ -1431,7 +1446,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y a.ML_APP_NAME , a.ML_APP_ADMIN_ID , a.MOTS_ID , a.APP_PASSWORD , a.THUMBNAIL , a.APP_USERNAME , a.OPEN , a.ENABLED , a.UEB_TOPIC_NAME , a.UEB_KEY , a.UEB_SECRET , a.APP_TYPE , a.AUTH_CENTRAL , - a.AUTH_NAMESPACE + a.AUTH_NAMESPACE , a.MODE_OF_INTEGRATION, a.ACK_APP , a.USES_CADI from FN_APP a -- Portal assigns role 999 to app administrator left outer join FN_USER_ROLE r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999 @@ -1443,14 +1458,16 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y (a.OPEN = 'N' and r.ROLE_ID is not null and (p.STATUS_CD is null or p.STATUS_CD != 'H')) or (a.OPEN = 'N' and r.ROLE_ID is null and p.STATUS_CD = 'S') - )union + ) + and a.app_type != 3 + union select distinct -- multiple roles yield multiple rows b.APP_ID , b.APP_NAME , b.APP_IMAGE_URL ,b.APP_DESCRIPTION , b.APP_NOTES , b.APP_URL , b.APP_ALTERNATE_URL , b.APP_REST_ENDPOINT , b.ML_APP_NAME , b.ML_APP_ADMIN_ID , b.MOTS_ID , b.APP_PASSWORD , b.THUMBNAIL , b.APP_USERNAME , b.OPEN , b.ENABLED , b.UEB_TOPIC_NAME , b.UEB_KEY , b.UEB_SECRET , b.APP_TYPE , b.AUTH_CENTRAL , - b.AUTH_NAMESPACE + b.AUTH_NAMESPACE , b.MODE_OF_INTEGRATION, b.ACK_APP , b.USES_CADI from fn_user_role a, fn_app b, ep_app_role_function c , fn_role d , ep_app_function e where a.user_id =:userId and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id ) A @@ -1481,7 +1498,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y a.ML_APP_NAME , a.ML_APP_ADMIN_ID , a.MOTS_ID , a.APP_PASSWORD , a.THUMBNAIL , a.APP_USERNAME , a.OPEN , a.ENABLED , a.UEB_TOPIC_NAME , a.UEB_KEY , a.UEB_SECRET , a.APP_TYPE , a.AUTH_CENTRAL , - a.AUTH_NAMESPACE + a.AUTH_NAMESPACE , a.MODE_OF_INTEGRATION, a.ACK_APP , a.USES_CADI from FN_APP a -- Portal assigns role 999 to app administrator left outer join FN_USER_ROLE r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999 @@ -1491,14 +1508,16 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y (a.OPEN = 'Y' and p.STATUS_CD = 'S') or (a.OPEN = 'N' and r.USER_ID is not null and (p.STATUS_CD is null or p.STATUS_CD != 'H')) - )union + ) + and a.app_type != 3 + union select distinct -- multiple roles yield multiple rows b.APP_ID , b.APP_NAME , b.APP_IMAGE_URL ,b.APP_DESCRIPTION , b.APP_NOTES , b.APP_URL , b.APP_ALTERNATE_URL , b.APP_REST_ENDPOINT , b.ML_APP_NAME , b.ML_APP_ADMIN_ID , b.MOTS_ID , b.APP_PASSWORD , b.THUMBNAIL , b.APP_USERNAME , b.OPEN , b.ENABLED , b.UEB_TOPIC_NAME , b.UEB_KEY , b.UEB_SECRET , b.APP_TYPE , b.AUTH_CENTRAL , - b.AUTH_NAMESPACE + b.AUTH_NAMESPACE , b.MODE_OF_INTEGRATION, b.ACK_APP , b.USES_CADI from fn_user_role a, fn_app b, ep_app_role_function c , fn_role d, ep_app_function e where a.user_id =:userId and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id )A @@ -1528,7 +1547,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y a.ML_APP_NAME , a.ML_APP_ADMIN_ID , a.MOTS_ID , a.APP_PASSWORD , a.THUMBNAIL , a.APP_USERNAME , a.OPEN , a.ENABLED , a.UEB_TOPIC_NAME , a.UEB_KEY , a.UEB_SECRET , a.APP_TYPE , a.AUTH_CENTRAL , - a.AUTH_NAMESPACE + a.AUTH_NAMESPACE , a.MODE_OF_INTEGRATION, a.ACK_APP , a.USES_CADI from FN_APP a -- Portal assigns role 999 to app administrator left outer join FN_USER_ROLE r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999 @@ -1540,14 +1559,16 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y (a.OPEN = 'N' and r.ROLE_ID is not null and (p.STATUS_CD is null or p.STATUS_CD != 'H')) or (a.OPEN = 'N' and r.ROLE_ID is null and p.STATUS_CD = 'S') - )union + ) + and a.app_type != 3 + union select distinct -- multiple roles yield multiple rows b.APP_ID , b.APP_NAME , b.APP_IMAGE_URL ,b.APP_DESCRIPTION , b.APP_NOTES , b.APP_URL , b.APP_ALTERNATE_URL , b.APP_REST_ENDPOINT , b.ML_APP_NAME , b.ML_APP_ADMIN_ID , b.MOTS_ID , b.APP_PASSWORD , b.THUMBNAIL , b.APP_USERNAME , b.OPEN , b.ENABLED , b.UEB_TOPIC_NAME , b.UEB_KEY , b.UEB_SECRET , b.APP_TYPE , b.AUTH_CENTRAL , - b.AUTH_NAMESPACE + b.AUTH_NAMESPACE , b.MODE_OF_INTEGRATION, b.ACK_APP , b.USES_CADI from fn_user_role a, fn_app b, ep_app_role_function c , fn_role d, ep_app_function e where a.user_id =:userId and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id ) A @@ -1575,7 +1596,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y a.ML_APP_NAME , a.ML_APP_ADMIN_ID , a.MOTS_ID , a.APP_PASSWORD , a.THUMBNAIL , a.APP_USERNAME , a.OPEN , a.ENABLED , a.UEB_TOPIC_NAME , a.UEB_KEY , a.UEB_SECRET , a.APP_TYPE , a.AUTH_CENTRAL , - a.AUTH_NAMESPACE + a.AUTH_NAMESPACE , a.MODE_OF_INTEGRATION, a.ACK_APP , a.USES_CADI from FN_APP a -- Portal assigns role 999 to app administrator left outer join FN_USER_ROLE r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999 @@ -1585,14 +1606,16 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y (a.OPEN = 'Y' and p.STATUS_CD = 'S') or (a.OPEN = 'N' and r.USER_ID is not null and (p.STATUS_CD is null or p.STATUS_CD != 'H')) - )union + ) + and a.app_type != 3 + union select distinct -- multiple roles yield multiple rows b.APP_ID , b.APP_NAME , b.APP_IMAGE_URL ,b.APP_DESCRIPTION , b.APP_NOTES , b.APP_URL , b.APP_ALTERNATE_URL , b.APP_REST_ENDPOINT , b.ML_APP_NAME , b.ML_APP_ADMIN_ID , b.MOTS_ID , b.APP_PASSWORD , b.THUMBNAIL , b.APP_USERNAME , b.OPEN , b.ENABLED , b.UEB_TOPIC_NAME , b.UEB_KEY , b.UEB_SECRET , b.APP_TYPE , b.AUTH_CENTRAL , - b.AUTH_NAMESPACE + b.AUTH_NAMESPACE , b.MODE_OF_INTEGRATION, b.ACK_APP , b.USES_CADI from fn_user_role a, fn_app b, ep_app_role_function c , fn_role d, ep_app_function e where a.user_id =:userId and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id ) A @@ -1647,8 +1670,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y left outer join FN_USER_ROLE r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999 left outer join FN_PERS_USER_APP_SEL p ON a.APP_ID = p.APP_ID and p.USER_ID = :userId left outer join EP_USER_ROLES_REQUEST q ON a.APP_ID = q.APP_ID and q.USER_ID = :userId and q.request_status = 'P' - where a.ENABLED = 'Y' - + where a.ENABLED = 'Y' and a.app_type != 3 -- Show accessible apps first, then the rest; sort by name within each set. order by access desc, app_name asc ; @@ -1897,7 +1919,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y left outer join FN_USER_ROLE r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999 left outer join FN_PERS_USER_APP_SEL p ON a.APP_ID = p.APP_ID and p.USER_ID = :userId left outer join EP_USER_ROLES_REQUEST q ON a.APP_ID = q.APP_ID and q.USER_ID = :userId and q.request_status = 'P' - where a.ENABLED = 'Y' + where a.ENABLED = 'Y' and a.app_type != 3 -- Show accessible apps first, then the rest; sort by name within each set. order by access desc, app_name asc ; @@ -2587,4 +2609,11 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y UPDATE fn_user fu SET fu.language_id=:language_id WHERE fu.login_id=:login_id ]]> </sql-query> + + <sql-query name="getMicroservicesByAppId"> + <return alias="getMicroservicesByAppId" class="org.onap.portalapp.portal.domain.MicroserviceData" /> + <![CDATA[ + SELECT * FROM ep_microservice WHERE appId =:applicationId + ]]> + </sql-query> </hibernate-mapping> diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppCatalogControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppCatalogControllerTest.java index 1c1d7bc0..8b1fc82d 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppCatalogControllerTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppCatalogControllerTest.java @@ -59,6 +59,7 @@ import org.onap.portalapp.portal.controller.AppCatalogController; import org.onap.portalapp.portal.core.MockEPUser; import org.onap.portalapp.portal.domain.EPApp; import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.domain.EpAppType; import org.onap.portalapp.portal.ecomp.model.AppCatalogItem; import org.onap.portalapp.portal.framework.MockitoTestSuite; import org.onap.portalapp.portal.service.AdminRolesService; @@ -245,23 +246,23 @@ public class AppCatalogControllerTest extends MockitoTestSuite { app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(false); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); Mockito.when(appService.getApp(persRequest.getAppId())).thenReturn(app); @@ -302,23 +303,23 @@ public class AppCatalogControllerTest extends MockitoTestSuite { app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(false); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); Mockito.when(appService.getApp(persRequest.getAppId())).thenReturn(app); diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequestTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequestTest.java index 4535cf17..6e32846c 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequestTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequestTest.java @@ -268,7 +268,7 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR); OnboardingApp expectedOnboardingApp = new OnboardingApp(); - expectedOnboardingApp.id = (long) 1; + expectedOnboardingApp.setId(1l); PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest .postOnboardAppExternal(mockedRequest, mockedResponse, expectedOnboardingApp); @@ -285,13 +285,29 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR); OnboardingApp expectedOnboardingApp = new OnboardingApp(); - expectedOnboardingApp.id = null; + expectedOnboardingApp.setId(null); + PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest .postOnboardAppExternal(mockedRequest, mockedResponse, expectedOnboardingApp); assertEquals(actualPortalRestResponse, expectedportalRestResponse); } + + private OnboardingApp createExpectedApp() { + + OnboardingApp expectedOnboardingApp = new OnboardingApp();; + expectedOnboardingApp.setAppName("test"); + expectedOnboardingApp.setLandingPage("test.com"); + expectedOnboardingApp.setRestUrl("<script>alert(/XSS”)</script>"); + expectedOnboardingApp.setMyLoginsAppOwner("testUser"); + expectedOnboardingApp.setRestrictedApp(false); + expectedOnboardingApp.setIsOpen(true); + expectedOnboardingApp.setIsEnabled(true); + return expectedOnboardingApp; + + } + @Test public void postOnboardAppExternalXSSTest() { @@ -302,14 +318,8 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { PortalRestStatusEnum portalRestStatusEnum = null; expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR); - OnboardingApp expectedOnboardingApp = new OnboardingApp();; - expectedOnboardingApp.name = "test"; - expectedOnboardingApp.url="test.com"; - expectedOnboardingApp.restUrl="<script>alert(/XSS”)</script>"; - expectedOnboardingApp.myLoginsAppOwner="testUser"; - expectedOnboardingApp.restrictedApp=false; - expectedOnboardingApp.isOpen=true; - expectedOnboardingApp.isEnabled=true; + OnboardingApp expectedOnboardingApp = createExpectedApp(); + EPUser user = mockUser.mockEPUser(); user.setEmail("guestT@test.portal.onap.org"); user.setLoginPwd("pwd"); @@ -332,8 +342,9 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR); Long appId = null; OnboardingApp expectedOnboardingApp = new OnboardingApp(); - expectedOnboardingApp.id = null; - + + expectedOnboardingApp.setId(null); + PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest .putOnboardAppExternal(mockedRequest, mockedResponse, appId, expectedOnboardingApp); assertEquals(actualPortalRestResponse, expectedportalRestResponse); @@ -348,14 +359,8 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { PortalRestStatusEnum portalRestStatusEnum = null; expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR); - OnboardingApp expectedOnboardingApp = new OnboardingApp();; - expectedOnboardingApp.name = "test"; - expectedOnboardingApp.url="test.com"; - expectedOnboardingApp.restUrl="<script>alert(/XSS”)</script>"; - expectedOnboardingApp.myLoginsAppOwner="testUser"; - expectedOnboardingApp.restrictedApp=false; - expectedOnboardingApp.isOpen=true; - expectedOnboardingApp.isEnabled=true; + OnboardingApp expectedOnboardingApp = createExpectedApp(); + EPUser user = mockUser.mockEPUser(); user.setEmail("guestT@test.portal.onap.org"); user.setLoginPwd("pwd"); @@ -381,7 +386,9 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR); Long appId = (long) 1; OnboardingApp expectedOnboardingApp = new OnboardingApp(); - expectedOnboardingApp.id = (long) 1; + + expectedOnboardingApp.setId(1l); + PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest .putOnboardAppExternal(mockedRequest, mockedResponse, appId, expectedOnboardingApp); assertEquals(actualPortalRestResponse, expectedportalRestResponse); @@ -390,21 +397,14 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { @Test public void putOnboardAppExternalIfOnboardingAppDetailsTest() { PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>(); - expectedportalRestResponse.setMessage("Failed to find user: testUser"); + expectedportalRestResponse.setMessage("Failed to find user: 12"); expectedportalRestResponse.setResponse(null); PortalRestStatusEnum portalRestStatusEnum = null; expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR); Long appId = (long) 1; - OnboardingApp expectedOnboardingApp = new OnboardingApp(); - expectedOnboardingApp.id = (long) 1; - expectedOnboardingApp.name = "test"; - expectedOnboardingApp.url="test.com"; - expectedOnboardingApp.restUrl="test1.com"; - expectedOnboardingApp.myLoginsAppOwner="testUser"; - expectedOnboardingApp.restrictedApp=false; - expectedOnboardingApp.isOpen=true; - expectedOnboardingApp.isEnabled=true; + OnboardingApp expectedOnboardingApp = createOldOnapApp(1l); + EPUser user = mockUser.mockEPUser(); user.setEmail("guestT@test.portal.onap.org"); user.setLoginPwd("pwd"); @@ -422,6 +422,27 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { assertEquals(actualPortalRestResponse, expectedportalRestResponse); } + private OnboardingApp createOldOnapApp(Long id) { + + OnboardingApp oldOnboardApp = new OnboardingApp(); + oldOnboardApp.setId(id); + oldOnboardApp.setAppName("test"); + oldOnboardApp.setLandingPage("test.com"); + oldOnboardApp.setRestUrl("test1.com"); + oldOnboardApp.setMyLoginsAppOwner("12"); + oldOnboardApp.setRestrictedApp(false); + oldOnboardApp.setIsOpen(true); + oldOnboardApp.setIsEnabled(true); + oldOnboardApp.setModeOfIntegration("test"); + oldOnboardApp.setAppAck(false); + oldOnboardApp.setUsesCadi(false); + oldOnboardApp.setModeOfIntegration("test"); + oldOnboardApp.setAppAck(false); + oldOnboardApp.setUsesCadi(false); + + return oldOnboardApp; + } + @Test public void putOnboardAppExternalIfOnboardingAppDetailsTest2() throws Exception { @@ -433,15 +454,7 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { Long appId = (long) 1; - OnboardingApp oldOnboardApp = new OnboardingApp(); - oldOnboardApp.id = (long) 1; - oldOnboardApp.name = "test"; - oldOnboardApp.url="test.com"; - oldOnboardApp.restUrl="test1.com"; - oldOnboardApp.myLoginsAppOwner="12"; - oldOnboardApp.restrictedApp=false; - oldOnboardApp.isOpen=true; - oldOnboardApp.isEnabled=true; + OnboardingApp oldOnboardApp = createOldOnapApp(1l); EPUser user = mockUser.mockEPUser(); @@ -451,7 +464,7 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { List<EPUser> expectedList = new ArrayList<EPUser>(); expectedList.add(user); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); - Mockito.when(userService.getUserByUserId(oldOnboardApp.myLoginsAppOwner)).thenReturn(expectedList); + Mockito.when(userService.getUserByUserId(oldOnboardApp.getMyLoginsAppOwner())).thenReturn(expectedList); //Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null); Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true); @@ -479,15 +492,7 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { Long appId = (long) 1; - OnboardingApp oldOnboardApp = new OnboardingApp(); - oldOnboardApp.id = (long) 1; - oldOnboardApp.name = "test"; - oldOnboardApp.url="test.com"; - oldOnboardApp.restUrl="test1.com"; - oldOnboardApp.myLoginsAppOwner="12"; - oldOnboardApp.restrictedApp=false; - oldOnboardApp.isOpen=true; - oldOnboardApp.isEnabled=true; + OnboardingApp oldOnboardApp = createOldOnapApp(1l); EPUser user = mockUser.mockEPUser(); @@ -497,7 +502,7 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { List<EPUser> expectedList = new ArrayList<EPUser>(); expectedList.add(user); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); - Mockito.when(userService.getUserByUserId(oldOnboardApp.myLoginsAppOwner)).thenReturn(expectedList); + Mockito.when(userService.getUserByUserId(oldOnboardApp.getMyLoginsAppOwner())).thenReturn(expectedList); //Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null); Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true); @@ -524,16 +529,7 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { Long appId = (long) 1; - OnboardingApp oldOnboardApp = new OnboardingApp(); - oldOnboardApp.id = (long) 1; - oldOnboardApp.name = "test"; - oldOnboardApp.url="test.com"; - oldOnboardApp.restUrl="test1.com"; - oldOnboardApp.myLoginsAppOwner="12"; - oldOnboardApp.restrictedApp=false; - oldOnboardApp.isOpen=true; - oldOnboardApp.isEnabled=true; - + OnboardingApp oldOnboardApp = createOldOnapApp(1l); EPUser user = mockUser.mockEPUser(); user.setEmail("guestT@test.portal.onap.org"); @@ -542,7 +538,7 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { List<EPUser> expectedList = new ArrayList<EPUser>(); expectedList.add(user); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); - Mockito.when(userService.getUserByUserId(oldOnboardApp.myLoginsAppOwner)).thenReturn(expectedList); + Mockito.when(userService.getUserByUserId(oldOnboardApp.getMyLoginsAppOwner())).thenReturn(expectedList); //Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null); Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false); @@ -569,17 +565,10 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { user.setLoginId("Test"); Long appId = (long) 1; - OnboardingApp oldOnboardApp = new OnboardingApp(); - oldOnboardApp.id = (long) 1; - oldOnboardApp.name = "test"; - oldOnboardApp.url="test.com"; - oldOnboardApp.restUrl="test1.com"; - oldOnboardApp.myLoginsAppOwner="12"; - oldOnboardApp.restrictedApp=false; - oldOnboardApp.isOpen=true; - oldOnboardApp.isEnabled=true; + OnboardingApp oldOnboardApp = createOldOnapApp(1l); + Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); - Mockito.when(userService.getUserByUserId(oldOnboardApp.myLoginsAppOwner)).thenThrow(nullPointerException); + Mockito.when(userService.getUserByUserId(oldOnboardApp.getMyLoginsAppOwner())).thenThrow(nullPointerException); PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest .putOnboardAppExternal(mockedRequest, mockedResponse, appId,oldOnboardApp); assertEquals(actualPortalRestResponse, expectedportalRestResponse); @@ -596,18 +585,7 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { Long appId = (long) 1; - - - OnboardingApp newOnboardApp = new OnboardingApp(); - //newOnboardApp.id = (long) 1; - newOnboardApp.name = "test"; - newOnboardApp.url="test.com"; - newOnboardApp.restUrl="test1.com"; - newOnboardApp.myLoginsAppOwner="12"; - newOnboardApp.restrictedApp=false; - newOnboardApp.isOpen=true; - newOnboardApp.isEnabled=true; - + OnboardingApp newOnboardApp = createOldOnapApp(null); EPUser user = mockUser.mockEPUser(); user.setEmail("guestT@test.portal.onap.org"); @@ -616,7 +594,7 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { List<EPUser> expectedList = new ArrayList<EPUser>(); expectedList.add(user); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); - Mockito.when(userService.getUserByUserId(newOnboardApp.myLoginsAppOwner)).thenReturn(expectedList); + Mockito.when(userService.getUserByUserId(newOnboardApp.getMyLoginsAppOwner())).thenReturn(expectedList); //Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null); Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false); @@ -634,25 +612,14 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { public void postOnboardAppExternalIsNotSuperAdminTest() throws Exception { PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>(); - expectedportalRestResponse.setMessage("java.lang.NullPointerException"); + expectedportalRestResponse.setMessage("Unexpected field: id"); expectedportalRestResponse.setResponse(null); PortalRestStatusEnum portalRestStatusEnum = null; expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR); Long appId = (long) 1; - - - OnboardingApp newOnboardApp = new OnboardingApp(); - //newOnboardApp.id = (long) 1; - newOnboardApp.name = "test"; - newOnboardApp.url="test.com"; - newOnboardApp.restUrl="test1.com"; - newOnboardApp.myLoginsAppOwner="12"; - newOnboardApp.restrictedApp=false; - newOnboardApp.isOpen=true; - newOnboardApp.isEnabled=true; - + OnboardingApp newOnboardApp = createOldOnapApp(1l); EPUser user = mockUser.mockEPUser(); user.setEmail("guestT@test.portal.onap.org"); @@ -661,7 +628,7 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { List<EPUser> expectedList = new ArrayList<EPUser>(); expectedList.add(user); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); - Mockito.when(userService.getUserByUserId(newOnboardApp.myLoginsAppOwner)).thenReturn(expectedList); + Mockito.when(userService.getUserByUserId(newOnboardApp.getMyLoginsAppOwner())).thenReturn(expectedList); //Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null); Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true); @@ -686,18 +653,7 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { Long appId = (long) 1; - - - OnboardingApp newOnboardApp = new OnboardingApp(); - //newOnboardApp.id = (long) 1; - newOnboardApp.name = "test"; - newOnboardApp.url="test.com"; - newOnboardApp.restUrl="test1.com"; - newOnboardApp.myLoginsAppOwner="12"; - newOnboardApp.restrictedApp=false; - newOnboardApp.isOpen=true; - newOnboardApp.isEnabled=true; - + OnboardingApp newOnboardApp = createOldOnapApp(null); EPUser user = mockUser.mockEPUser(); user.setEmail("guestT@test.portal.onap.org"); @@ -706,7 +662,7 @@ public class AppsControllerExternalRequestTest extends MockitoTestSuite { List<EPUser> expectedList = new ArrayList<EPUser>(); expectedList.add(user); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); - Mockito.when(userService.getUserByUserId(newOnboardApp.myLoginsAppOwner)).thenReturn(expectedList); + Mockito.when(userService.getUserByUserId(newOnboardApp.getMyLoginsAppOwner())).thenReturn(expectedList); //Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null); Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true); diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppsControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppsControllerTest.java index f622faca..bd824e45 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppsControllerTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppsControllerTest.java @@ -65,6 +65,7 @@ import org.onap.portalapp.portal.domain.AppsResponse; import org.onap.portalapp.portal.domain.EPApp; import org.onap.portalapp.portal.domain.EPUser; import org.onap.portalapp.portal.domain.EcompApp; +import org.onap.portalapp.portal.domain.EpAppType; import org.onap.portalapp.portal.domain.UserRole; import org.onap.portalapp.portal.domain.UserRoles; import org.onap.portalapp.portal.framework.MockitoTestSuite; @@ -214,23 +215,23 @@ public class AppsControllerTest extends MockitoTestSuite{ app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(false); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); expectedApps.add(app); @@ -263,23 +264,23 @@ public class AppsControllerTest extends MockitoTestSuite{ app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(false); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); expectedApps.add(app); @@ -824,14 +825,14 @@ public class AppsControllerTest extends MockitoTestSuite{ EPUser user = mockUser.mockEPUser(); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); OnboardingApp OnboardingApp = new OnboardingApp(); - OnboardingApp.isCentralAuth = true; - OnboardingApp.nameSpace = "test1"; + OnboardingApp.setRolesInAAF(true); + OnboardingApp.setNameSpace("test1"); FieldsValidator expectedFieldValidator = new FieldsValidator(); expectedFieldValidator.setHttpStatusCode((long) 200); expectedFieldValidator.setFields(null); expectedFieldValidator.setErrorCode(null); EPApp OnboardingApp1 = new EPApp(); - OnboardingApp1.setCentralAuth(false); + OnboardingApp1.setRolesInAAF(false); OnboardingApp1.setNameSpace("test"); Mockito.when(appService.getApp(Matchers.anyLong())).thenReturn(OnboardingApp1); Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true); @@ -849,8 +850,8 @@ public class AppsControllerTest extends MockitoTestSuite{ EPUser user = mockUser.mockEPUser(); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); OnboardingApp onboardingApp = new OnboardingApp(); - onboardingApp.isCentralAuth = true; - onboardingApp.nameSpace = "com.test1"; + onboardingApp.setRolesInAAF(true); + onboardingApp.setNameSpace("com.test1"); EPApp app = new EPApp(); app.setNameSpace("com.test "); FieldsValidator expectedFieldValidator = new FieldsValidator(); @@ -876,10 +877,10 @@ public class AppsControllerTest extends MockitoTestSuite{ EPUser user = mockUser.mockEPUser(); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); OnboardingApp onboardingApp = new OnboardingApp(); - onboardingApp.isCentralAuth = false; - onboardingApp.nameSpace = "com.test1"; + onboardingApp.setRolesInAAF(false); + onboardingApp.setNameSpace("com.test1"); EPApp app = new EPApp(); - app.setCentralAuth(false); + app.setRolesInAAF(false); app.setNameSpace("com.test "); FieldsValidator expectedFieldValidator = new FieldsValidator(); expectedFieldValidator.setHttpStatusCode((long) 404); @@ -902,8 +903,8 @@ public class AppsControllerTest extends MockitoTestSuite{ EPUser user = mockUser.mockEPUser(); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); OnboardingApp onboardingApp = new OnboardingApp(); - onboardingApp.isCentralAuth = true; - onboardingApp.nameSpace = "com.test1"; + onboardingApp.setRolesInAAF(true); + onboardingApp.setNameSpace("com.test1"); EPApp app = new EPApp(); app.setNameSpace("com.test "); FieldsValidator expectedFieldValidator = new FieldsValidator(); @@ -1074,11 +1075,11 @@ public class AppsControllerTest extends MockitoTestSuite{ EPApp app = new EPApp(); app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); - app.setAppType(1); + app.setAppType(EpAppType.GUI); app.setImageUrl("www.ecomp.com"); app.setThumbnail(new byte[] {1, 6, 3}); Mockito.when(appService.getApp((long) 1)).thenReturn(app); @@ -1093,11 +1094,11 @@ public class AppsControllerTest extends MockitoTestSuite{ EPApp app = new EPApp(); app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); - app.setAppType(1); + app.setAppType(EpAppType.GUI); app.setImageUrl("www.ecomp.png"); app.setThumbnail(new byte[] {1, 6, 3}); Mockito.when(appService.getApp((long) 1)).thenReturn(app); diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAccessRolesControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAccessRolesControllerTest.java index 6b06ee22..1ac21b68 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAccessRolesControllerTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAccessRolesControllerTest.java @@ -63,6 +63,7 @@ import org.onap.portalapp.portal.core.MockEPUser; import org.onap.portalapp.portal.domain.CentralV2RoleFunction; import org.onap.portalapp.portal.domain.EPApp; import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.domain.EpAppType; import org.onap.portalapp.portal.ecomp.model.PortalRestResponse; import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum; import org.onap.portalapp.portal.framework.MockitoTestSuite; @@ -125,23 +126,23 @@ public class ExternalAccessRolesControllerTest { EPApp app = new EPApp(); app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(false); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); return app; } @@ -166,7 +167,7 @@ public class ExternalAccessRolesControllerTest { PrintWriter writer = new PrintWriter(sw); Mockito.when(mockedResponse.getWriter()).thenReturn(writer); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); List<EPApp> appList = new ArrayList<>(); appList.add(app); Mockito.when(mockedRequest.getHeader("uebkey")).thenReturn(uebKey); @@ -207,7 +208,7 @@ public class ExternalAccessRolesControllerTest { String expectedCentralUser = "test"; String loginId = "test"; EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); List<EPApp> appList = new ArrayList<>(); appList.add(app); Mockito.when(mockedRequest.getHeader("uebkey")).thenReturn(uebKey); @@ -225,7 +226,7 @@ public class ExternalAccessRolesControllerTest { String expectedCentralUser = null; String loginId = "test"; EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); List<EPApp> appList = new ArrayList<>(); appList.add(app); Mockito.when(mockedRequest.getHeader("uebkey")).thenReturn(uebKey); @@ -245,7 +246,7 @@ public class ExternalAccessRolesControllerTest { List<CentralV2Role> centralV2RoleList = new ArrayList<>(); List<CentralRole> centralRoleList = new ArrayList<>(); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.FOUND); Mockito.when(externalAccessRolesService.getNameSpaceIfExists(applicationList.get(0))).thenReturn(response); @@ -267,7 +268,7 @@ public class ExternalAccessRolesControllerTest { List<CentralV2Role> centralV2RoleList = new ArrayList<>(); List<CentralRole> centralRoleList = new ArrayList<>(); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); ResponseEntity<String> response = null; Mockito.when(externalAccessRolesService.getNameSpaceIfExists(applicationList.get(0))).thenReturn(response); @@ -289,7 +290,7 @@ public class ExternalAccessRolesControllerTest { List<EPApp> applicationList = new ArrayList<>(); List<CentralV2Role> centralV2Role = new ArrayList<>(); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.FOUND); Mockito.when(externalAccessRolesService.getNameSpaceIfExists(applicationList.get(0))).thenReturn(response); @@ -309,7 +310,7 @@ public class ExternalAccessRolesControllerTest { List<EPApp> applicationList = new ArrayList<>(); List<CentralV2Role> centralV2Role = new ArrayList<>(); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); ResponseEntity<String> response = null; Mockito.when(externalAccessRolesService.getNameSpaceIfExists(applicationList.get(0))).thenReturn(response); @@ -354,7 +355,7 @@ public class ExternalAccessRolesControllerTest { List<EPApp> applicationList = new ArrayList<>(); List<CentralV2RoleFunction> centralV2RoleFunction = new ArrayList<>(); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.FOUND); Mockito.when(externalAccessRolesService.getNameSpaceIfExists(applicationList.get(0))).thenReturn(response); @@ -387,7 +388,7 @@ public class ExternalAccessRolesControllerTest { List<EPApp> applicationList = new ArrayList<>(); List<CentralV2RoleFunction> centralV2RoleFunction = new ArrayList<>(); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.FOUND); Mockito.when(externalAccessRolesService.getNameSpaceIfExists(applicationList.get(0))).thenReturn(response); @@ -419,7 +420,7 @@ public class ExternalAccessRolesControllerTest { long roleId = 1; CentralV2Role centralV2Role = new CentralV2Role.CentralV2RoleBuilder().createCentralV2Role(); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); Mockito.when(mockedRequest.getHeader("uebkey")).thenReturn(uebKey); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.FOUND); @@ -467,7 +468,7 @@ public class ExternalAccessRolesControllerTest { long roleId = 1; CentralV2Role centralV2Role = new CentralV2Role.CentralV2RoleBuilder().createCentralV2Role(); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); Mockito.when(mockedRequest.getHeader("uebkey")).thenReturn(uebKey); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.FOUND); @@ -516,7 +517,7 @@ public class ExternalAccessRolesControllerTest { CentralV2RoleFunction centralV2RoleFunction = new CentralV2RoleFunction(); centralV2RoleFunction.setCode("test"); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); Mockito.when(mockedRequest.getHeader("uebkey")).thenReturn(uebKey); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.FOUND); @@ -537,7 +538,7 @@ public class ExternalAccessRolesControllerTest { String code = "test"; CentralV2RoleFunction centralV2RoleFunction = null; EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); Mockito.when(mockedRequest.getHeader("uebkey")).thenReturn(uebKey); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.FOUND); @@ -565,7 +566,7 @@ public class ExternalAccessRolesControllerTest { @Test public void getRoleFunctionTest() throws Exception { EPApp mockApp = mockApp(); - mockApp.setCentralAuth(true); + mockApp.setRolesInAAF(true); List<EPApp> mockAppList = new ArrayList<>(); mockAppList.add(mockApp); StringWriter sw = new StringWriter(); @@ -607,7 +608,7 @@ public class ExternalAccessRolesControllerTest { public void getRoleFunctionXSSTest() throws Exception { String expected = getXSSKeyJson(); EPApp mockApp = mockApp(); - mockApp.setCentralAuth(true); + mockApp.setRolesInAAF(true); List<EPApp> mockAppList = new ArrayList<>(); mockAppList.add(mockApp); StringWriter sw = new StringWriter(); @@ -656,12 +657,12 @@ public class ExternalAccessRolesControllerTest { public void saveRoleFunctionExceptionTest() throws Exception { List<EPApp> applicationList = new ArrayList<>(); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList); PortalRestResponse<String> portalRestResponse = null; PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<>(); - expectedportalRestResponse.setMessage(null); + expectedportalRestResponse.setMessage("argument \"content\" is null"); expectedportalRestResponse.setResponse("Failed"); expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR); Mockito.when(mockedRequest.getHeader("uebkey")).thenReturn(uebKey); @@ -679,7 +680,7 @@ public class ExternalAccessRolesControllerTest { List<EPUser> userList = new ArrayList<>(); userList.add(user); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); JSONObject roleFunc = new JSONObject(); roleFunc.put("type", "test_type"); @@ -720,7 +721,7 @@ public class ExternalAccessRolesControllerTest { List<EPUser> userList = new ArrayList<>(); userList.add(user); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); JSONObject roleFunc = new JSONObject(); roleFunc.put("type", "<script>alert(“XSS”)</script> "); @@ -768,7 +769,7 @@ public class ExternalAccessRolesControllerTest { List<EPUser> userList = new ArrayList<>(); userList.add(user); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); List<EPApp> appList = new ArrayList<>(); appList.add(app); expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK); @@ -799,7 +800,7 @@ public class ExternalAccessRolesControllerTest { List<EPUser> userList = new ArrayList<>(); userList.add(user); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); List<EPApp> appList = new ArrayList<>(); appList.add(app); String code = "<script>alert(‘XSS’)</script>"; @@ -831,7 +832,7 @@ public class ExternalAccessRolesControllerTest { public void getActiveRolesValidationTest() throws Exception { List<CentralRole> expectedRolesList = null; EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); List<EPApp> appList = new ArrayList<>(); appList.add(app); List<CentralV2Role> cenRoles = new ArrayList<>(); @@ -1112,7 +1113,7 @@ public class ExternalAccessRolesControllerTest { Mockito.when(mockedResponse.getWriter()).thenReturn(writer); List<EPApp> applicationList = new ArrayList<>(); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList); Mockito.when(externalAccessRolesService.getAllAppUsers(mockedRequest.getHeader(uebKey))).thenReturn(users); @@ -1209,7 +1210,7 @@ public class ExternalAccessRolesControllerTest { List<EPApp> applicationList = new ArrayList<>(); EPApp app = mockApp(); app.setUebKey("uebKey"); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK); @@ -1222,7 +1223,7 @@ public class ExternalAccessRolesControllerTest { List<EPApp> applicationList = new ArrayList<>(); EPApp app = mockApp(); app.setUebKey("uebKey"); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK); @@ -1241,7 +1242,7 @@ public class ExternalAccessRolesControllerTest { public void getEpUserExceptionTest() throws Exception { List<EPApp> applicationList = new ArrayList<>(); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList); StringWriter sw = new StringWriter(); PrintWriter writer = new PrintWriter(sw); @@ -1254,7 +1255,7 @@ public class ExternalAccessRolesControllerTest { List<EPApp> applicationList = new ArrayList<>(); EPApp app = mockApp(); app.setUebKey("uebKey"); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK); @@ -1279,7 +1280,7 @@ public class ExternalAccessRolesControllerTest { List<EPApp> applicationList = new ArrayList<>(); EPApp app = mockApp(); app.setUebKey("uebKey"); - app.setCentralAuth(true); + app.setRolesInAAF(true); applicationList.add(app); Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK); @@ -1297,7 +1298,7 @@ public class ExternalAccessRolesControllerTest { public void getEPRolesOfApplicationExceptionTest() throws Exception { List<EPApp> applicationList = new ArrayList<>(); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList); StringWriter sw = new StringWriter(); PrintWriter writer = new PrintWriter(sw); @@ -1319,7 +1320,7 @@ public class ExternalAccessRolesControllerTest { List<EPUser> userList = new ArrayList<>(); userList.add(user); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); List<EPApp> appList = new ArrayList<>(); appList.add(app); expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK); @@ -1351,7 +1352,7 @@ public class ExternalAccessRolesControllerTest { List<EPUser> userList = new ArrayList<>(); userList.add(user); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); List<EPApp> appList = new ArrayList<>(); appList.add(app); expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR); @@ -1383,7 +1384,7 @@ public class ExternalAccessRolesControllerTest { List<EPUser> userList = new ArrayList<>(); userList.add(user); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); List<EPApp> appList = new ArrayList<>(); appList.add(app); expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR); @@ -1435,7 +1436,7 @@ public class ExternalAccessRolesControllerTest { List<EPUser> userList = new ArrayList<>(); userList.add(user); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); List<EPApp> appList = new ArrayList<>(); appList.add(app); expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK); @@ -1467,7 +1468,7 @@ public class ExternalAccessRolesControllerTest { List<EPUser> userList = new ArrayList<>(); userList.add(user); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); List<EPApp> appList = new ArrayList<>(); appList.add(app); String code = "<img src=xss onerror=alert(1)>"; @@ -1497,7 +1498,7 @@ public class ExternalAccessRolesControllerTest { List<EPUser> userList = new ArrayList<>(); userList.add(user); EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); List<EPApp> appList = new ArrayList<>(); appList.add(app); expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR); diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulControllerTest.java index d6cb42a6..890319dc 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulControllerTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulControllerTest.java @@ -66,6 +66,7 @@ import org.onap.portalapp.portal.core.MockEPUser; 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.EpAppType; import org.onap.portalapp.portal.framework.MockitoTestSuite; import org.onap.portalapp.portal.service.AdminRolesService; import org.onap.portalapp.portal.service.AdminRolesServiceImpl; @@ -135,24 +136,24 @@ public class ExternalAppsRestfulControllerTest { app.setName("Test"); app.setImageUrl("test"); app.setNameSpace("com.test.app"); - app.setCentralAuth(true); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setRolesInAAF(true); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 10); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(true); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); return app; } 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 bee5d932..80099d57 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 @@ public class FunctionalMenuControllerTest extends MockitoTestSuite { @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/controller/RoleManageControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/RoleManageControllerTest.java index b004a4a1..bbc842a6 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/RoleManageControllerTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/RoleManageControllerTest.java @@ -73,6 +73,7 @@ import org.onap.portalapp.portal.domain.CentralV2RoleFunction; import org.onap.portalapp.portal.domain.CentralizedApp; import org.onap.portalapp.portal.domain.EPApp; import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.domain.EpAppType; import org.onap.portalapp.portal.ecomp.model.PortalRestResponse; import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum; import org.onap.portalapp.portal.ecomp.model.UploadRoleFunctionExtSystem; @@ -170,16 +171,18 @@ public class RoleManageControllerTest { @Test public void getRoleIfRoleIdNullTest() throws Exception { + EPApp app = mockApp(); + app.setRolesInAAF(true); PowerMockito.mockStatic(EPUserUtils.class); PowerMockito.mockStatic(EcompPortalUtils.class); EPUser user = mockUser.mockEPUser(); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); Mockito.when(EcompPortalUtils.checkIfRemoteCentralAccessAllowed()).thenReturn(true); - Mockito.when(appService.getApp((long) 1)).thenReturn(CentralApp()); - Mockito.when(adminRolesService.isAccountAdminOfApplication(user, CentralApp())).thenReturn(true); + Mockito.when(appService.getApp((long) 1)).thenReturn(app); + Mockito.when(adminRolesService.isAccountAdminOfApplication(user, app)).thenReturn(true); List<EPApp> apps = new ArrayList<>(); - apps.add(CentralApp()); - Mockito.when(externalAccessRolesService.getApp(CentralApp().getUebKey())).thenReturn(apps); + apps.add(app); + Mockito.when(externalAccessRolesService.getApp(app.getUebKey())).thenReturn(apps); ResponseEntity<String> result = new ResponseEntity<>(HttpStatus.OK); Mockito.when(externalAccessRolesService.getNameSpaceIfExists(apps.get(0))).thenReturn(result); CentralV2Role answer = new CentralV2Role.CentralV2RoleBuilder().createCentralV2Role(); @@ -191,7 +194,7 @@ public class RoleManageControllerTest { PrintWriter writer = new PrintWriter(sw); Mockito.when(mockedResponse.getWriter()).thenReturn(writer); List<EPApp> appList = new ArrayList<>(); - appList.add(CentralApp()); + appList.add(app); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK); Mockito.when(externalAccessRolesService.getNameSpaceIfExists(Matchers.anyObject())).thenReturn(response); Mockito.when(externalAccessRolesService.getApp(Matchers.anyString())).thenReturn(appList); @@ -241,23 +244,26 @@ public class RoleManageControllerTest { app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(false); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); + app.setModeOfIntegration("test"); + app.setAppAck(false); + app.setUsesCadi(false); return app; } @@ -265,7 +271,7 @@ public class RoleManageControllerTest { @Test public void getRolesTest() throws Exception { EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); PowerMockito.mockStatic(EPUserUtils.class); PowerMockito.mockStatic(EcompPortalUtils.class); EPUser user = mockUser.mockEPUser(); @@ -298,13 +304,16 @@ public class RoleManageControllerTest { @Test public void getRoleFunctionListTest() throws Exception { + EPApp app = mockApp(); + app.setRolesInAAF(true); PowerMockito.mockStatic(EPUserUtils.class); PowerMockito.mockStatic(EcompPortalUtils.class); EPUser user = mockUser.mockEPUser(); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); Mockito.when(EcompPortalUtils.checkIfRemoteCentralAccessAllowed()).thenReturn(true); - Mockito.when(adminRolesService.isAccountAdminOfApplication(user, CentralApp())).thenReturn(true); - Mockito.when(appService.getApp((long) 1)).thenReturn(CentralApp()); + Mockito.when(adminRolesService.isAccountAdminOfApplication(user, app)).thenReturn(true); + + Mockito.when(appService.getApp((long) 1)).thenReturn(app); List<CentralV2RoleFunction> answer = new ArrayList<>(); Mockito.when(externalAccessRolesService.getRoleFuncList("test")).thenReturn(answer); StringWriter sw = new StringWriter(); @@ -326,13 +335,15 @@ public class RoleManageControllerTest { @Test public void saveRoleFunctionTest() throws Exception { + EPApp app = mockApp(); + app.setRolesInAAF(true); PowerMockito.mockStatic(EPUserUtils.class); PowerMockito.mockStatic(EcompPortalUtils.class); EPUser user = mockUser.mockEPUser(); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); Mockito.when(EcompPortalUtils.checkIfRemoteCentralAccessAllowed()).thenReturn(true); - Mockito.when(adminRolesService.isAccountAdminOfApplication(user, CentralApp())).thenReturn(true); - Mockito.when(appService.getApp((long) 1)).thenReturn(CentralApp()); + Mockito.when(adminRolesService.isAccountAdminOfApplication(user, app)).thenReturn(true); + Mockito.when(appService.getApp((long) 1)).thenReturn(app); Mockito.doNothing().when(roleFunctionListController).saveRoleFunction(mockedRequest, mockedResponse, "test"); CentralV2RoleFunction addNewFunc = new CentralV2RoleFunction(); addNewFunc.setCode("Test"); @@ -351,7 +362,7 @@ public class RoleManageControllerTest { List<EPUser> userList = new ArrayList<>(); userList.add(user); List<EPApp> appList = new ArrayList<>(); - appList.add(CentralApp()); + appList.add(app); Mockito.when(externalAccessRolesService.getUser("guestT")).thenReturn(userList); StringWriter sw = new StringWriter(); PrintWriter writer = new PrintWriter(sw); @@ -430,14 +441,16 @@ public class RoleManageControllerTest { @Test public void removeRoleFunctionTest() throws Exception { + EPApp app = mockApp(); + app.setRolesInAAF(true); PowerMockito.mockStatic(EPUserUtils.class); PowerMockito.mockStatic(EcompPortalUtils.class); EPUser user = mockUser.mockEPUser(); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); Mockito.when(EcompPortalUtils.checkIfRemoteCentralAccessAllowed()).thenReturn(true); - Mockito.when(adminRolesService.isAccountAdminOfApplication(user, CentralApp())).thenReturn(true); + Mockito.when(adminRolesService.isAccountAdminOfApplication(user, app)).thenReturn(true); Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user); - Mockito.when(appService.getApp((long) 1)).thenReturn(CentralApp()); + Mockito.when(appService.getApp((long) 1)).thenReturn(app); String roleFun = "{\"name\":\"Test\",\"type\":\"Test\",\"action\":\"Test\", \"code\":\"Test\"}"; CentralV2RoleFunction roleFunction = mockCentralRoleFunction(); Mockito.when(externalAccessRolesService.getRoleFunction("Test|Test|Test", "test")).thenReturn(roleFunction); @@ -447,7 +460,7 @@ public class RoleManageControllerTest { Mockito.when(externalAccessRolesService.deleteCentralRoleFunction(Matchers.anyString(), Matchers.anyObject())) .thenReturn(true); List<EPApp> appList = new ArrayList<>(); - appList.add(CentralApp()); + appList.add(app); ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK); Mockito.when(externalAccessRolesService.getNameSpaceIfExists(Matchers.anyObject())).thenReturn(response); Mockito.when(externalAccessRolesService.getApp(Matchers.anyString())).thenReturn(appList); @@ -512,7 +525,7 @@ public class RoleManageControllerTest { @Test public void removeRoleFunctionIfAppNotCentralizedTest() throws Exception { EPApp app = mockApp(); - app.setCentralAuth(false); + app.setRolesInAAF(false); Mockito.when(appService.getApp((long) 1)).thenReturn(app); String roleFun = "{\"name\":\"Test\",\"code\":\"Test\"}"; roleManageController.removeRoleFunction(mockedRequest, mockedResponse, roleFun, (long) 1); @@ -1021,14 +1034,14 @@ public class RoleManageControllerTest { public EPApp CentralApp() { EPApp app = mockApp(); - app.setCentralAuth(true); + app.setRolesInAAF(true); app.setNameSpace("com.test"); return app; } public EPApp NonCentralApp() { EPApp app = mockApp(); - app.setCentralAuth(false); + app.setRolesInAAF(false); return app; } diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogControllerTest.java index 675e4f4c..5daacbdc 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogControllerTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogControllerTest.java @@ -353,28 +353,6 @@ public class WidgetsCatalogControllerTest { @SuppressWarnings("unchecked") @Test - public void getWidgetControllerTest() throws Exception { - PowerMockito.mockStatic(EcompPortalUtils.class); - PowerMockito.mockStatic(SystemProperties.class); - PowerMockito.mockStatic(EPCommonSystemProperties.class); - PowerMockito.mockStatic(CipherUtil.class); - Mockito.when(EcompPortalUtils.widgetMsProtocol()).thenReturn("test1"); - Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WIDGET_MS_PROTOCOL)).thenReturn("https"); - Mockito.when(SystemProperties.getProperty("microservices.widget.local.port")).thenReturn("test"); - Mockito.when(EcompPortalUtils.getPropertyOrDefault("microservices.widget.username", "widget_user")) - .thenReturn("test"); - Mockito.when(CipherUtil - .decryptPKC(EcompPortalUtils.getPropertyOrDefault("microservices.widget.password", "widget_password"))) - .thenReturn("abc"); - Mockito.when(widgetMService.getServiceLocation("widgets-service", "test")).thenReturn("test.com"); - Mockito.when(template.getForObject(Mockito.anyString(), Mockito.any(Class.class), Mockito.any(String.class))) - .thenReturn("test123"); - String result = widgetsCatalogController.getWidgetController(1); - assertNull(result); - } - - @SuppressWarnings("unchecked") - @Test public void getWidgetCSSTest() throws Exception { PowerMockito.mockStatic(EcompPortalUtils.class); PowerMockito.mockStatic(SystemProperties.class); diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogUnRestrictedControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogUnRestrictedControllerTest.java new file mode 100644 index 00000000..fbee7647 --- /dev/null +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogUnRestrictedControllerTest.java @@ -0,0 +1,143 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2020 AT&T 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.controller; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Matchers; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.onap.portalapp.portal.core.MockEPUser; +import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.domain.MicroserviceParameter; +import org.onap.portalapp.portal.domain.WidgetCatalog; +import org.onap.portalapp.portal.domain.WidgetCatalogParameter; +import org.onap.portalapp.portal.domain.WidgetParameterResult; +import org.onap.portalapp.portal.ecomp.model.PortalRestResponse; +import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum; +import org.onap.portalapp.portal.framework.MockitoTestSuite; +import org.onap.portalapp.portal.service.MicroserviceServiceImpl; +import org.onap.portalapp.portal.service.WidgetMService; +import org.onap.portalapp.portal.service.WidgetMServiceImpl; +import org.onap.portalapp.portal.service.WidgetParameterServiceImpl; +import org.onap.portalapp.portal.utils.EPCommonSystemProperties; +import org.onap.portalapp.portal.utils.EcompPortalUtils; +import org.onap.portalapp.util.EPUserUtils; +import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.util.SystemProperties; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.mock.web.MockHttpServletResponse; +import org.springframework.mock.web.MockMultipartFile; +import org.springframework.mock.web.MockMultipartHttpServletRequest; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.RestTemplate; + +@SuppressWarnings("rawtypes") +@RunWith(PowerMockRunner.class) +@PrepareForTest({ EPUserUtils.class, CipherUtil.class, EcompPortalUtils.class, SystemProperties.class, + EPCommonSystemProperties.class, EPUserUtils.class }) +public class WidgetsCatalogUnRestrictedControllerTest { + + @Mock + WidgetMService widgetMService = new WidgetMServiceImpl(); + + @InjectMocks + WidgetsCatalogUnRestrictedController widgetsCatalogControllerTest = new WidgetsCatalogUnRestrictedController(); + + @Before + public void setup() { + MockitoAnnotations.initMocks(this); + } + + @Mock + RestTemplate template = new RestTemplate(); + + MockitoTestSuite mockitoTestSuite = new MockitoTestSuite(); + + HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest(); + HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse(); + + NullPointerException nullPointerException = new NullPointerException(); + + MockEPUser mockUser = new MockEPUser(); + + + @SuppressWarnings("unchecked") + @Test + public void getWidgetControllerTest() throws Exception { + PowerMockito.mockStatic(EcompPortalUtils.class); + PowerMockito.mockStatic(SystemProperties.class); + PowerMockito.mockStatic(EPCommonSystemProperties.class); + PowerMockito.mockStatic(CipherUtil.class); + Mockito.when(EcompPortalUtils.widgetMsProtocol()).thenReturn("test1"); + Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WIDGET_MS_PROTOCOL)).thenReturn("https"); + Mockito.when(SystemProperties.getProperty("microservices.widget.local.port")).thenReturn("test"); + Mockito.when(EcompPortalUtils.getPropertyOrDefault("microservices.widget.username", "widget_user")) + .thenReturn("test"); + Mockito.when(CipherUtil + .decryptPKC(EcompPortalUtils.getPropertyOrDefault("microservices.widget.password", "widget_password"))) + .thenReturn("abc"); + Mockito.when(widgetMService.getServiceLocation("widgets-service", "test")).thenReturn("test.com"); + Mockito.when(template.getForObject(Mockito.anyString(), Mockito.any(Class.class), Mockito.any(String.class))) + .thenReturn("test123"); + String result = widgetsCatalogControllerTest.getWidgetController(1); + assertNull(result); + } + + + +} diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPAppTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPAppTest.java index 56f0e5ca..640411ef 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPAppTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPAppTest.java @@ -50,29 +50,25 @@ public class EPAppTest { private static final String TEST="test"; public EPApp mockEPApp(EPApp epApp){ - epApp.setId(1l); epApp.setName(TEST); epApp.setImageUrl(TEST); - epApp.setDescription(TEST); - epApp.setNotes(TEST); - epApp.setUrl(TEST); - epApp.setAlternateUrl(TEST); + epApp.setAppDescription(TEST); + epApp.setAppNotes(TEST); + epApp.setLandingPage(TEST); + epApp.setAlternateLandingPage(TEST); epApp.setAppRestEndpoint(TEST); epApp.setMlAppName(TEST); epApp.setMlAppAdminId(TEST); epApp.setMotsId((long)1); - epApp.setUsername(TEST); - epApp.setAppPassword(TEST); + epApp.setAppBasicAuthUsername(TEST); + epApp.setAppBasicAuthPassword(TEST); epApp.setOpen(false); epApp.setEnabled(false); epApp.setUebTopicName(TEST); epApp.setUebSecret(TEST); - epApp.setAppType(1); - epApp.setCentralAuth(false); + epApp.setAppType(EpAppType.GUI); + epApp.setRolesInAAF(false); epApp.setNameSpace(TEST); - epApp.setRestrictedApp(true); - epApp.setRestrictedApp(false); - epApp.setAppType(null); epApp.setOpen(null); epApp.setThumbnail(TEST.getBytes()); epApp.setUebKey(TEST); @@ -86,116 +82,62 @@ public class EPAppTest { epApp1 = mockEPApp(epApp1); EPApp epApp=new EPApp(); - epApp.setId(epApp1.getId()); epApp.setName(epApp1.getName()); epApp.setImageUrl(epApp1.getImageUrl()); - epApp.setDescription(epApp1.getDescription()); - epApp.setNotes(epApp1.getNotes()); - epApp.setUrl(epApp1.getUrl()); - epApp.setAlternateUrl(epApp1.getAlternateUrl()); + epApp.setAppDescription(epApp1.getAppDescription()); + epApp.setAppNotes(epApp1.getAppNotes()); + epApp.setLandingPage(epApp1.getLandingPage()); + epApp.setAlternateLandingPage(epApp1.getAlternateLandingPage()); epApp.setAppRestEndpoint(epApp1.getAppRestEndpoint()); epApp.setMlAppName(epApp1.getMlAppName()); epApp.setMlAppAdminId(epApp1.getMlAppAdminId()); epApp.setMotsId(epApp1.getMotsId()); - epApp.setUsername(epApp1.getUsername()); - epApp.setAppPassword(epApp1.getAppPassword()); + epApp.setAppBasicAuthUsername(epApp1.getAppBasicAuthUsername()); + epApp.setAppBasicAuthPassword(epApp1.getAppBasicAuthPassword()); epApp.setOpen(epApp1.getOpen()); epApp.setEnabled(epApp1.getEnabled()); epApp.setUebTopicName(epApp1.getUebTopicName()); epApp.setUebSecret(epApp1.getUebSecret()); epApp.setAppType(epApp1.getAppType()); - epApp.setCentralAuth(epApp1.getCentralAuth()); + epApp.setRolesInAAF(epApp1.getRolesInAAF()); epApp.setNameSpace(epApp1.getNameSpace()); - epApp.setRestrictedApp(epApp1.isRestrictedApp()); epApp.setAppType(epApp1.getAppType()); epApp.setThumbnail(epApp1.getThumbnail()); epApp.setUebKey(epApp1.getUebKey()); - epApp.compareTo(epApp1); assertEquals(epApp.hashCode(), epApp1.hashCode()); - assertTrue(epApp.equals(epApp1)); assertFalse(epApp.equals(null)); assertEquals(epApp.getName(), TEST); - assertEquals(epApp.getId(), Long.valueOf(1l)); assertEquals(epApp.getImageUrl(), TEST); - assertEquals(epApp.getDescription(), TEST); - assertEquals(epApp.getNotes(), TEST); - assertEquals(epApp.getUrl(), TEST); - assertEquals(epApp.getAlternateUrl(), TEST); + assertEquals(epApp.getAppDescription(), TEST); + assertEquals(epApp.getAppNotes(), TEST); + assertEquals(epApp.getLandingPage(), TEST); + assertEquals(epApp.getAlternateLandingPage(), TEST); assertEquals(epApp.getAppRestEndpoint(), TEST); assertEquals(epApp.getMlAppName(), TEST); assertEquals(epApp.getMlAppAdminId(), TEST); assertEquals(epApp.getMotsId(), new Long(1)); - assertEquals(epApp.getUsername(), TEST); - assertEquals(epApp.getAppPassword(), TEST); + assertEquals(epApp.getAppBasicAuthUsername(), TEST); + assertEquals(epApp.getAppBasicAuthPassword(), TEST); assertEquals(epApp.getOpen(), false); assertEquals(epApp.getEnabled(), false); assertEquals(epApp.getUebTopicName(), TEST); assertEquals(epApp.getUebSecret(), TEST); assertEquals(epApp.getAppType(), Integer.valueOf(1)); - assertEquals(epApp.getCentralAuth(), false); + assertEquals(epApp.getRolesInAAF(), false); assertEquals(epApp.getNameSpace(), TEST); assertEquals(epApp.getUebKey(), TEST); assertEquals(epApp.getOpen(), false); assertEquals(epApp.isRestrictedApp(), false); assertEquals(epApp.hashCode(), epApp1.hashCode()); - assertTrue(epApp.equals(epApp1)); - //epApp.compareTo(epApp1); assertNotNull(epApp.toString()); epApp.setContactUs(new AppContactUs()); assertNotNull(epApp.getContactUs()); - - epApp.setUsername(null); - assertFalse(epApp.equals(epApp1)); - epApp.setUrl(null); - assertFalse(epApp.equals(epApp1)); - epApp.setUebTopicName(null); - assertFalse(epApp.equals(epApp1)); - - epApp.setUebSecret(null); - assertFalse(epApp.equals(epApp1)); - epApp.setUebKey(null); - assertFalse(epApp.equals(epApp1)); - epApp.setOpen(null); - assertFalse(epApp.equals(epApp1)); - epApp.setNotes(null); - assertFalse(epApp.equals(epApp1)); - epApp.setNameSpace(null); - assertFalse(epApp.equals(epApp1)); - - epApp.setName(null); - assertFalse(epApp.equals(epApp1)); - epApp.setMotsId(null); - assertFalse(epApp.equals(epApp1)); - epApp.setMlAppName(null); - assertFalse(epApp.equals(epApp1)); - epApp.setMlAppAdminId(null); - assertFalse(epApp.equals(epApp1)); - epApp.setImageUrl(null); - assertFalse(epApp.equals(epApp1)); - epApp.setEnabled(null); - assertFalse(epApp.equals(epApp1)); - epApp.setDescription(null); - assertFalse(epApp.equals(epApp1)); - epApp.setContactUs(null); - assertFalse(epApp.equals(epApp1)); - - epApp.setCentralAuth(null); - assertFalse(epApp.equals(epApp1)); - - epApp.setAppType(null); - assertFalse(epApp.equals(epApp1)); - epApp.setAppRestEndpoint(null); - assertFalse(epApp.equals(epApp1)); - epApp.setAppPassword(null); - assertFalse(epApp.equals(epApp1)); - - epApp.setAlternateUrl(null); - assertFalse(epApp.equals(epApp1)); + } } 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 00000000..27118a4c --- /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/domain/EPUserAppTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppTest.java index 0923d033..eddbe418 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppTest.java @@ -53,16 +53,16 @@ public class EPUserAppTest { EPApp epApp = new EPApp(); epApp.setName("test"); epApp.setImageUrl("test"); - epApp.setDescription("test"); - epApp.setNotes("test"); - epApp.setUrl("test"); - epApp.setAlternateUrl("test"); + epApp.setAppDescription("test"); + epApp.setAppNotes("test"); + epApp.setLandingPage("test"); + epApp.setAlternateLandingPage("test"); epApp.setAppRestEndpoint("test"); epApp.setMlAppName("test"); epApp.setMlAppAdminId("test"); epApp.setMotsId((long)1); - epApp.setUsername("test"); - epApp.setAppPassword("test"); + epApp.setAppBasicAuthUsername("test"); + epApp.setAppBasicAuthPassword("test"); //Role @@ -90,16 +90,16 @@ public class EPUserAppTest { EPApp epApp = new EPApp(); epApp.setName("test"); epApp.setImageUrl("test"); - epApp.setDescription("test"); - epApp.setNotes("test"); - epApp.setUrl("test"); - epApp.setAlternateUrl("test"); + epApp.setAppDescription("test"); + epApp.setAppNotes("test"); + epApp.setLandingPage("test"); + epApp.setAlternateLandingPage("test"); epApp.setAppRestEndpoint("test"); epApp.setMlAppName("test"); epApp.setMlAppAdminId("test"); epApp.setMotsId((long)1); - epApp.setUsername("test"); - epApp.setAppPassword("test"); + epApp.setAppBasicAuthUsername("test"); + epApp.setAppBasicAuthPassword("test"); user.setApp(epApp); //Role @@ -152,16 +152,16 @@ public class EPUserAppTest { epApp.setId((long) 12345); epApp.setName("test"); epApp.setImageUrl("test"); - epApp.setDescription("test"); - epApp.setNotes("test"); - epApp.setUrl("test"); - epApp.setAlternateUrl("test"); + epApp.setAppDescription("test"); + epApp.setAppNotes("test"); + epApp.setLandingPage("test"); + epApp.setAlternateLandingPage("test"); epApp.setAppRestEndpoint("test"); epApp.setMlAppName("test"); epApp.setMlAppAdminId("test"); epApp.setMotsId((long)1); - epApp.setUsername("test"); - epApp.setAppPassword("test"); + epApp.setAppBasicAuthUsername("test"); + epApp.setAppBasicAuthPassword("test"); return epApp; } 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 00000000..9154e8d0 --- /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 7109b2d0..d2958437 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 @@ package org.onap.portalapp.portal.exceptions; 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 00000000..889b28f2 --- /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 00000000..db17e784 --- /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/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptorTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptorTest.java index 81b4e64d..94d46506 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptorTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptorTest.java @@ -152,7 +152,7 @@ public class PortalResourceInterceptorTest { data.add("test/test"); List<EPApp> apps=new ArrayList<>(); EPApp app=new EPApp(); - app.setUsername("test"); + app.setAppBasicAuthUsername("test"); apps.add(app); when(request.getRequestURI()).thenReturn("test/portalApi/test/test"); diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/scheduler/RestObjectTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/scheduler/RestObjectTest.java new file mode 100644 index 00000000..563135c5 --- /dev/null +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/scheduler/RestObjectTest.java @@ -0,0 +1,57 @@ +/*- + * ============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.scheduler; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import org.junit.Test; + +public class RestObjectTest { + RestObject rs=new RestObject(); + + @Test + public void testGetMethods() { + rs.setStatusCode(200); + rs.setUUID("1234"); + assertEquals(rs.getUUID(),"1234"); + assertEquals(rs.getStatusCode(),200); +// assertNull(rs.get()); + } + +} diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/AdminRolesServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/AdminRolesServiceImplTest.java index f14d3fd9..7f34583c 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/AdminRolesServiceImplTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/AdminRolesServiceImplTest.java @@ -69,6 +69,7 @@ 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.EPUserApp; +import org.onap.portalapp.portal.domain.EpAppType; import org.onap.portalapp.portal.domain.UserRole; import org.onap.portalapp.portal.transport.AppNameIdIsAdmin; import org.onap.portalapp.portal.transport.AppsListWithAdminRole; @@ -140,24 +141,24 @@ public class AdminRolesServiceImplTest { app.setName("Test"); app.setImageUrl("test"); app.setNameSpace("com.test.app"); - app.setCentralAuth(true); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setRolesInAAF(true); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(true); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); return app; } diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/AppContactUsServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/AppContactUsServiceImplTest.java index acc25ac8..e5b7431e 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/AppContactUsServiceImplTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/AppContactUsServiceImplTest.java @@ -55,6 +55,7 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.onap.portalapp.portal.domain.AppContactUs; import org.onap.portalapp.portal.domain.EPApp; +import org.onap.portalapp.portal.domain.EpAppType; import org.onap.portalapp.portal.ecomp.model.AppCategoryFunctionsItem; import org.onap.portalapp.portal.ecomp.model.AppContactUsItem; import org.onap.portalapp.portal.framework.MockitoTestSuite; @@ -92,23 +93,23 @@ public class AppContactUsServiceImplTest { EPApp app = new EPApp(); app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(true); app.setEnabled(false); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); return app; } @Test diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImplTest.java index a9747335..df73316b 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImplTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImplTest.java @@ -91,7 +91,7 @@ public class ApplicationsRestClientServiceImplTest { public void unt_get_failure() throws HTTPException{ EPApp appTest=new EPApp(); appTest.setAppRestEndpoint("https"); - appTest.setAppPassword("testPassword"); + appTest.setAppBasicAuthPassword("testPassword"); Mockito.when(appsCacheService.getApp(Matchers.anyLong())).thenReturn(appTest); ApplicationsRestClientServiceImpl appservice=serviceImpl.get(ApplicationsRestClientServiceImpl.class, 12L,"/path" ); Assert.assertNull(appservice); @@ -109,7 +109,7 @@ public class ApplicationsRestClientServiceImplTest { Mockito.when(response.getStatus()).thenReturn(HttpStatus.SC_OK); EPApp appTest=new EPApp(); appTest.setAppRestEndpoint("https"); - appTest.setAppPassword("testPassword"); + appTest.setAppBasicAuthPassword("testPassword"); Mockito.when(appsCacheService.getApp(Matchers.anyLong())).thenReturn(appTest); ApplicationsRestClientServiceImpl appservice=serviceImpl.get(ApplicationsRestClientServiceImpl.class, 12L,"/path" ); Assert.assertNull(appservice); @@ -127,7 +127,7 @@ public class ApplicationsRestClientServiceImplTest { Mockito.when(response.getStatus()).thenReturn(1); EPApp appTest=new EPApp(); appTest.setAppRestEndpoint("https"); - appTest.setAppPassword("testPassword"); + appTest.setAppBasicAuthPassword("testPassword"); Mockito.when(appsCacheService.getApp(Matchers.anyLong())).thenReturn(appTest); ApplicationsRestClientServiceImpl appservice=serviceImpl.get(ApplicationsRestClientServiceImpl.class, 12L,"/path" ); Assert.assertNull(appservice); @@ -139,7 +139,7 @@ public class ApplicationsRestClientServiceImplTest { PowerMockito.mockStatic(Object.class); EPApp appTest=new EPApp(); appTest.setAppRestEndpoint("https"); - appTest.setAppPassword("testPassword"); + appTest.setAppBasicAuthPassword("testPassword"); Mockito.when(appsCacheService.getApp(Matchers.anyLong())).thenReturn(appTest); ApplicationsRestClientServiceImpl appservice=serviceImpl.post(ApplicationsRestClientServiceImpl.class, 12L, Matchers.any() , "/path",Matchers.any()); Assert.assertNull(appservice); @@ -163,7 +163,7 @@ public class ApplicationsRestClientServiceImplTest { Mockito.when(response.getStatus()).thenReturn(HttpStatus.SC_OK); EPApp appTest=new EPApp(); appTest.setAppRestEndpoint("https"); - appTest.setAppPassword("testPassword"); + appTest.setAppBasicAuthPassword("testPassword"); Mockito.when(appsCacheService.getApp(Matchers.anyLong())).thenReturn(appTest); ApplicationsRestClientServiceImpl appservice=serviceImpl.post(ApplicationsRestClientServiceImpl.class, 12L,payload,"/path",SystemType.APPLICATION); Assert.assertNull(appservice); @@ -188,7 +188,7 @@ public class ApplicationsRestClientServiceImplTest { Mockito.when(response.getStatus()).thenReturn(HttpStatus.SC_OK); EPApp appTest=new EPApp(); appTest.setAppRestEndpoint("https"); - appTest.setAppPassword("testPassword"); + appTest.setAppBasicAuthPassword("testPassword"); Mockito.when(appsCacheService.getApp(Matchers.anyLong())).thenReturn(appTest); ApplicationsRestClientServiceImpl appservice=serviceImpl.post(ApplicationsRestClientServiceImpl.class, 12L,payload,"/path",SystemType.APPLICATION); Assert.assertNull(appservice); @@ -213,7 +213,7 @@ public class ApplicationsRestClientServiceImplTest { Mockito.when(response.getStatus()).thenReturn(1); EPApp appTest=new EPApp(); appTest.setAppRestEndpoint("https"); - appTest.setAppPassword("testPassword"); + appTest.setAppBasicAuthPassword("testPassword"); Mockito.when(appsCacheService.getApp(Matchers.anyLong())).thenReturn(appTest); ApplicationsRestClientServiceImpl appservice=serviceImpl.post(ApplicationsRestClientServiceImpl.class, 12L,payload,"/path",SystemType.APPLICATION); Assert.assertNull(appservice); @@ -232,7 +232,7 @@ public class ApplicationsRestClientServiceImplTest { Mockito.when(response.getStatus()).thenReturn(1); EPApp appTest=new EPApp(); appTest.setAppRestEndpoint("https"); - appTest.setAppPassword("testPassword"); + appTest.setAppBasicAuthPassword("testPassword"); Mockito.when(appsCacheService.getApp(Matchers.anyLong())).thenReturn(appTest); ApplicationsRestClientServiceImpl appservice=serviceImpl.get(ApplicationsRestClientServiceImpl.class, 12L,"/path" , Matchers.anyBoolean()); Assert.assertNull(appservice); diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImplTest.java index 6382bef4..a905ca81 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImplTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImplTest.java @@ -42,6 +42,8 @@ import org.onap.portalapp.portal.domain.EPEndpoint; import org.onap.portalapp.portal.domain.EPEndpointAccount; import org.onap.portalapp.portal.framework.MockitoTestSuite; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.service.DataAccessService; import org.onap.portalsdk.core.service.DataAccessServiceImpl; import org.onap.portalsdk.core.util.SystemProperties; @@ -51,7 +53,7 @@ import org.powermock.modules.junit4.PowerMockRunner; @RunWith(PowerMockRunner.class) -@PrepareForTest({ CipherUtil.class , SystemProperties.class}) +@PrepareForTest({ CipherUtil.class , SystemProperties.class, KeyProperties.class, KeyConstants.class}) public class BasicAuthAccountServiceImplTest { @Mock DataAccessService dataAccessService = new DataAccessServiceImpl(); @@ -92,11 +94,12 @@ public class BasicAuthAccountServiceImplTest { @Test public void saveBasicAuthAccountTest_password() throws Exception{ PowerMockito.mockStatic(CipherUtil.class); - PowerMockito.mockStatic(SystemProperties.class); + PowerMockito.mockStatic(KeyProperties.class); + PowerMockito.mockStatic(KeyConstants.class); BasicAuthCredentials credentials = new BasicAuthCredentials(); credentials.setPassword("password"); String result = null; - Mockito.when(CipherUtil.encryptPKC("password", SystemProperties.getProperty(SystemProperties.Decryption_Key))).thenReturn(result); + Mockito.when(CipherUtil.encryptPKC("password", KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY))).thenReturn(result); basicAuthAccountServiceImpl.saveBasicAuthAccount(credentials); } @@ -163,7 +166,8 @@ public class BasicAuthAccountServiceImplTest { @Test public void getAccountDataTest_password() throws Exception { PowerMockito.mockStatic(CipherUtil.class); - PowerMockito.mockStatic(SystemProperties.class); + PowerMockito.mockStatic(KeyProperties.class); + PowerMockito.mockStatic(KeyConstants.class); List<BasicAuthCredentials> list = new ArrayList<>(); BasicAuthCredentials basicAuthCredentials = new BasicAuthCredentials(); basicAuthCredentials.setPassword("password"); @@ -171,7 +175,7 @@ public class BasicAuthAccountServiceImplTest { Mockito.when((List<BasicAuthCredentials>) dataAccessService.getList(BasicAuthCredentials.class, null)) .thenReturn(list); String result = null; - Mockito.when(CipherUtil.decryptPKC("password", SystemProperties.getProperty(SystemProperties.Decryption_Key))).thenReturn(result); + Mockito.when(CipherUtil.decryptPKC("password", KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY))).thenReturn(result); } diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPAppCommonServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPAppCommonServiceImplTest.java index 1451693d..d00dc211 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPAppCommonServiceImplTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPAppCommonServiceImplTest.java @@ -74,6 +74,7 @@ import org.onap.portalapp.portal.domain.EPUserAppsManualSortPreference; import org.onap.portalapp.portal.domain.EPUserAppsSortPreference; import org.onap.portalapp.portal.domain.EPWidgetsManualSortPreference; import org.onap.portalapp.portal.domain.EcompApp; +import org.onap.portalapp.portal.domain.EpAppType; import org.onap.portalapp.portal.domain.UserRole; import org.onap.portalapp.portal.domain.UserRoles; import org.onap.portalapp.portal.ecomp.model.AppCatalogItem; @@ -157,24 +158,24 @@ public class EPAppCommonServiceImplTest { EPApp app = new EPApp(); app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(false); - app.setCentralAuth(true); + app.setRolesInAAF(true); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); return app; } @@ -439,7 +440,7 @@ public class EPAppCommonServiceImplTest { public void getRestrictedAppRolesTest() { EPUser user = mockUser.mockEPUser(); EPApp mockApp = mockApp(); - mockApp.setRestrictedApp(true); + mockApp.setAppType(EpAppType.HYPERLINK); user.setLoginId("guestT"); List<LocalRole> expected = new ArrayList<>(); LocalRole localRole = new LocalRole(); @@ -458,7 +459,7 @@ public class EPAppCommonServiceImplTest { public void getPoralAppRolesTest() { EPUser user = mockUser.mockEPUser(); EPApp mockApp = mockApp(); - mockApp.setRestrictedApp(false); + mockApp.setAppType(EpAppType.GUI); mockApp.setId(1l); user.setLoginId("guestT"); List<LocalRole> expected = new ArrayList<>(); @@ -477,7 +478,7 @@ public class EPAppCommonServiceImplTest { public void getNonPortalAndNonRestrictedAppRolesTest() { EPUser user = mockUser.mockEPUser(); EPApp mockApp = mockApp(); - mockApp.setRestrictedApp(false); + mockApp.setAppType(EpAppType.GUI); mockApp.setId(2l); user.setLoginId("guestT"); List<LocalRole> expected = new ArrayList<>(); @@ -539,15 +540,15 @@ public class EPAppCommonServiceImplTest { List<EPApp> mockAppList = new ArrayList<>(); OnboardingApp onboardApp = new OnboardingApp(); onboardApp.setRestrictedApp(false); - onboardApp.name = "test1"; - onboardApp.url = "http://test.com"; - onboardApp.isOpen = false; - onboardApp.isEnabled = true; - onboardApp.username = "test123"; - onboardApp.appPassword = "test123"; + onboardApp.setAppName("test1"); + onboardApp.setLandingPage("http://test.com"); + onboardApp.setIsOpen(false); + onboardApp.setIsEnabled(true); + onboardApp.setAppBasicAuthUsername("test123"); + onboardApp.setAppBasicAuthPassword("test123"); List<Criterion> restrictionsList = new ArrayList<Criterion>(); - Criterion urlCrit = Restrictions.eq("url", onboardApp.url); - Criterion nameCrit = Restrictions.eq("name", onboardApp.name); + Criterion urlCrit = Restrictions.eq("url", onboardApp.getLandingPage()); + Criterion nameCrit = Restrictions.eq("name", onboardApp.getAppName()); Criterion orCrit = Restrictions.or(urlCrit, nameCrit); restrictionsList.add(orCrit); List<String> uebList = new ArrayList<>(); @@ -573,42 +574,46 @@ public class EPAppCommonServiceImplTest { EPApp mockApp = mockApp(); mockApp.setName("test1"); mockApp.setId(2l); - mockApp.setUrl("http://test.com"); - mockApp.setUsername("test123"); - mockApp.setAppPassword("test123"); - mockApp.setRestrictedApp(false); + mockApp.setLandingPage("http://test.com"); + mockApp.setAppBasicAuthUsername("test123"); + mockApp.setAppBasicAuthPassword("*******"); + mockApp.setAppType(EpAppType.GUI); mockApp.setEnabled(true); mockApp.setOpen(false); List<EPApp> mockAppList = new ArrayList<>(); mockAppList.add(mockApp); OnboardingApp onboardApp = new OnboardingApp(); onboardApp.setRestrictedApp(false); - onboardApp.name = "test1"; - onboardApp.id = 2l; - onboardApp.url = "http://test.com"; - onboardApp.restUrl = "http://test.com"; - onboardApp.isOpen = false; - onboardApp.isEnabled = true; - onboardApp.thumbnail = "test123imgthumbnail"; - onboardApp.username = "test123"; - onboardApp.appPassword = "test123"; - onboardApp.isCentralAuth=true; - onboardApp.myLoginsAppName="test123"; - onboardApp.myLoginsAppOwner="test123"; - onboardApp.nameSpace="com.test"; + onboardApp.setAppName("test1"); + onboardApp.setId(2l); + onboardApp.setLandingPage("http://test.com"); + onboardApp.setRestUrl("http://test.com"); + onboardApp.setIsOpen(false); + onboardApp.setIsEnabled (true); + onboardApp.setThumbnail("test123imgthumbnail"); + onboardApp.setAppBasicAuthUsername("test123"); + onboardApp.setAppBasicAuthPassword("*******"); + onboardApp.setRolesInAAF(true); + onboardApp.setMyLoginsAppName("test123"); + onboardApp.setMyLoginsAppOwner("test123"); + onboardApp.setNameSpace("com.test"); + onboardApp.setModeOfIntegration("sdk"); + onboardApp.setAppAck(true); + onboardApp.setUsesCadi(false); + onboardApp.setApplicationType("1"); List<Criterion> restrictionsList1 = new ArrayList<Criterion>(); - Criterion idCrit = Restrictions.eq("id", onboardApp.id); - Criterion urlCrit = Restrictions.eq("url", onboardApp.url); - Criterion nameCrit = Restrictions.eq("name", onboardApp.name); + Criterion idCrit = Restrictions.eq("id", onboardApp.getId()); + Criterion urlCrit = Restrictions.eq("url", onboardApp.getLandingPage()); + Criterion nameCrit = Restrictions.eq("name", onboardApp.getAppName()); Criterion orCrit = Restrictions.or(idCrit, urlCrit, nameCrit); restrictionsList1.add(orCrit); Mockito.when((List<EPApp>) dataAccessService.getList(EPApp.class, null, restrictionsList1, null)) .thenReturn(mockAppList); - Mockito.when((EPApp) session.get(EPApp.class, onboardApp.id)).thenReturn(mockApp); + Mockito.when((EPApp) session.get(EPApp.class, onboardApp.getId())).thenReturn(mockApp); String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn " + "FROM fn_menu_functional m, fn_menu_functional_roles r " + "WHERE m.menu_id = r.menu_id " - + " AND r.app_id = '" + onboardApp.id + "' "; + + " AND r.app_id = '" + onboardApp.getId() + "' "; List<Integer> roles = new ArrayList<>(); roles.add(1); roles.add(2); @@ -1268,8 +1273,8 @@ public class EPAppCommonServiceImplTest { OnboardingApp onboardingApp = new OnboardingApp(); onboardingApp.setRestrictedApp(true); - onboardingApp.isCentralAuth=false; - onboardingApp.isEnabled= true; + onboardingApp.setRolesInAAF(false); + onboardingApp.setIsEnabled(true); FieldsValidator actual = epAppCommonServiceImpl.addOnboardingApp(onboardingApp, epUser); assertEquals(expected.getHttpStatusCode(), actual.getHttpStatusCode()); } diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPLdapServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPLdapServiceImplTest.java index bacd2a9e..3b1c2d2d 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPLdapServiceImplTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPLdapServiceImplTest.java @@ -62,6 +62,7 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.onap.portalapp.portal.domain.EPApp; import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.domain.EpAppType; import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.onap.portalsdk.core.command.support.SearchResult; import org.onap.portalsdk.core.service.support.ServiceLocator; @@ -109,24 +110,24 @@ public class EPLdapServiceImplTest { EPApp app = new EPApp(); app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(false); - app.setCentralAuth(true); + app.setRolesInAAF(true); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); return app; } diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPLoginServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPLoginServiceImplTest.java index efc23ac3..31973416 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPLoginServiceImplTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPLoginServiceImplTest.java @@ -57,6 +57,7 @@ import org.onap.portalapp.command.EPLoginBean; import org.onap.portalapp.portal.core.MockEPUser; import org.onap.portalapp.portal.domain.EPApp; import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.domain.EpAppType; import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.onap.portalapp.portal.utils.EcompPortalUtils; import org.onap.portalapp.util.EPUserUtils; @@ -100,24 +101,24 @@ public class EPLoginServiceImplTest { app.setName("Test"); app.setImageUrl("test"); app.setNameSpace("com.test.app"); - app.setCentralAuth(true); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setRolesInAAF(true); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(true); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); return app; } diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImplTest.java index 0331633c..3b1df407 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImplTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImplTest.java @@ -78,6 +78,7 @@ import org.onap.portalapp.portal.domain.EPAppRoleFunction; import org.onap.portalapp.portal.domain.EPRole; import org.onap.portalapp.portal.domain.EPUser; import org.onap.portalapp.portal.domain.EPUserApp; +import org.onap.portalapp.portal.domain.EpAppType; import org.onap.portalapp.portal.ecomp.model.UploadRoleFunctionExtSystem; import org.onap.portalapp.portal.exceptions.InactiveApplicationException; import org.onap.portalapp.portal.exceptions.InvalidUserException; @@ -177,24 +178,24 @@ public class ExternalAccessRolesServiceImplTest { app.setName("Test"); app.setImageUrl("test"); app.setNameSpace("com.test.app"); - app.setCentralAuth(true); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setRolesInAAF(true); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 10); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(true); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); return app; } @@ -325,23 +326,23 @@ public class ExternalAccessRolesServiceImplTest { EPApp app = new EPApp(); app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(true); app.setEnabled(false); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); return app; } diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/MicroserviceServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/MicroserviceServiceImplTest.java index ae813152..bc8d4548 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/MicroserviceServiceImplTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/MicroserviceServiceImplTest.java @@ -58,6 +58,8 @@ import org.onap.portalapp.portal.domain.MicroserviceData; import org.onap.portalapp.portal.domain.MicroserviceParameter; import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.service.DataAccessService; import org.onap.portalsdk.core.service.DataAccessServiceImpl; import org.onap.portalsdk.core.util.SystemProperties; @@ -66,7 +68,7 @@ import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; @RunWith(PowerMockRunner.class) -@PrepareForTest({Criterion.class, Restrictions.class, CipherUtil.class, EPCommonSystemProperties.class, SystemProperties.class, Restrictions.class}) +@PrepareForTest({Criterion.class, Restrictions.class, CipherUtil.class, EPCommonSystemProperties.class, SystemProperties.class, KeyProperties.class, KeyConstants.class}) public class MicroserviceServiceImplTest { private static final String TEST="test"; @@ -150,6 +152,8 @@ public class MicroserviceServiceImplTest { PowerMockito.mockStatic(CipherUtil.class); PowerMockito.mockStatic(Restrictions.class); PowerMockito.mockStatic(Criterion.class); + PowerMockito.mockStatic(KeyProperties.class); + PowerMockito.mockStatic(KeyConstants.class); List<MicroserviceParameter> microserviceParameters = new ArrayList<>(); MicroserviceData microserviceData = new MicroserviceData(); MicroserviceParameter microserviceParameter = new MicroserviceParameter(); @@ -168,8 +172,7 @@ public class MicroserviceServiceImplTest { Criterion serviceIdCriterion = Restrictions.eq("serviceId", 1l); restrictionsList2.add(serviceIdCriterion); Mockito.when((List<MicroserviceParameter>) dataAccessService.getList(MicroserviceParameter.class, null, restrictionsList2, null)).thenReturn(microserviceParameters); - Mockito.when(CipherUtil.decryptPKC("xyz", - SystemProperties.getProperty(SystemProperties.Decryption_Key))).thenReturn("abc"); + Mockito.when(CipherUtil.decryptPKC("xyz",KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY))).thenReturn("abc"); List<MicroserviceData> actual = microserviceServiceImpl.getMicroserviceData(); assertNotNull(actual); } @@ -181,6 +184,8 @@ public class MicroserviceServiceImplTest { PowerMockito.mockStatic(CipherUtil.class); PowerMockito.mockStatic(Restrictions.class); PowerMockito.mockStatic(Criterion.class); + PowerMockito.mockStatic(KeyProperties.class); + PowerMockito.mockStatic(KeyConstants.class); List<MicroserviceParameter> microserviceParameters = new ArrayList<>(); MicroserviceData microserviceData = new MicroserviceData(); MicroserviceParameter microserviceParameter = new MicroserviceParameter(); @@ -199,8 +204,7 @@ public class MicroserviceServiceImplTest { Criterion serviceIdCriterion = Restrictions.eq("serviceId", 1l); restrictionsList2.add(serviceIdCriterion); Mockito.when((List<MicroserviceParameter>) dataAccessService.getList(MicroserviceParameter.class, null, restrictionsList2, null)).thenReturn(microserviceParameters); - Mockito.when(CipherUtil.decryptPKC("xyz", - SystemProperties.getProperty(SystemProperties.Decryption_Key))).thenThrow(BadPaddingException.class); + Mockito.when(CipherUtil.decryptPKC("xyz",KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY))).thenThrow(BadPaddingException.class); List<MicroserviceData> actual = microserviceServiceImpl.getMicroserviceData(); assertNotNull(actual); } @@ -220,10 +224,10 @@ public class MicroserviceServiceImplTest { PowerMockito.mockStatic(CipherUtil.class); Criterion serviceIdCriterion = Restrictions.eq("serviceId", 1l); restrictionsList.add(serviceIdCriterion); - PowerMockito.mockStatic(SystemProperties.class); - Mockito.when(SystemProperties.getProperty(SystemProperties.Decryption_Key)).thenReturn(TEST); + PowerMockito.mockStatic(KeyProperties.class); + PowerMockito.mockStatic(KeyConstants.class); + Mockito.when(KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)).thenReturn(TEST); Mockito.when(CipherUtil.encryptPKC(TEST, TEST)).thenReturn(TEST); - Mockito.when((List<MicroserviceParameter>) dataAccessService.getList(MicroserviceParameter.class, null, restrictionsList, null)).thenReturn(microserviceParameters); microserviceServiceImpl.updateMicroservice(1l, buildData()); diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/PersUserAppServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/PersUserAppServiceImplTest.java index e763d6f8..904c7b82 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/PersUserAppServiceImplTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/PersUserAppServiceImplTest.java @@ -53,6 +53,7 @@ import org.onap.portalapp.portal.core.MockEPUser; import org.onap.portalapp.portal.domain.EPApp; import org.onap.portalapp.portal.domain.EPUser; import org.onap.portalapp.portal.domain.EPUserApp; +import org.onap.portalapp.portal.domain.EpAppType; import org.onap.portalapp.portal.domain.PersUserAppSelection; import org.onap.portalapp.portal.framework.MockitoTestSuite; import org.onap.portalapp.portal.service.AdminRolesService; @@ -88,23 +89,23 @@ public class PersUserAppServiceImplTest { EPApp app = new EPApp(); app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(true); app.setEnabled(false); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); return app; } diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/PortalAdminServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/PortalAdminServiceImplTest.java index eeaf29da..a89f87f5 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/PortalAdminServiceImplTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/PortalAdminServiceImplTest.java @@ -64,6 +64,7 @@ import org.mockito.MockitoAnnotations; import org.onap.portalapp.portal.core.MockEPUser; import org.onap.portalapp.portal.domain.EPApp; import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.domain.EpAppType; import org.onap.portalapp.portal.transport.FieldsValidator; import org.onap.portalapp.portal.transport.PortalAdmin; import org.onap.portalapp.portal.utils.EPCommonSystemProperties; @@ -127,24 +128,24 @@ public class PortalAdminServiceImplTest { app.setName("Test"); app.setImageUrl("test"); app.setNameSpace("com.test.app"); - app.setCentralAuth(true); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setRolesInAAF(true); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(true); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); return app; } diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImplTest.java index 736f8341..5846fa9f 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImplTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImplTest.java @@ -81,6 +81,7 @@ import org.onap.portalapp.portal.domain.EPUserAppCatalogRoles; import org.onap.portalapp.portal.domain.EPUserAppRoles; import org.onap.portalapp.portal.domain.EPUserAppRolesRequest; import org.onap.portalapp.portal.domain.EPUserAppRolesRequestDetail; +import org.onap.portalapp.portal.domain.EpAppType; import org.onap.portalapp.portal.domain.ExternalSystemAccess; import org.onap.portalapp.portal.transport.*; import org.onap.portalapp.portal.utils.EPCommonSystemProperties; @@ -168,24 +169,24 @@ public class UserRolesCommonServiceImplTest { EPApp app = new EPApp(); app.setName("Test"); app.setImageUrl("test"); - app.setDescription("test"); - app.setNotes("test"); - app.setUrl("test"); + app.setAppDescription("test"); + app.setAppNotes("test"); + app.setLandingPage("test"); app.setId((long) 1); app.setAppRestEndpoint("test"); - app.setAlternateUrl("test"); + app.setAlternateLandingPage("test"); app.setName("test"); app.setMlAppName("test"); app.setMlAppAdminId("test"); - app.setUsername("test"); - app.setAppPassword("test"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("test"); app.setOpen(false); app.setEnabled(false); - app.setCentralAuth(true); + app.setRolesInAAF(true); app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.setAppType(1); + app.setAppType(EpAppType.GUI); return app; } @@ -261,7 +262,7 @@ public class UserRolesCommonServiceImplTest { EPUser user = mockUser.mockEPUser(); user.setId(1l); EPApp mockApp = mockApp(); - mockApp.setCentralAuth(false); + mockApp.setRolesInAAF(false); EPRole mockEPRole = new EPRole(); mockEPRole.setId(1l); mockEPRole.setName("test1"); @@ -356,7 +357,7 @@ public class UserRolesCommonServiceImplTest { mockEpUserList.add(user); EPApp mockApp = mockApp(); mockApp.setId(2l); - mockApp.setCentralAuth(false); + mockApp.setRolesInAAF(false); Mockito.when(epAppCommonServiceImpl.getApp(mockApp.getId())).thenReturn(mockApp); List<RoleInAppForUser> mockRoleInAppForUserList = new ArrayList<>(); RoleInAppForUser mockRoleInAppForUser = new RoleInAppForUser(); @@ -524,7 +525,7 @@ public class UserRolesCommonServiceImplTest { EPApp mockApp = mockApp(); mockApp.setNameSpace("com.test.com"); mockApp.setId(1l); - mockApp.setCentralAuth(true); + mockApp.setRolesInAAF(true); Mockito.when(epAppCommonServiceImpl.getApp(mockApp.getId())).thenReturn(mockApp); Mockito.when(EcompPortalUtils.checkIfRemoteCentralAccessAllowed()).thenReturn(true); AppWithRolesForUser mockWithRolesForUser = new AppWithRolesForUser(); @@ -698,7 +699,7 @@ public class UserRolesCommonServiceImplTest { EPApp mockApp = mockApp(); mockApp.setNameSpace("com.test.com"); mockApp.setId(2l); - mockApp.setCentralAuth(false); + mockApp.setRolesInAAF(false); Mockito.when(epAppCommonServiceImpl.getApp(mockApp.getId())).thenReturn(mockApp); Mockito.when(EcompPortalUtils.checkIfRemoteCentralAccessAllowed()).thenReturn(true); AppWithRolesForUser mockWithRolesForUser = new AppWithRolesForUser(); @@ -831,7 +832,7 @@ public class UserRolesCommonServiceImplTest { EPApp mockApp = mockApp(); mockApp.setNameSpace("com.test.com"); mockApp.setId(1l); - mockApp.setCentralAuth(true); + mockApp.setRolesInAAF(true); Mockito.when(EcompPortalUtils.checkIfRemoteCentralAccessAllowed()).thenReturn(true); ExternalSystemUser externalSystemUser = new ExternalSystemUser(); List<ExternalSystemRoleApproval> mockExternalSystemRoleApprovalList = new ArrayList<>(); @@ -999,7 +1000,7 @@ public class UserRolesCommonServiceImplTest { EPApp mockApp = mockApp(); mockApp.setId(2l); mockApp.setEnabled(true); - mockApp.setCentralAuth(false); + mockApp.setRolesInAAF(false); ExternalSystemUser externalSystemUser = new ExternalSystemUser(); List<ExternalSystemRoleApproval> mockExternalSystemRoleApprovalList = new ArrayList<>(); ExternalSystemRoleApproval mockExternalSystemRoleApproval = new ExternalSystemRoleApproval(); @@ -1187,7 +1188,7 @@ public class UserRolesCommonServiceImplTest { EPApp mockApp = mockApp(); mockApp.setId(1l); mockApp.setEnabled(true); - mockApp.setCentralAuth(true); + mockApp.setRolesInAAF(true); EPUser user = mockUser.mockEPUser(); EPUser user2 = mockUser.mockEPUser(); user2.setActive(true); @@ -1263,7 +1264,7 @@ public class UserRolesCommonServiceImplTest { EPApp mockApp = mockApp(); mockApp.setId(2l); mockApp.setEnabled(true); - mockApp.setCentralAuth(false); + mockApp.setRolesInAAF(false); Mockito.when(epAppCommonServiceImpl.getApp(mockApp.getId())).thenReturn(mockApp); List<UserApplicationRoles> mockUserApplicationRolesNonCentralizedList = new ArrayList<>(); UserApplicationRoles mockUserApplicationRoles = new UserApplicationRoles(); @@ -1318,7 +1319,7 @@ public class UserRolesCommonServiceImplTest { EPApp mockApp = mockApp(); mockApp.setId(2l); mockApp.setEnabled(true); - mockApp.setCentralAuth(false); + mockApp.setRolesInAAF(false); EPUser user = mockUser.mockEPUser(); AppWithRolesForUser appWithRolesForUser = new AppWithRolesForUser(); List<RoleInAppForUser> mockRoleInAppForUserList = new ArrayList<>(); @@ -1371,7 +1372,7 @@ public class UserRolesCommonServiceImplTest { EPApp mockApp = mockApp(); mockApp.setId(2l); mockApp.setEnabled(true); - mockApp.setCentralAuth(false); + mockApp.setRolesInAAF(false); List<EPRole> expected = new ArrayList<>(); EPRole epRole = new EPRole(); epRole.setAppId(mockApp.getId()); @@ -1400,7 +1401,7 @@ public class UserRolesCommonServiceImplTest { EPApp mockApp = mockApp(); mockApp.setId(2l); mockApp.setEnabled(true); - mockApp.setCentralAuth(false); + mockApp.setRolesInAAF(false); EPUser user = mockUser.mockEPUser(); List<EPUserApp> expected = new ArrayList<>(); EPUserApp epUserApp = new EPUserApp(); @@ -1426,7 +1427,7 @@ public class UserRolesCommonServiceImplTest { EPApp mockApp = mockApp(); mockApp.setId(2l); mockApp.setEnabled(true); - mockApp.setCentralAuth(false); + mockApp.setRolesInAAF(false); EPUser user = mockUser.mockEPUser(); List<EPUserAppCatalogRoles> expected = new ArrayList<>(); EPUserAppCatalogRoles epUserAppCatalogRoles = new EPUserAppCatalogRoles(); @@ -1458,7 +1459,7 @@ public class UserRolesCommonServiceImplTest { EPApp mockApp = mockApp(); mockApp.setId(2l); mockApp.setEnabled(true); - mockApp.setCentralAuth(false); + mockApp.setRolesInAAF(false); EPUser user = mockUser.mockEPUser(); List<EPUserApp> expected = new ArrayList<>(); EPUserApp epUserApp = new EPUserApp(); @@ -1488,7 +1489,7 @@ public class UserRolesCommonServiceImplTest { EPApp mockApp2 = mockApp(); mockApp.setId(2l); mockApp.setEnabled(true); - mockApp.setCentralAuth(false); + mockApp.setRolesInAAF(false); EPUser user = mockUser.mockEPUser(); List<EPApp> mockEpAppList = new ArrayList<>(); mockEpAppList.add(mockApp); diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/service/sessionmgt/SessionCommunicationTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/service/sessionmgt/SessionCommunicationTest.java index 708f446a..5cb61b26 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/service/sessionmgt/SessionCommunicationTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/service/sessionmgt/SessionCommunicationTest.java @@ -82,13 +82,13 @@ public class SessionCommunicationTest { app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.isCentralAuth = true; - app.isEnabled = true; - app.isOpen =false; - app.name = "test"; - app.restUrl ="http://localhost:1234"; - app.username = "test"; - app.appPassword = "xyz"; + app.setRolesInAAF(true); + app.setIsEnabled(true); + app.setIsOpen(false); + app.setAppName("test"); + app.setRestUrl("http://localhost:1234"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("xyz"); URL u = PowerMockito.mock(URL.class); HttpURLConnection huc = PowerMockito.mock(HttpURLConnection.class); String url = "http://localhost:1234/sessionTimeOuts"; @@ -106,16 +106,16 @@ public class SessionCommunicationTest { app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.isCentralAuth = true; - app.isEnabled = true; - app.isOpen =false; - app.name = "test"; - app.restUrl ="http://localhost:1234"; - app.username = "test"; - app.appPassword = ""; + app.setRolesInAAF(true); + app.setIsEnabled(true); + app.setIsOpen(false); + app.setAppName("test"); + app.setRestUrl("http://localhost:1234"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword(""); EPApp epApp = new EPApp(); - epApp.setUsername("test"); - epApp.setAppPassword("xyz1234"); + epApp.setAppBasicAuthUsername("test"); + epApp.setAppBasicAuthPassword("xyz1234"); PowerMockito.mockStatic(CipherUtil.class); PowerMockito.when(CipherUtil.decryptPKC(Matchers.anyString(),Matchers.anyString())).thenReturn("test"); Mockito.when(appsCacheService.getApp(1L)).thenReturn(epApp); @@ -136,13 +136,13 @@ public class SessionCommunicationTest { app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.isCentralAuth = true; - app.isEnabled = true; - app.isOpen =false; - app.name = "test"; - app.restUrl ="http://localhost:1234"; - app.username = "test"; - app.appPassword = "xyz"; + app.setRolesInAAF(true); + app.setIsEnabled(true); + app.setIsOpen(false); + app.setAppName("test"); + app.setRestUrl("http://localhost:1234"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("xyz"); URL u = PowerMockito.mock(URL.class); HttpURLConnection huc = PowerMockito.mock(HttpURLConnection.class); String url = "http://localhost:1234/sessionTimeOuts"; @@ -161,13 +161,13 @@ public class SessionCommunicationTest { app.setUebKey("test"); app.setUebSecret("test"); app.setUebTopicName("test"); - app.isCentralAuth = true; - app.isEnabled = true; - app.isOpen =false; - app.name = "test"; - app.restUrl ="http://localhost:1234"; - app.username = "test"; - app.appPassword = "xyz"; + app.setRolesInAAF(true); + app.setIsEnabled(true); + app.setIsOpen(false); + app.setAppName("test"); + app.setRestUrl("http://localhost:1234"); + app.setAppBasicAuthUsername("test"); + app.setAppBasicAuthPassword("xyz"); URL u = PowerMockito.mock(URL.class); HttpURLConnection huc = PowerMockito.mock(HttpURLConnection.class); String url = "http://localhost:1234/sessionTimeOuts"; diff --git a/ecomp-portal-BE-os/pom.xml b/ecomp-portal-BE-os/pom.xml index 4ad50dfd..4bc54036 100644 --- a/ecomp-portal-BE-os/pom.xml +++ b/ecomp-portal-BE-os/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.portal</groupId> <artifactId>onap-portal-parent</artifactId> - <version>3.3.0</version> + <version>3.4.0</version> </parent> <artifactId>portal-be-os</artifactId> @@ -251,21 +251,7 @@ <artifactId>spring-test</artifactId> <version>${springframework.version}</version> </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter</artifactId> - <version>1.3.0.RELEASE</version> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>log4j-over-slf4j</artifactId> - </exclusion> - <exclusion> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - </exclusion> - </exclusions> - </dependency> + <!-- Hibernate --> <dependency> <groupId>org.hibernate</groupId> @@ -314,27 +300,8 @@ <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> - <artifactId>jackson-annotations</artifactId> - <version>2.8.10</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-core</artifactId> - <version>2.8.10</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - <version>2.8.10</version> - </dependency> + <dependency> <groupId>com.fasterxml</groupId> <artifactId>classmate</artifactId> @@ -629,11 +596,6 @@ <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> diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ECOMPLogoutController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ECOMPLogoutController.java index 54fcf3af..eaf3a133 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ECOMPLogoutController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ECOMPLogoutController.java @@ -52,7 +52,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.servlet.ModelAndView; @@ -69,7 +69,7 @@ public class ECOMPLogoutController extends EPUnRestrictedBaseController { EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ECOMPLogoutController.class); @EPAuditLog - @RequestMapping(value = { "/logout.htm" }, method = RequestMethod.GET) + @GetMapping(value = { "/logout.htm" }) public ModelAndView logOut(HttpServletRequest request, HttpServletResponse response) throws Exception { diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginController.java index 3b0281fb..f88a2547 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginController.java @@ -5,7 +5,7 @@ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * - * Unless otherwise specified, all software contained herein is licensed + * 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 @@ -16,7 +16,7 @@ * 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. + * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); @@ -74,6 +74,8 @@ import org.springframework.stereotype.Controller; import org.springframework.util.StopWatch; import org.springframework.web.bind.annotation.ExceptionHandler; 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.ResponseBody; import org.springframework.web.servlet.ModelAndView; @@ -106,7 +108,7 @@ public class LoginController extends EPUnRestrictedBaseController implements Log private String welcomeView; - @RequestMapping(value = { "/login.htm" }, method = RequestMethod.GET) + @GetMapping(value = { "/login.htm" }) public ModelAndView login(HttpServletRequest request) { Map<String, Object> model = new HashMap<String, Object>(); String authentication = SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM); @@ -119,7 +121,7 @@ public class LoginController extends EPUnRestrictedBaseController implements Log } @SuppressWarnings("rawtypes") - @RequestMapping(value = { "/open_source/login" }, method = RequestMethod.POST) + @PostMapping(value = { "/open_source/login" }) @ResponseBody public String loginValidate(HttpServletRequest request, HttpServletResponse response) throws Exception { @@ -194,7 +196,7 @@ public class LoginController extends EPUnRestrictedBaseController implements Log * repaired. */ - @RequestMapping(value = { "/processSingleSignOn" }, method = RequestMethod.GET) + @GetMapping(value = { "/processSingleSignOn" }) public ModelAndView processSingleSignOn(HttpServletRequest request, HttpServletResponse response) throws Exception { Map<Object, Object> model = new HashMap<Object, Object>(); diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java index 98cd790f..9ac20907 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java @@ -50,6 +50,7 @@ import org.onap.portalsdk.core.web.support.AppUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; 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.servlet.ModelAndView; @@ -70,7 +71,7 @@ public class ONAPLoginController extends UnRestrictedBaseController { this.loginStrategy = loginStrategy; } - @RequestMapping(value = { "/doLogin" }, method = RequestMethod.GET) + @GetMapping(value = { "/doLogin" }) public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception { return loginStrategy.doLogin(request, response); } diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java index 08b0da9b..615dff06 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java @@ -53,6 +53,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; 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.servlet.ModelAndView; @@ -63,12 +64,12 @@ import org.springframework.web.servlet.ModelAndView; @EPAuditLog @NoArgsConstructor public class ONAPWelcomeController extends EPRestrictedBaseController{ - @RequestMapping(value = "/index.htm", method = RequestMethod.GET) + @GetMapping(value = "/index.htm") public String getIndexPage(HttpServletRequest request) { return "/index"; } - @RequestMapping(value = {"/app/*","/applicationsHome", "/dashboard", "/widgetsHome", "/kpidash*", "/admins", "/users", "/portalAdmins", "/applications", "/widgets", "/functionalMenu", "/contactUs", "/getAccess","/appCatalog", "/widgetOnboarding", "/accountOnboarding"}, method = RequestMethod.GET) + @GetMapping(value = {"/app/*","/applicationsHome", "/dashboard", "/widgetsHome", "/kpidash*", "/admins", "/users", "/portalAdmins", "/applications", "/widgets", "/functionalMenu", "/contactUs", "/getAccess","/appCatalog", "/widgetOnboarding", "/accountOnboarding"}) public String getEcompSinglePage(HttpServletRequest request, HttpServletResponse response) { return "forward:/index.html"; } diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/AppsOSController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/AppsOSController.java index 66237523..a64b0299 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/AppsOSController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/AppsOSController.java @@ -56,6 +56,8 @@ 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.RequestMethod; import org.springframework.web.bind.annotation.RestController; import lombok.NoArgsConstructor; @@ -80,7 +82,7 @@ public class AppsOSController extends AppsController { * @param contactUs * @return */ - @RequestMapping(value = "/portalApi/saveNewUser", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/portalApi/saveNewUser", produces = "application/json") public PortalRestResponse<String> saveNewUser(HttpServletRequest request, @RequestBody EPUser newUser) { EPUser user = EPUserUtils.getUserSession(request); if (newUser == null) @@ -107,7 +109,7 @@ public class AppsOSController extends AppsController { return new PortalRestResponse<>(PortalRestStatusEnum.OK, saveNewUser, ""); } - @RequestMapping(value = { "/portalApi/currentUserProfile/{loginId}" }, method = RequestMethod.GET, + @GetMapping(value = { "/portalApi/currentUserProfile/{loginId}" }, produces = "application/json") public String getCurrentUserProfile(HttpServletRequest request, @PathVariable("loginId") String loginId) { diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java index 1dff6040..c396de9b 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java @@ -63,6 +63,9 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; 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.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -85,7 +88,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * Request parameter. * @return Rest response wrapped around a CommonWidgetMeta object. */ - @RequestMapping(value = "/widgetData", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/widgetData", produces = "application/json") public PortalRestResponse<CommonWidgetMeta> getWidgetData(HttpServletRequest request, @RequestParam String resourceType) { if (resourceType !=null){ @@ -104,7 +107,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * read from POST body. * @return Rest response wrapped around a String; e.g., "success" or "ERROR" */ - @RequestMapping(value = "/widgetDataBulk", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/widgetDataBulk", produces = "application/json") public PortalRestResponse<String> saveWidgetDataBulk(@RequestBody CommonWidgetMeta commonWidgetMeta) { logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetDataBulk: argument is {}", commonWidgetMeta); if (commonWidgetMeta.getCategory() == null || commonWidgetMeta.getCategory().trim().equals("")){ @@ -132,7 +135,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * read from POST body * @return Rest response wrapped around a String; e.g., "success" or "ERROR" */ - @RequestMapping(value = "/widgetData", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/widgetData", produces = "application/json") public PortalRestResponse<String> saveWidgetData(@RequestBody CommonWidget commonWidget) { logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetData: argument is {}", commonWidget); if (commonWidget.getCategory() == null || commonWidget.getCategory().trim().equals("")){ @@ -179,7 +182,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * read from POST body * @return Rest response wrapped around a String; e.g., "success" or "ERROR" */ - @RequestMapping(value = "/deleteData", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/deleteData", produces = "application/json") public PortalRestResponse<String> deleteWidgetData(@RequestBody CommonWidget commonWidget) { logger.debug(EELFLoggerDelegate.debugLogger, "deleteWidgetData: argument is {}", commonWidget); if(!dataValidator.isValid(commonWidget)) @@ -197,7 +200,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * @return Rest response wrapped around a Map of String to List of Search * Result Item. */ - @RequestMapping(value = "/allPortal", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/allPortal", produces = "application/json") public PortalRestResponse<Map<String, List<SearchResultItem>>> searchPortal(HttpServletRequest request, @RequestParam String searchString) { if(searchString!=null){ @@ -240,7 +243,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * @param request * @return Rest response wrapped around a list of String */ - @RequestMapping(value = "/activeUsers", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/activeUsers", produces = "application/json") public List<String> getActiveUsers(HttpServletRequest request) { List<String> activeUsers = null; List<String> onlineUsers = new ArrayList<>(); @@ -268,7 +271,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * @param request * @return Rest response wrapped around a List of String */ - @RequestMapping(value = "/relatedUsers", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/relatedUsers", produces = "application/json") public PortalRestResponse<List<String>> activeUsers(HttpServletRequest request) { EPUser user = EPUserUtils.getUserSession(request); try { diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java index 028ae68a..9a2d3389 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java @@ -9,7 +9,7 @@ * 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 @@ -44,7 +44,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.onap.portalapp.controller.EPRestrictedRESTfulBaseController; -import org.onap.portalapp.portal.controller.ExternalAppsRestfulController; import org.onap.portalapp.portal.domain.EPUser; import org.onap.portalapp.portal.logging.aop.EPAuditLog; import org.onap.portalapp.portal.service.AdminRolesService; @@ -63,7 +62,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController @@ -84,7 +83,7 @@ public class ExternalAppsRestfulController extends EPRestrictedRESTfulBaseContro @Autowired AdminRolesService adminRolesService; - @RequestMapping(value={"/getFavorites"}, method = RequestMethod.GET,produces = "application/json") + @GetMapping(value={"/getFavorites"}, produces = "application/json") public List<FavoritesFunctionalMenuItemJson> getFavoritesForUser(HttpServletRequest request, HttpServletResponse response) throws Exception { String loginId = ""; String userAgent = ""; @@ -109,7 +108,7 @@ public class ExternalAppsRestfulController extends EPRestrictedRESTfulBaseContro return favorites; } - @RequestMapping(value={"/functionalMenuItemsForUser"}, method = RequestMethod.GET,produces = "application/json") + @GetMapping(value={"/functionalMenuItemsForUser"}, produces = "application/json") public List<FunctionalMenuItem> getFunctionalMenuItemsForUser(HttpServletRequest request, HttpServletResponse response) throws Exception { String loginId = ""; String userAgent = ""; diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/logging/aop/EPEELFLoggerAspect.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/logging/aop/EPEELFLoggerAspect.java index 05ad61af..000e48ef 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/logging/aop/EPEELFLoggerAspect.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/logging/aop/EPEELFLoggerAspect.java @@ -41,9 +41,6 @@ import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; -import org.onap.portalapp.portal.logging.aop.EPAuditLog; -import org.onap.portalapp.portal.logging.aop.EPEELFLoggerAdvice; -import org.onap.portalapp.portal.logging.aop.EPMetricsLog; import org.onap.portalapp.portal.transport.FieldsValidator; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum; diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java index 0e9932e0..479564f5 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java @@ -113,7 +113,7 @@ public class SearchServiceImpl implements SearchService { resultOfSearch.addAll(resultOfAdditionalSearch); } resultOfSearch.addAll(resultOfSearchUserId); - resultOfSearch.stream().distinct().collect(Collectors.toList()); + resultOfSearch = resultOfSearch.stream().distinct().collect(Collectors.toList()); resultOfSearch = this.cutSearchResultToMaximumSize(resultOfSearch); ObjectMapper mapper = new ObjectMapper(); String result = "[]"; diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/TicketEventServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/TicketEventServiceImpl.java index 71c2b1ea..e92b7120 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/TicketEventServiceImpl.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/TicketEventServiceImpl.java @@ -39,7 +39,6 @@ */ package org.onap.portalapp.portal.service; -import org.onap.portalapp.portal.service.TicketEventService; import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.stereotype.Service; diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/utils/EPSystemProperties.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/utils/EPSystemProperties.java index 1e0f5836..45b3a2c9 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/utils/EPSystemProperties.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/utils/EPSystemProperties.java @@ -10,7 +10,7 @@ * 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, @@ -37,7 +37,6 @@ */ package org.onap.portalapp.portal.utils; -import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.context.annotation.PropertySources; diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallServiceImpl.java index a24a6b4c..c0f944e9 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallServiceImpl.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallServiceImpl.java @@ -38,13 +38,12 @@ package org.onap.portalapp.service; import java.util.List; - import org.onap.portalapp.portal.domain.EPApp; -import org.onap.portalapp.service.RemoteWebServiceCallService; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.service.WebServiceCallServiceImpl; -import org.onap.portalsdk.core.util.SystemProperties; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -68,11 +67,10 @@ public class RemoteWebServiceCallServiceImpl extends WebServiceCallServiceImpl i logger.warn(EELFLoggerDelegate.errorLogger, "Failed to find application with UEB key " + requestUebKey); return false; } - - String encryptedPwdDB = appRecord.getAppPassword(); - String appUserName = appRecord.getUsername(); - String decryptedPwd = CipherUtil.decryptPKC(encryptedPwdDB, - secretKey == null ? SystemProperties.getProperty(SystemProperties.Decryption_Key) : secretKey); + + String encryptedPwdDB = appRecord.getAppBasicAuthPassword(); + String appUserName = appRecord.getAppBasicAuthUsername(); + String decryptedPwd = CipherUtil.decryptPKC(encryptedPwdDB,secretKey == null ? KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY) : secretKey); if (decryptedPwd.equals(requestPassword) && appUserName.equals(requestAppName)) return true; else diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/util/SessionCookieUtil.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/util/SessionCookieUtil.java index 1a347e07..05765021 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/util/SessionCookieUtil.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/util/SessionCookieUtil.java @@ -43,7 +43,8 @@ import javax.servlet.http.HttpServletResponse; import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.onap.portalsdk.core.onboarding.util.CipherUtil; -import org.onap.portalsdk.core.util.SystemProperties; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; public class SessionCookieUtil extends CommonSessionCookieUtil{ @@ -72,7 +73,7 @@ public class SessionCookieUtil extends CommonSessionCookieUtil{ HttpServletResponse response,String userId) throws Exception { logger.info("************** session cookie util set up UserId cookie begins"); userId = CipherUtil.encrypt(userId, - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); Cookie cookie1 = new Cookie(USER_ID, userId); cookie1.setSecure(true); cookie1.setMaxAge(cookieMaxAge); @@ -93,7 +94,7 @@ public class SessionCookieUtil extends CommonSessionCookieUtil{ userIdcookie = cookie; if(userIdcookie!=null){ userId = CipherUtil.decrypt(userIdcookie.getValue(), - SystemProperties.getProperty(SystemProperties.Decryption_Key)); + KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)); } logger.info("************** session cookie util set up EP cookie completed"); diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/system.properties b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/system.properties index 041458d3..a3aa565f 100644 --- a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/system.properties +++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/system.properties @@ -40,7 +40,7 @@ db.driver = org.mariadb.jdbc.Driver #db.connectionURL = jdbc:mariadb:failover://localhost:3306/ecomp_portal #db.userName = XXXX #db.password = XXXX -db.connectionURL = jdbc:mariadb:failover://localhost:3306/portal_2_6_os +db.connectionURL = jdbc:mariadb:failover://localhost:3306/portal_3_2_os db.userName = root db.password = root # is the db.password property encrypted? @@ -145,13 +145,13 @@ window_width_threshold_right_menu = 1350 external_system_notification_url= https://jira.onap.org/browse/ # External Access System Basic Auth Credentials & Rest endpoint(These credentials doesn't work as these are place holders for now) -ext_central_access_user_name = m00468@portal.onap.org -ext_central_access_password = dR2NABMkxPaFbIbym87ZwQ== -ext_central_access_url = https://aaftest.test.onap.org:8095/proxy/authz/ +ext_central_access_user_name = aaf_admin@people.osaaf.org +ext_central_access_password = CkmGguWw+Yn0yzqximmSExkOSJ7BdKvOTHFmTMg9Yvc= +ext_central_access_url = https://aaf-service:31110/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 diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java index 88ccf5d1..1f346459 100644 --- a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java @@ -57,6 +57,8 @@ import org.onap.portalapp.portal.domain.EPApp; import org.onap.portalapp.portal.framework.MockitoTestSuite; import org.onap.portalapp.service.RemoteWebServiceCallServiceImpl; import org.onap.portalsdk.core.onboarding.util.CipherUtil; +import org.onap.portalsdk.core.onboarding.util.KeyConstants; +import org.onap.portalsdk.core.onboarding.util.KeyProperties; import org.onap.portalsdk.core.service.DataAccessService; import org.onap.portalsdk.core.util.SystemProperties; import org.powermock.api.mockito.PowerMockito; @@ -64,7 +66,7 @@ import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; @RunWith(PowerMockRunner.class) -@PrepareForTest({ CipherUtil.class , SystemProperties.class}) +@PrepareForTest({ CipherUtil.class , SystemProperties.class, KeyProperties.class, KeyConstants.class}) public class RemoteWebServiceCallServiceImplTest { @@ -93,17 +95,17 @@ public class RemoteWebServiceCallServiceImplTest { public void verifyRESTCredentialTest() throws Exception { PowerMockito.mockStatic(CipherUtil.class); - PowerMockito.mockStatic(SystemProperties.class); + PowerMockito.mockStatic(KeyProperties.class); + PowerMockito.mockStatic(KeyConstants.class); String criteria= " where ueb_key = 'requestUebKey'"; List<EPApp> appList = new ArrayList<>(); EPApp app = new EPApp(); - app.setAppPassword("password"); + app.setAppBasicAuthPassword("password"); appList.add(app); Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(appList); String secretKey = null; - Mockito.when(SystemProperties.getProperty(SystemProperties.Decryption_Key)).thenReturn(secretKey); - Mockito.when(CipherUtil.decryptPKC("password", - secretKey == null ? null : secretKey)).thenReturn("pwd"); + Mockito.when(KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)).thenReturn(secretKey); + Mockito.when(CipherUtil.decryptPKC("password",secretKey == null ? null : secretKey)).thenReturn("pwd"); assertFalse(remoteWebServiceCallServiceImpl.verifyRESTCredential(secretKey,"requestUebKey","requestAppName","requestPassword")); } @@ -111,18 +113,18 @@ public class RemoteWebServiceCallServiceImplTest { public void verifyRESTCredentialExceptionTest() throws Exception { PowerMockito.mockStatic(CipherUtil.class); - PowerMockito.mockStatic(SystemProperties.class); + PowerMockito.mockStatic(KeyProperties.class); + PowerMockito.mockStatic(KeyConstants.class); String criteria= " where ueb_key = 'requestUebKey'"; List<EPApp> appList = new ArrayList<>(); EPApp app = new EPApp(); - app.setAppPassword("password"); - app.setUsername("requestAppName"); + app.setAppBasicAuthPassword("password"); + app.setAppBasicAuthUsername("requestAppName"); appList.add(app); Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(appList); String secretKey = null; - Mockito.when(SystemProperties.getProperty(SystemProperties.Decryption_Key)).thenReturn(secretKey); - Mockito.when(CipherUtil.decryptPKC("password", - secretKey == null ? null : secretKey)).thenReturn("pwd"); + Mockito.when(KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)).thenReturn(secretKey); + Mockito.when(CipherUtil.decryptPKC("password",secretKey == null ? null : secretKey)).thenReturn("pwd"); assertTrue(remoteWebServiceCallServiceImpl.verifyRESTCredential(secretKey,"requestUebKey","requestAppName","pwd")); } @@ -131,17 +133,18 @@ public class RemoteWebServiceCallServiceImplTest { { PowerMockito.mockStatic(CipherUtil.class); PowerMockito.mockStatic(SystemProperties.class); + PowerMockito.mockStatic(KeyProperties.class); + PowerMockito.mockStatic(KeyConstants.class); String criteria= " where ueb_key = 'requestUebKey'"; List<EPApp> appList = new ArrayList<>(); EPApp app = new EPApp(); - app.setAppPassword("password"); - app.setUsername("requestAppName"); + app.setAppBasicAuthPassword("password"); + app.setAppBasicAuthUsername("requestAppName"); appList.add(app); Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(null); String secretKey = null; - Mockito.when(SystemProperties.getProperty(SystemProperties.Decryption_Key)).thenReturn(secretKey); - Mockito.when(CipherUtil.decryptPKC("password", - secretKey == null ? null : secretKey)).thenReturn("pwd"); + Mockito.when(KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)).thenReturn(secretKey); + Mockito.when(CipherUtil.decryptPKC("password",secretKey == null ? null : secretKey)).thenReturn("pwd"); assertFalse(remoteWebServiceCallServiceImpl.verifyRESTCredential(secretKey,"requestUebKey","requestAppName","pwd")); } @@ -160,8 +163,8 @@ public class RemoteWebServiceCallServiceImplTest { // String criteria= " where ueb_key = 'requestUebKey'"; List<EPApp> appList = new ArrayList<>(); EPApp app = new EPApp(); - app.setAppPassword("password"); - app.setUsername("requestAppName"); + app.setAppBasicAuthPassword("password"); + app.setAppBasicAuthUsername("requestAppName"); appList.add(app); Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(null); assertFalse(remoteWebServiceCallServiceImpl.verifyAppKeyCredential("test")); @@ -175,8 +178,8 @@ public class RemoteWebServiceCallServiceImplTest { String criteria= " where ueb_key = 'test'"; List<EPApp> appList = new ArrayList<>(); EPApp app = new EPApp(); - app.setAppPassword("password"); - app.setUsername("requestAppName"); + app.setAppBasicAuthPassword("password"); + app.setAppBasicAuthUsername("requestAppName"); appList.add(app); Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(appList); assertTrue(remoteWebServiceCallServiceImpl.verifyAppKeyCredential("test")); diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/scheduler/SessionMgtRegistryTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/scheduler/SessionMgtRegistryTest.java new file mode 100644 index 00000000..dcd5881b --- /dev/null +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/scheduler/SessionMgtRegistryTest.java @@ -0,0 +1,60 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : Portal + * ================================================================================ + * Copyright (C) 2020 IBM Intellectual Property. All rights reserved. + *================================================================================= + * 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 + * + * 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. + * ============LICENSE_END========================================================= + */ +package org.onap.portalapp.scheduler; + +import static org.junit.Assert.assertNotNull; +import java.text.ParseException; +import java.util.HashMap; +import java.util.Map; +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.onap.portalapp.service.sessionmgt.TimeoutHandler; +import org.springframework.scheduling.quartz.JobDetailFactoryBean; + +public class SessionMgtRegistryTest { + + @Mock + JobDetailFactoryBean job; + @Mock + TimeoutHandler lj; + @InjectMocks + SessionMgtRegistry lr; + + String groupName = "AppGroup"; + String jobName = "LogJob"; + @Before + public void initialize(){ + MockitoAnnotations.initMocks(this); + } + @Test + public void jobDetailFactoryBeantest() throws ParseException{ + + Map<String, Object> map = new HashMap<String, Object>(); + map.put("units", "bytes"); + job.setJobClass(TimeoutHandler.class); + job.setJobDataAsMap(map); + job.setGroup(groupName); + job.setName(jobName); + assertNotNull(lr.jobDetailFactoryBean()); + } +} diff --git a/ecomp-portal-DB-common/PortalDDLMySql_2_1_Common.sql b/ecomp-portal-DB-common/PortalDDLMySql_2_1_Common.sql deleted file mode 100644 index f80fb9a6..00000000 --- a/ecomp-portal-DB-common/PortalDDLMySql_2_1_Common.sql +++ /dev/null @@ -1,1779 +0,0 @@ --- --------------------------------------------------------------------------------------------------------------- --- This is the 2.1.0 version of Portal database called portal - --- note to : database admin, set the mysql system variable called lower_case_table_names --- it can be set 3 different ways: --- command-line options (cmd-line), --- options valid in configuration files (option file), or --- server system variables (system var). - --- it needs to be set to 1, then table names are stored in lowercase on disk and comparisons are not case sensitive. --- ----------------------------------------------------------------------------------------------------------------- -set foreign_key_checks=1; - -create database portal; - -SET GLOBAL character_set_client = utf8; -SET GLOBAL character_set_connection = utf8; -SET GLOBAL character_set_database = utf8; -SET GLOBAL character_set_results = utf8; -SET GLOBAL character_set_server = utf8; - -use portal; - --- ------------------ create table section --- --- name: cr_favorite_reports; type: table --- -create table cr_favorite_reports ( - user_id integer not null, - rep_id integer not null -); --- --- name: cr_filehist_log; type: table --- -create table cr_filehist_log ( - schedule_id numeric(11,0) not null, - url character varying(4000), - notes character varying(3500), - run_time timestamp -); --- --- name: cr_folder; type: table --- -create table cr_folder ( - folder_id integer not null, - folder_name character varying(50) not null, - descr character varying(500), - create_id integer not null, - create_date timestamp not null, - parent_folder_id integer, - public_yn character varying(1) default 'n' not null -); --- --- name: cr_folder_access; type: table --- -create table cr_folder_access ( - folder_access_id numeric(11,0) not null, - folder_id numeric(11,0) not null, - order_no numeric(11,0) not null, - role_id numeric(11,0), - user_id numeric(11,0), - read_only_yn character varying(1) default 'n' not null -); --- --- name: cr_hist_user_map; type: table --- -create table cr_hist_user_map ( - hist_id int(11) not null, - user_id int(11) not null -); --- --- name: cr_lu_file_type; type: table --- -create table cr_lu_file_type ( - lookup_id numeric(2,0) not null, - lookup_descr character varying(255) not null, - active_yn character(1) default 'y', - error_code numeric(11,0) -); --- --- name: cr_raptor_action_img; type: table --- -create table cr_raptor_action_img ( - image_id character varying(100) not null, - image_loc character varying(400) -); --- --- name: cr_raptor_pdf_img; type: table --- -create table cr_raptor_pdf_img ( - image_id character varying(100) not null, - image_loc character varying(400) -); --- --- name: cr_remote_schema_info; type: table --- -create table cr_remote_schema_info ( - schema_prefix character varying(5) not null, - schema_desc character varying(75) not null, - datasource_type character varying(100) -); --- --- name: cr_report; type: table --- -create table cr_report ( - rep_id numeric(11,0) not null, - title character varying(100) not null, - descr character varying(255), - public_yn character varying(1) default 'n' not null, - report_xml text, - create_id numeric(11,0), - create_date timestamp default now(), - maint_id numeric(11,0), - maint_date timestamp default now(), - menu_id character varying(500), - menu_approved_yn character varying(1) default 'n' not null, - owner_id numeric(11,0), - folder_id integer default 0, - dashboard_type_yn character varying(1) default 'n', - dashboard_yn character varying(1) default 'n' -); --- --- name: cr_report_access; type: table --- -create table cr_report_access ( - rep_id numeric(11,0) not null, - order_no numeric(11,0) not null, - role_id numeric(11,0), - user_id numeric(11,0), - read_only_yn character varying(1) default 'n' not null -); --- --- name: cr_report_dwnld_log; type: table --- -create table cr_report_dwnld_log ( - user_id numeric(11,0) not null, - rep_id integer not null, - file_name character varying(100) not null, - dwnld_start_time timestamp default now() not null, - record_ready_time timestamp default now(), - filter_params character varying(2000) -); --- --- name: cr_report_email_sent_log; type: table --- -create table cr_report_email_sent_log ( - log_id integer not null, - schedule_id numeric(11,0), - gen_key character varying(25) not null, - rep_id numeric(11,0) not null, - user_id numeric(11,0), - sent_date timestamp default now(), - access_flag character varying(1) default 'y' not null, - touch_date timestamp default now() -); --- --- name: cr_report_file_history; type: table --- -create table cr_report_file_history ( - hist_id int(11) not null, - sched_user_id numeric(11,0) not null, - schedule_id numeric(11,0) not null, - user_id numeric(11,0) not null, - rep_id numeric(11,0), - run_date timestamp, - recurrence character varying(50), - file_type_id numeric(2,0), - file_name character varying(80), - file_blob blob, - file_size numeric(11,0), - raptor_url character varying(4000), - error_yn character(1) default 'n', - error_code numeric(11,0), - deleted_yn character(1) default 'n', - deleted_by numeric(38,0) -); --- --- name: cr_report_log; type: table --- -create table cr_report_log ( - rep_id numeric(11,0) not null, - log_time timestamp not null, - user_id numeric(11,0) not null, - action character varying(2000) not null, - action_value character varying(50), - form_fields character varying(4000) -); --- --- name: cr_report_schedule; type: table --- -create table cr_report_schedule ( - schedule_id numeric(11,0) not null, - sched_user_id numeric(11,0) not null, - rep_id numeric(11,0) not null, - enabled_yn character varying(1) not null, - start_date timestamp default now(), - end_date timestamp default now(), - run_date timestamp default now(), - recurrence character varying(50), - conditional_yn character varying(1) not null, - condition_sql character varying(4000), - notify_type integer default 0, - max_row integer default 1000, - initial_formfields character varying(3500), - processed_formfields character varying(3500), - formfields character varying(3500), - condition_large_sql text, - encrypt_yn character(1) default 'n', - attachment_yn character(1) default 'y' -); --- --- name: cr_report_schedule_users; type: table --- -create table cr_report_schedule_users ( - schedule_id numeric(11,0) not null, - rep_id numeric(11,0) not null, - user_id numeric(11,0) not null, - role_id numeric(11,0), - order_no numeric(11,0) not null -); --- --- name: cr_report_template_map; type: table --- -create table cr_report_template_map ( - report_id integer not null, - template_file character varying(200) -); --- --- name: cr_schedule_activity_log; type: table --- -create table cr_schedule_activity_log ( - schedule_id numeric(11,0) not null, - url character varying(4000), - notes character varying(2000), - run_time timestamp -); --- --- name: cr_table_join; type: table --- -create table cr_table_join ( - src_table_name character varying(30) not null, - dest_table_name character varying(30) not null, - join_expr character varying(500) not null -); --- --- name: cr_table_role; type: table --- -create table cr_table_role ( - table_name character varying(30) not null, - role_id numeric(11,0) not null -); --- --- name: cr_table_source; type: table --- -create table cr_table_source ( - table_name character varying(30) not null, - display_name character varying(30) not null, - pk_fields character varying(200), - web_view_action character varying(50), - large_data_source_yn character varying(1) default 'n' not null, - filter_sql character varying(4000), - source_db character varying(50) -); --- --- name: fn_lu_timezone; type: table --- -create table fn_lu_timezone ( - timezone_id int(11) not null, - timezone_name character varying(100) not null, - timezone_value character varying(100) not null -); - -create table fn_user ( - user_id int(11) not null primary key auto_increment, - org_id int(11), - manager_id int(11), - first_name character varying(50), - middle_name character varying(50), - last_name character varying(50), - phone character varying(25), - fax character varying(25), - cellular character varying(25), - email character varying(50), - address_id numeric(11,0), - alert_method_cd character varying(10), - hrid character varying(20), - org_user_id CHARACTER VARYING(20), - org_code character varying(30), - login_id character varying(25), - login_pwd character varying(100), - last_login_date timestamp, - active_yn character varying(1) default 'y' not null, - created_id int(11), - created_date timestamp default now(), - modified_id int(11), - modified_date timestamp default now(), - is_internal_yn character(1) default 'n' not null, - address_line_1 character varying(100), - address_line_2 character varying(100), - city character varying(50), - state_cd character varying(3), - zip_code character varying(11), - country_cd character varying(3), - location_clli character varying(8), - org_manager_userid CHARACTER VARYING(20), - company character varying(100), - department_name character varying(100), - job_title character varying(100), - timezone int(11), - department character varying(25), - business_unit character varying(25), - business_unit_name character varying(100), - cost_center character varying(25), - fin_loc_code character varying(10), - silo_status character varying(10) -); - -alter table fn_user add column language_id int(2) default 1; - -create table fn_language( - language_id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, - language_name VARCHAR(100) NOT NULL, - language_alias VARCHAR(100) NOT NULL -); - -create table fn_display_text( - id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, - language_id int(11) NOT NULL, - text_id int(11) NOT NULL, - text_label VARCHAR(100) NOT NULL -); --- --- name: fn_role; type: table --- -create table fn_role ( - role_id int(11) not null primary key auto_increment, - role_name character varying(300) not null, - active_yn character varying(1) default 'y' not null, - priority numeric(4,0), - app_id int(11) default null, - app_role_id int(11) default null - -); --- --- name: fn_audit_action; type: table --- -create table fn_audit_action ( - audit_action_id integer not null, - class_name character varying(500) not null, - method_name character varying(50) not null, - audit_action_cd character varying(20) not null, - audit_action_desc character varying(200), - active_yn character varying(1) -); --- --- name: fn_audit_action_log; type: table --- -create table fn_audit_action_log ( - audit_log_id integer not null primary key auto_increment, - audit_action_cd character varying(200), - action_time timestamp, - user_id numeric(11,0), - class_name character varying(100), - method_name character varying(50), - success_msg character varying(20), - error_msg character varying(500) -); --- --- name: fn_lu_activity; type: table --- -create table fn_lu_activity ( - activity_cd character varying(50) not null primary key, - activity character varying(50) not null -); --- --- name: fn_audit_log; type: table --- -create table fn_audit_log ( - log_id int(11) not null primary key auto_increment, - user_id int(11) not null, - activity_cd character varying(50) not null, - audit_date timestamp default now() not null, - comments character varying(1000), - affected_record_id_bk character varying(500), - affected_record_id character varying(4000), - constraint fk_fn_audit_ref_209_fn_user foreign key (user_id) references fn_user(user_id) -); --- --- name: fn_broadcast_message; type: table --- -create table fn_broadcast_message ( - message_id int(11) not null primary key auto_increment, - message_text character varying(1000) not null, - message_location_id numeric(11,0) not null, - broadcast_start_date timestamp not null default now(), - broadcast_end_date timestamp not null default now(), - active_yn character(1) default 'y' not null, - sort_order numeric(4,0) not null, - broadcast_site_cd character varying(50) -); --- --- name: fn_chat_logs; type: table --- -create table fn_chat_logs ( - chat_log_id integer not null, - chat_room_id integer, - user_id integer, - message character varying(1000), - message_date_time timestamp -); --- --- name: fn_chat_room; type: table --- -create table fn_chat_room ( - chat_room_id integer not null, - name character varying(50) not null, - description character varying(500), - owner_id integer, - created_date timestamp default now(), - updated_date timestamp default now() -); --- --- name: fn_chat_users; type: table --- -create table fn_chat_users ( - chat_room_id integer, - user_id integer, - last_activity_date_time timestamp, - chat_status character varying(20), - id integer not null -); --- --- name: fn_datasource; type: table --- -create table fn_datasource ( - id integer not null primary key auto_increment, - name character varying(50), - driver_name character varying(256), - server character varying(256), - port integer, - user_name character varying(256), - password character varying(256), - url character varying(256), - min_pool_size integer, - max_pool_size integer, - adapter_id integer, - ds_type character varying(20) -); --- --- name: fn_function; type: table --- -create table fn_function ( - function_cd character varying(30) not null primary key, - function_name character varying(50) not null -); --- --- name: fn_lu_alert_method; type: table --- -create table fn_lu_alert_method ( - alert_method_cd character varying(10) not null, - alert_method character varying(50) not null -); --- --- name: fn_lu_broadcast_site; type: table --- -create table fn_lu_broadcast_site ( - broadcast_site_cd character varying(50) not null, - broadcast_site_descr character varying(100) -); --- --- name: fn_lu_menu_set; type: table --- -create table fn_lu_menu_set ( - menu_set_cd character varying(10) not null primary key, - menu_set_name character varying(50) not null -); --- --- name: fn_lu_priority; type: table --- -create table fn_lu_priority ( - priority_id numeric(11,0) not null, - priority character varying(50) not null, - active_yn character(1) not null, - sort_order numeric(5,0) -); --- --- name: fn_lu_role_type; type: table --- -create table fn_lu_role_type ( - role_type_id numeric(11,0) not null, - role_type character varying(50) not null -); --- --- name: fn_lu_tab_set; type: table --- -create table fn_lu_tab_set ( - tab_set_cd character varying(30) not null, - tab_set_name character varying(50) not null -); --- --- name: fn_menu; type: table --- -create table fn_menu ( - menu_id int(11) not null primary key auto_increment, - label character varying(100), - parent_id int(11), - sort_order numeric(4,0), - action character varying(200), - function_cd character varying(30), - active_yn character varying(1) default 'y' not null, - servlet character varying(50), - query_string character varying(200), - external_url character varying(200), - target character varying(25), - menu_set_cd character varying(10) default 'app', - separator_yn character(1) default 'n', - image_src character varying(100), - constraint fk_fn_menu_ref_196_fn_menu foreign key (parent_id) references fn_menu(menu_id), - constraint fk_fn_menu_menu_set_cd foreign key (menu_set_cd) references fn_lu_menu_set(menu_set_cd) -); - -create index idx_fn_menu_label on fn_menu(label); --- --- name: fn_org; type: table --- -create table fn_org ( - org_id int(11) not null, - org_name character varying(50) not null, - access_cd character varying(10) -); --- --- name: fn_restricted_url; type: table --- -create table fn_restricted_url ( - restricted_url character varying(250) not null, - function_cd character varying(30) not null -); --- --- name: fn_role_composite; type: table --- -create table fn_role_composite ( - parent_role_id int(11) not null, - child_role_id int(11) not null, - constraint fk_fn_role_composite_child foreign key (child_role_id) references fn_role(role_id), - constraint fk_fn_role_composite_parent foreign key (parent_role_id) references fn_role(role_id) -); --- --- name: fn_role_function; type: table --- -create table fn_role_function ( - role_id int(11) not null, - function_cd character varying(30) not null, - constraint fk_fn_role__ref_198_fn_role foreign key (role_id) references fn_role(role_id) -); --- --- name: fn_tab; type: table --- -create table fn_tab ( - tab_cd character varying(30) not null, - tab_name character varying(50) not null, - tab_descr character varying(100), - action character varying(100) not null, - function_cd character varying(30) not null, - active_yn character(1) not null, - sort_order numeric(11,0) not null, - parent_tab_cd character varying(30), - tab_set_cd character varying(30) -); --- --- name: fn_tab_selected; type: table --- -create table fn_tab_selected ( - selected_tab_cd character varying(30) not null, - tab_uri character varying(40) not null -); --- --- name: fn_user_pseudo_role; type: table --- -create table fn_user_pseudo_role ( - pseudo_role_id int(11) not null, - user_id int(11) not null -); --- --- name: fn_user_role; type: table --- -create table fn_user_role ( - user_id int(10) not null, - role_id int(10) not null, - priority numeric(4,0), - app_id int(11) default 2, - constraint fk_fn_user__ref_172_fn_user foreign key (user_id) references fn_user(user_id), - constraint fk_fn_user__ref_175_fn_role foreign key (role_id) references fn_role(role_id) -); --- --- name: schema_info; type: table --- -create table schema_info ( - SCHEMA_ID CHARACTER VARYING(25) not null, - SCHEMA_DESC CHARACTER VARYING(75) not null, - DATASOURCE_TYPE CHARACTER VARYING(100), - CONNECTION_URL VARCHAR(200) not null, - USER_NAME VARCHAR(45) not null, - PASSWORD VARCHAR(45) null default null, - DRIVER_CLASS VARCHAR(100) not null, - MIN_POOL_SIZE INT not null, - MAX_POOL_SIZE INT not null, - IDLE_CONNECTION_TEST_PERIOD INT not null - -); --- ---------------------------------------------------------- --- name: fn_app; type: table --- ---------------------------------------------------------- -create table fn_app ( - app_id int(11) primary key not null auto_increment, - app_name varchar(100) not null default '?', - app_image_url varchar(256) default null, - app_description varchar(512) default null, - app_notes varchar(4096) default null, - app_url varchar(256) default null, - app_alternate_url varchar(256) default null, - app_rest_endpoint varchar(2000) default null, - ml_app_name varchar(50) not null default '?', - ml_app_admin_id varchar(7) not null default '?', - mots_id int(11) default null, - app_password varchar(256) not null default '?', - open char(1) default 'N', - enabled char(1) default 'Y', - thumbnail mediumblob null default null, - app_username varchar(50), - ueb_key varchar(256) default null, - ueb_secret varchar(256) default null, - ueb_topic_name varchar(256) default null, - app_type int(11) not null default 1, - auth_central char(1) not null default 'N', - auth_namespace varchar(100) null default null -); - --- ------------------ functional menu tables ------------------- --- --- table structure for table fn_menu_functional --- -create table fn_menu_functional ( - menu_id int(11) not null auto_increment, - column_num int(2) not null, - text varchar(100) not null, - parent_menu_id int(11) default null, - url varchar(128) not null default '', - active_yn varchar(1) not null default 'y', - image_src varchar(100) default null, - primary key (menu_id), - key fk_fn_menu_func_parent_menu_id_idx (parent_menu_id), - constraint fk_fn_menu_func_parent_menu_id foreign key (parent_menu_id) references fn_menu_functional (menu_id) on delete no action on update no action -); --- --- table structure for table fn_menu_functional_ancestors --- - -create table fn_menu_functional_ancestors ( - id int(11) not null auto_increment, - menu_id int(11) not null, - ancestor_menu_id int(11) not null, - depth int(2) not null, - primary key (id), - key fk_fn_menu_func_anc_menu_id_idx (menu_id), - key fk_fn_menu_func_anc_anc_menu_id_idx (ancestor_menu_id), - constraint fk_fn_menu_func_anc_anc_menu_id foreign key (ancestor_menu_id) references fn_menu_functional (menu_id) on delete no action on update no action, - constraint fk_fn_menu_func_anc_menu_id foreign key (menu_id) references fn_menu_functional (menu_id) on delete no action on update no action -); --- --- table structure for table fn_menu_functional_roles --- -create table fn_menu_functional_roles ( - id int(11) not null auto_increment, - menu_id int(11) not null, - app_id int(11) not null, - role_id int(10) not null, - primary key (id), - key fk_fn_menu_func_roles_menu_id_idx (menu_id), - key fk_fn_menu_func_roles_app_id_idx (app_id), - key fk_fn_menu_func_roles_role_id_idx (role_id), - constraint fk_fn_menu_func_roles_app_id foreign key (app_id) references fn_app (app_id) on delete no action on update no action, - constraint fk_fn_menu_func_roles_menu_id foreign key (menu_id) references fn_menu_functional (menu_id) on delete no action on update no action, - constraint fk_fn_menu_func_roles_role_id foreign key (role_id) references fn_role (role_id) on delete no action on update no action -); --- ---------------------------------------------------------- --- NAME: FN_WORKFLOW; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_workflow ( - id mediumint(9) not null auto_increment, - name varchar(20) not null, - description varchar(500) default null, - run_link varchar(300) default null, - suspend_link varchar(300) default null, - modified_link varchar(300) default null, - active_yn varchar(300) default null, - created varchar(300) default null, - created_by int(11) default null, - modified varchar(300) default null, - modified_by int(11) default null, - workflow_key varchar(50) default null, - primary key (id), - UNIQUE KEY name (name) -); - - --- ---------------------------------------------------------- --- NAME: FN_SCHEDULE_WORKFLOWS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_schedule_workflows ( - id_schedule_workflows bigint(25) primary key not null auto_increment, - workflow_server_url varchar(45) default null, - workflow_key varchar(45) not null, - workflow_arguments varchar(45) default null, - startDateTimeCron varchar(45) default null, - endDateTime TIMESTAMP default NOW(), - start_date_time TIMESTAMP default NOW(), - recurrence varchar(45) default null - ); - - --- ---------------------------------------------------------- --- NAME: FN_SHARED_CONTEXT; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_shared_context ( - id int(11) not null auto_increment, - create_time timestamp not null, - context_id character varying(64) not null, - ckey character varying(128) not null, - cvalue character varying(1024), - primary key (id), - UNIQUE KEY session_key (context_id, ckey) ); - - --- ---------------------------------------------------------- --- NAME: FN_QZ_JOB_DETAILS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_job_details ( -SCHED_NAME VARCHAR(120) not null, -JOB_NAME VARCHAR(200) not null, -JOB_GROUP VARCHAR(200) not null, -DESCRIPTION VARCHAR(250) null, -JOB_CLASS_NAME VARCHAR(250) not null, -IS_DURABLE VARCHAR(1) not null, -IS_NONCONCURRENT VARCHAR(1) not null, -IS_UPDATE_DATA VARCHAR(1) not null, -REQUESTS_RECOVERY VARCHAR(1) not null, -JOB_DATA BLOB null, -primary key (SCHED_NAME,JOB_NAME,JOB_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_triggers ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -JOB_NAME VARCHAR(200) not null, -JOB_GROUP VARCHAR(200) not null, -DESCRIPTION VARCHAR(250) null, -NEXT_FIRE_TIME BIGINT(13) null, -PREV_FIRE_TIME BIGINT(13) null, -PRIORITY INTEGER null, -TRIGGER_STATE VARCHAR(16) not null, -TRIGGER_TYPE VARCHAR(8) not null, -START_TIME BIGINT(13) not null, -END_TIME BIGINT(13) null, -CALENDAR_NAME VARCHAR(200) null, -MISFIRE_INSTR SMALLINT(2) null, -JOB_DATA BLOB null, -primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) -REFERENCES FN_QZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_SIMPLE_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_simple_triggers ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -REPEAT_COUNT BIGINT(7) not null, -REPEAT_INTERVAL BIGINT(12) not null, -TIMES_TRIGGERED BIGINT(10) not null, -primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_CRON_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_cron_triggers ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -CRON_EXPRESSION VARCHAR(120) not null, -TIME_ZONE_ID VARCHAR(80), -primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_SIMPROP_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_simprop_triggers ( - SCHED_NAME VARCHAR(120) not null, - TRIGGER_NAME VARCHAR(200) not null, - TRIGGER_GROUP VARCHAR(200) not null, - STR_PROP_1 VARCHAR(512) null, - STR_PROP_2 VARCHAR(512) null, - STR_PROP_3 VARCHAR(512) null, - INT_PROP_1 INT null, - INT_PROP_2 INT null, - LONG_PROP_1 BIGINT null, - LONG_PROP_2 BIGINT null, - DEC_PROP_1 NUMERIC(13,4) null, - DEC_PROP_2 NUMERIC(13,4) null, - BOOL_PROP_1 VARCHAR(1) null, - BOOL_PROP_2 VARCHAR(1) null, - primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) - REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_BLOB_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_blob_triggers ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -BLOB_DATA BLOB null, -primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_CALENDARS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_calendars ( -SCHED_NAME VARCHAR(120) not null, -CALENDAR_NAME VARCHAR(200) not null, -CALENDAR BLOB not null, -primary key (SCHED_NAME,CALENDAR_NAME) -); - - --- ---------------------------------------------------------- --- NAME: FN_QZ_PAUSED_TRIGGER_GRPS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_paused_trigger_grps ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_GROUP VARCHAR(200) not null, -primary key (SCHED_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_FIRED_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_fired_triggers ( -SCHED_NAME VARCHAR(120) not null, -ENTRY_ID VARCHAR(95) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -INSTANCE_NAME VARCHAR(200) not null, -FIRED_TIME BIGINT(13) not null, -SCHED_TIME BIGINT(13) not null, -PRIORITY INTEGER not null, -STATE VARCHAR(16) not null, -JOB_NAME VARCHAR(200) null, -JOB_GROUP VARCHAR(200) null, -IS_NONCONCURRENT VARCHAR(1) null, -REQUESTS_RECOVERY VARCHAR(1) null, -primary key (SCHED_NAME,ENTRY_ID) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_SCHEDULER_STATE; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_scheduler_state ( -SCHED_NAME VARCHAR(120) not null, -INSTANCE_NAME VARCHAR(200) not null, -LAST_CHECKIN_TIME BIGINT(13) not null, -CHECKIN_INTERVAL BIGINT(13) not null, -primary key (SCHED_NAME,INSTANCE_NAME) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_LOCKS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_locks ( -SCHED_NAME VARCHAR(120) not null, -LOCK_NAME VARCHAR(40) not null, -primary key (SCHED_NAME,LOCK_NAME) -); - --- ---------------------------------------------------------- --- NAME: FN_MENU_FAVORITES; TYPE: TABLE --- ---------------------------------------------------------- - -create table fn_menu_favorites ( - user_id int(11) not null, - menu_id int(11) not null, - primary key (user_id,menu_id) -); - --- FACELIFT - Table for Events, News and Resources - -create table fn_common_widget_data( - id int auto_increment, - category varchar(32), - href varchar(512), - title varchar(256), - content varchar(4096), - event_date varchar(10), -- YYYY-MM-DD - sort_order int, - primary key (id) -); - -create table fn_app_contact_us ( - app_id int(11) not null, - contact_name varchar(128) default null, - contact_email varchar(128) default null, - url varchar(256) default null, - active_yn varchar(2) default null, - description varchar(1024) default null, - primary key (app_id), - constraint fk_fn_a_con__ref_202_fn_app foreign key (app_id) references fn_app (app_id) -); - --- new 1610.2 -create table fn_pers_user_app_sel ( - id int(11) not null auto_increment, - user_id int(11) not null, - app_id int(11) not null, - status_cd char(1) not null, - primary key(id), - constraint fk_1_fn_pers_user_app_sel_fn_user foreign key (user_id) references fn_user (user_id), - constraint fk_2_fn_pers_user_app_sel_fn_app foreign key (app_id) references fn_app (app_id) -); - --- end new 1610.2 - --- new 1702 tables/views - -- 1702 Additions for User Notifications - -- ---------------------------------------------------------- - -- NAME: ep_notification; TYPE: TABLE - -- ---------------------------------------------------------- - create table ep_notification ( - notification_ID int(11) primary key not null auto_increment, - is_for_online_users char(1) default 'N', - is_for_all_roles char(1) default 'N', - active_YN char(1) default 'Y', - msg_header varchar(100), - msg_description varchar(2000), - msg_source varchar(50) default 'EP', - start_time timestamp default now(), - end_time timestamp null, - priority int(11), - creator_ID int(11) null default null, - created_date timestamp null default null, - notification_hyperlink varchar(512) null default null -- new column for 1710 - ); - - -- ---------------------------------------------------------- - -- NAME: ep_role_notification; TYPE: TABLE - -- ---------------------------------------------------------- - create table ep_role_notification ( - ID int(11) primary key not null auto_increment, - notification_ID int(11), - role_ID int(11), - recv_user_id int(11) null, - constraint fk_ep_role_notif_fn_role foreign key (role_ID) references fn_role(role_id), - constraint fk_ep_role_notif_fn_notif foreign key (notification_ID) references ep_notification(notification_ID) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_user_notification; TYPE: TABLE - -- ---------------------------------------------------------- - create table ep_user_notification ( - ID int(11) primary key not null auto_increment, - User_ID int(11), - notification_ID int(11), - is_viewed char(1) default 'N', - updated_time timestamp default now(), - constraint fk_ep_urole_notif_fn_user foreign key (User_ID) references fn_user(user_id), - constraint fk_ep_urole_notif_fn_notif foreign key (notification_ID) references ep_notification(notification_ID) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_pers_user_app_sort; TYPE: Table - -- ---------------------------------------------------------- - - CREATE TABLE ep_pers_user_app_sort ( - id int(11) not null primary key auto_increment, - user_id int(11) not null, - sort_pref char(1) not null, - unique key uk_1_ep_pers_user_app_sort (user_id), - constraint fk_ep_pers_user_app_sort_fn_user foreign key (user_id) references fn_user(user_id) - ); - -- ---------------------------------------------------------- - -- NAME: ep_pers_user_app_man_sort; TYPE: Table - -- ---------------------------------------------------------- - - CREATE TABLE ep_pers_user_app_man_sort ( - id int(11) not null primary key auto_increment, - user_id int(11) not null, - app_id int(11) not null, - sort_order int(11) not null, - unique key uk_1_ep_pers_user_app_man_sort (user_id, app_id), - constraint fk_ep_pers_app_man_sort_fn_user foreign key (user_id) references fn_user(user_id), - constraint fk_ep_pers_app_man_sort_fn_app foreign key (app_id) references fn_app(app_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_catalog; TYPE: Table - -- ---------------------------------------------------------- - - CREATE TABLE ep_widget_catalog ( - widget_id int(11) not null auto_increment, - wdg_name varchar(100) not null default '?', - service_id int(11) default null, - wdg_desc varchar(200) default null, - wdg_file_loc varchar(256) not null default '?', - all_user_flag char(1) not null default 'N', - primary key (widget_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_catalog_role; TYPE: Table - -- ---------------------------------------------------------- - create table ep_widget_catalog_role ( - widget_id int(10) not null, - app_id int(11) default '1', - role_id int(10) not null, - key fk_ep_widget_catalog_role_fn_widget (widget_id), - key fk_ep_widget_catalog_role_ref_fn_role (role_id), - key fk_ep_widget_catalog_role_app_id (app_id), - constraint fk_ep_widget_catalog_role_fn_widget foreign key (widget_id) references ep_widget_catalog (widget_id), - constraint fk_ep_widget_catalog_role_ref_fn_role foreign key (role_id) references fn_role (role_id), - constraint fk_ep_widget_catalog_role_app_id foreign key (app_id) references fn_app (app_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_pers_user_widget_placement; TYPE: Table - -- ---------------------------------------------------------- - CREATE TABLE ep_pers_user_widget_placement ( - id int(11) not null primary key auto_increment, - user_id int(11) not null, - widget_id int(11) not null, - x int(11) not null, - y int(11), - height int(11), - width int(11), - unique key uk_1_ep_pers_user_widg_place (user_id, widget_id), - constraint fk_ep_pers_user_widg_place_fn_user foreign key (user_id) references fn_user(user_id), - constraint fk_ep_pers_user_widg_place_ep_widg foreign key (widget_id) references ep_widget_catalog(widget_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_pers_user_widget_sel; TYPE: TABLE - -- ---------------------------------------------------------- - CREATE TABLE ep_pers_user_widget_sel ( - id int(11) not null primary key auto_increment, - user_id int(11) not null, - widget_id int(11) not null, - status_cd char(1) not null, - unique key uk_1_ep_pers_user_widg_sel_user_widg (user_id, widget_id), - CONSTRAINT fk_1_ep_pers_user_wid_sel_fn_user FOREIGN KEY (user_id) REFERENCES fn_user (user_id), - CONSTRAINT fk_2_ep_pers_user_wid_sel_ep_wid FOREIGN KEY (widget_id) REFERENCES ep_widget_catalog (widget_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_catalog_files; TYPE: TABLE - -- ---------------------------------------------------------- - CREATE TABLE ep_widget_catalog_files ( - file_id int(11) not null primary key auto_increment, - widget_id int(11), - widget_name VARCHAR(100) NOT NULL, - framework_js LONGBLOB NULL, - controller_js LONGBLOB NULL, - markup_html LONGBLOB NULL, - widget_css LONGBLOB NULL - ); - - -- ---------------------------------------------------------- - -- NAME: fn_role_v; TYPE: VIEW - -- All roles without an APP_ID are Portal only. - -- ---------------------------------------------------------- - create view fn_role_v as - select fn_role.role_id as role_id, - fn_role.role_name as role_name, - fn_role.active_yn as active_yn, - fn_role.priority as priority, - fn_role.app_id as app_id, - fn_role.app_role_id as app_role_id - from fn_role where isnull(fn_role.app_id); - --- end new 1702 tables/views - --- new 1707 tables/views - - -- ---------------------------------------------------------- - -- NAME: ep_user_roles_request; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_user_roles_request ( - req_id int(11) not null primary key auto_increment, - user_id int(11) not null, - app_id int(11) not null, - created_date timestamp default now(), - updated_date timestamp default now(), - request_status character varying(50) not null, - constraint fk_user_roles_req_fn_user foreign key (user_id) references fn_user(user_id), - constraint fk_user_roles_req_fn_app foreign key (app_id) references fn_app(app_id) - ); - - - -- ---------------------------------------------------------- - -- NAME: ep_user_roles_request_det; TYPE: TABLE - -- ---------------------------------------------------------- -create table ep_user_roles_request_det ( - id int(11) not null primary key auto_increment, - req_id int(11) default null, - requested_role_id int(10) not null, - request_type character varying(10) not null, - constraint fk_user_roles_req_fn_req_id foreign key (req_id) references ep_user_roles_request(req_id), - constraint fk_user_roles_req_fn_role_id foreign key (requested_role_id) references fn_role(role_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_microservice; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_microservice ( - id INT(11) NOT NULL AUTO_INCREMENT, - name VARCHAR(50) NULL DEFAULT NULL, - description VARCHAR(50) NULL DEFAULT NULL, - appId INT(11) NULL DEFAULT NULL, - endpoint_url VARCHAR(200) NULL DEFAULT NULL, - security_type VARCHAR(50) NULL DEFAULT NULL, - username VARCHAR(50) NULL DEFAULT NULL, - password VARCHAR(50) NOT NULL, - active CHAR(1) NOT NULL DEFAULT 'Y', - PRIMARY KEY (id), - CONSTRAINT FK_FN_APP_EP_MICROSERVICE FOREIGN KEY (appId) REFERENCES fn_app (app_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_microservice_parameter; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_microservice_parameter ( - id INT(11) NOT NULL AUTO_INCREMENT, - service_id INT(11) NULL DEFAULT NULL, - para_key VARCHAR(50) NULL DEFAULT NULL, - para_value VARCHAR(50) NULL DEFAULT NULL, - PRIMARY KEY (id), - CONSTRAINT FK_EP_MICROSERIVCE_EP_MICROSERVICE_PARAMETER FOREIGN KEY (service_id) REFERENCES ep_microservice (id) -); - - - -- ---------------------------------------------------------- - -- NAME: ep_widget_preview_files; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_widget_preview_files ( - preview_id INT(11) NOT NULL AUTO_INCREMENT, - html_file LONGBLOB NULL, - css_file LONGBLOB NULL, - javascript_file LONGBLOB NULL, - framework_file LONGBLOB NULL, - PRIMARY KEY (preview_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_microservice; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_widget_microservice ( - id INT(11) NOT NULL AUTO_INCREMENT, - widget_id INT(11) NOT NULL DEFAULT '0', - microservice_id INT(11) NOT NULL DEFAULT '0', - PRIMARY KEY (id), - CONSTRAINT FK_EP_WIDGET_MICROSERVICE_EP_MICROSERVICE FOREIGN KEY (microservice_id) REFERENCES ep_microservice (id), - CONSTRAINT FK_EP_WIDGET_MICROSERVICE_EP_WIDGET FOREIGN KEY (widget_id) REFERENCES ep_widget_catalog (widget_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_basic_auth_account; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_basic_auth_account ( - id INT(11) NOT NULL AUTO_INCREMENT, - ext_app_name VARCHAR(50) NOT NULL, - username VARCHAR(50) NOT NULL, - password VARCHAR(50) null default null, - active_yn char(1) NOT NULL default 'Y', - PRIMARY KEY (id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_catalog_parameter; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_widget_catalog_parameter ( - id INT(11) NOT NULL AUTO_INCREMENT, - widget_id INT(11) NOT NULL, - user_id INT(11) NOT NULL, - param_id INT(11) NOT NULL, - user_value VARCHAR(50) NULL, - PRIMARY KEY (id), - CONSTRAINT EP_FN_USER_WIDGET_PARAMETER_FK FOREIGN KEY (user_id) REFERENCES fn_user (user_id), - CONSTRAINT EP_WIDGET_CATALOG_WIDGET_PARAMETER_FK FOREIGN KEY (widget_id) REFERENCES ep_widget_catalog (widget_id), - CONSTRAINT EP_PARAMETER_ID_WIDGET_PARAMETER_FK FOREIGN KEY (param_id) REFERENCES ep_microservice_parameter (id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_web_analytics_source; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_web_analytics_source( - resource_id int(11) NOT NULL auto_increment, - app_id int(11) NOT NULL, - report_source varchar(500), - report_name varchar(500), - PRIMARY KEY (resource_id), - FOREIGN KEY (app_id) REFERENCES fn_app(app_id) -); - - -- Machine Learning Tables - -- ---------------------------------------------------------- - -- NAME: ep_ml_model; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_ml_model( - time_stamp timestamp default now(), - group_id int(11) NOT NULL, - model longblob, - PRIMARY KEY (time_stamp,group_id) -); - -- ---------------------------------------------------------- - -- NAME: ep_ml_rec; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_ml_rec( - time_stamp timestamp default now(), - org_user_id varchar(20) NOT NULL, - rec varchar(4000) DEFAULT NULL, - PRIMARY KEY (time_stamp,org_user_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_ml_user; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_ml_user( - time_stamp timestamp default now(), - org_user_id varchar(20) NOT NULL, - group_id int(11) NOT NULL, - PRIMARY KEY (time_stamp,org_user_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_endpoints; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_endpoints ( - id INT(11) NOT NULL AUTO_INCREMENT, - url VARCHAR(50) NOT NULL, - PRIMARY KEY (id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_endpoints_basic_auth_account; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_endpoints_basic_auth_account ( - id INT(11) NOT NULL AUTO_INCREMENT, - ep_id INT(11) DEFAULT NULL, - account_id INT(11) DEFAULT NULL, - PRIMARY KEY (id), - CONSTRAINT ep_endpoints_basic_auth_account_account_id_fk FOREIGN KEY (account_id) REFERENCES ep_basic_auth_account (id), - CONSTRAINT ep_endpoints_basic_auth_account_ep_id_fk FOREIGN KEY (ep_id) REFERENCES ep_endpoints (id) - -); - --- end new 1707 tables/views - --- new 1710 tables/views - - -- ---------------------------------------------------------- - -- NAME: ep_app_function; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_app_function ( -app_id INT(11) NOT NULL, -function_cd VARCHAR(250) NOT NULL, -function_name VARCHAR(250) NOT NULL, -PRIMARY KEY (function_cd, app_id), -INDEX fk_ep_app_function_app_id (app_id), -CONSTRAINT fk_ep_app_function_app_id FOREIGN KEY (app_id) REFERENCES fn_app (app_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_app_role_function; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE `ep_app_role_function` ( -`id` INT(11) NOT NULL AUTO_INCREMENT, -`app_id` INT(11) NOT NULL, -`role_id` INT(11) NOT NULL, -`function_cd` VARCHAR(250) NOT NULL, -`role_app_id` VARCHAR(20) NULL DEFAULT NULL, -PRIMARY KEY (`id`), -UNIQUE INDEX `UNIQUE KEY` (`app_id`, `role_id`, `function_cd`), -CONSTRAINT `fk_ep_app_role_function_app_id` FOREIGN KEY (`app_id`) REFERENCES `fn_app` (`app_id`), -CONSTRAINT `fk_ep_app_role_function_ep_app_func` FOREIGN KEY (`app_id`, `function_cd`) REFERENCES `ep_app_function` (`app_id`, `function_cd`), -CONSTRAINT `fk_ep_app_role_function_role_id` FOREIGN KEY (`role_id`) REFERENCES `fn_role` (`role_id`) -); - --- end new 1710 tables/views - --- ---------------------------------------------------------- --- NAME: QUARTZ TYPE: INDEXES --- ---------------------------------------------------------- -create index idx_fn_qz_j_req_recovery on fn_qz_job_details(sched_name,requests_recovery); -create index idx_fn_qz_j_grp on fn_qz_job_details(sched_name,job_group); -create index idx_fn_qz_t_j on fn_qz_triggers(sched_name,job_name,job_group); -create index idx_fn_qz_t_jg on fn_qz_triggers(sched_name,job_group); -create index idx_fn_qz_t_c on fn_qz_triggers(sched_name,calendar_name); -create index idx_fn_qz_t_g on fn_qz_triggers(sched_name,trigger_group); -create index idx_fn_qz_t_state on fn_qz_triggers(sched_name,trigger_state); -create index idx_fn_qz_t_n_state on fn_qz_triggers(sched_name,trigger_name,trigger_group,trigger_state); -create index idx_fn_qz_t_n_g_state on fn_qz_triggers(sched_name,trigger_group,trigger_state); -create index idx_fn_qz_t_next_fire_time on fn_qz_triggers(sched_name,next_fire_time); -create index idx_fn_qz_t_nft_st on fn_qz_triggers(sched_name,trigger_state,next_fire_time); -create index idx_fn_qz_t_nft_misfire on fn_qz_triggers(sched_name,misfire_instr,next_fire_time); -create index idx_fn_qz_t_nft_st_misfire on fn_qz_triggers(sched_name,misfire_instr,next_fire_time,trigger_state); -create index idx_fn_qz_t_nft_st_misfire_grp on fn_qz_triggers(sched_name,misfire_instr,next_fire_time,trigger_group,trigger_state); -create index idx_fn_qz_ft_trig_inst_name on fn_qz_fired_triggers(sched_name,instance_name); -create index idx_fn_qz_ft_inst_job_req_rcvry on fn_qz_fired_triggers(sched_name,instance_name,requests_recovery); -create index idx_fn_qz_ft_j_g on fn_qz_fired_triggers(sched_name,job_name,job_group); -create index idx_fn_qz_ft_jg on fn_qz_fired_triggers(sched_name,job_group); -create index idx_fn_qz_ft_t_g on fn_qz_fired_triggers(sched_name,trigger_name,trigger_group); -create index idx_fn_qz_ft_tg on fn_qz_fired_triggers(sched_name,trigger_group); - - --- ------------------ create view section --- --- name: v_url_access; type: view --- -create view v_url_access as - select distinct m.action as url, - m.function_cd - from fn_menu m - where (m.action is not null) -union - select distinct t.action as url, - t.function_cd - from fn_tab t - where (t.action is not null) -union - select r.restricted_url as url, - r.function_cd - from fn_restricted_url r; - --- ------------------ alter table add constraint primary key section --- --- name: cr_favorite_reports_user_idrep_id; type: constraint --- -alter table cr_favorite_reports - add constraint cr_favorite_reports_user_idrep_id primary key (user_id, rep_id); --- --- name: cr_folder_folder_id; type: constraint --- -alter table cr_folder - add constraint cr_folder_folder_id primary key (folder_id); --- --- name: cr_folder_access_folder_access_id; type: constraint --- -alter table cr_folder_access - add constraint cr_folder_access_folder_access_id primary key (folder_access_id); --- --- name: cr_hist_user_map_hist_iduser_id; type: constraint --- -alter table cr_hist_user_map - add constraint cr_hist_user_map_hist_iduser_id primary key (hist_id, user_id); --- --- name: cr_lu_file_type_lookup_id; type: constraint --- -alter table cr_lu_file_type - add constraint cr_lu_file_type_lookup_id primary key (lookup_id); --- --- name: cr_raptor_action_img_image_id; type: constraint --- -alter table cr_raptor_action_img - add constraint cr_raptor_action_img_image_id primary key (image_id); --- --- name: cr_raptor_pdf_img_image_id; type: constraint --- -alter table cr_raptor_pdf_img - add constraint cr_raptor_pdf_img_image_id primary key (image_id); --- --- name: cr_remote_schema_info_schema_prefix; type: constraint --- -alter table cr_remote_schema_info - add constraint cr_remote_schema_info_schema_prefix primary key (schema_prefix); --- --- name: cr_report_rep_id; type: constraint --- -alter table cr_report - add constraint cr_report_rep_id primary key (rep_id); --- --- name: cr_report_access_rep_idorder_no; type: constraint --- -alter table cr_report_access - add constraint cr_report_access_rep_idorder_no primary key (rep_id, order_no); --- --- name: cr_report_email_sent_log_log_id; type: constraint --- -alter table cr_report_email_sent_log - add constraint cr_report_email_sent_log_log_id primary key (log_id); --- --- name: cr_report_file_history_hist_id; type: constraint --- -alter table cr_report_file_history - add constraint cr_report_file_history_hist_id primary key (hist_id); --- --- name: cr_report_schedule_schedule_id; type: constraint --- -alter table cr_report_schedule - add constraint cr_report_schedule_schedule_id primary key (schedule_id); --- --- name: cr_report_schedule_users_schedule_idrep_iduser_idorder_no; type: constraint --- -alter table cr_report_schedule_users - add constraint cr_report_schedule_users_schedule_idrep_iduser_idorder_no primary key (schedule_id, rep_id, user_id, order_no); --- --- name: cr_report_template_map_report_id; type: constraint --- -alter table cr_report_template_map - add constraint cr_report_template_map_report_id primary key (report_id); --- --- name: cr_table_role_table_namerole_id; type: constraint --- -alter table cr_table_role - add constraint cr_table_role_table_namerole_id primary key (table_name, role_id); --- --- name: cr_table_source_table_name; type: constraint --- -alter table cr_table_source - add constraint cr_table_source_table_name primary key (table_name); --- --- name: fn_audit_action_audit_action_id; type: constraint --- -alter table fn_audit_action - add constraint fn_audit_action_audit_action_id primary key (audit_action_id); --- --- --- name: fk_fn_audit_ref_205_fn_lu_ac; type: constraint --- -alter table fn_audit_log - add constraint fk_fn_audit_ref_205_fn_lu_ac foreign key (activity_cd) references fn_lu_activity(activity_cd); --- --- name: fk_fn_role__ref_201_fn_funct; type: constraint --- -alter table fn_role_function - add constraint fk_fn_role__ref_201_fn_funct foreign key (function_cd) references fn_function(function_cd); --- --- name: fn_chat_logs_chat_log_id; type: constraint --- -alter table fn_chat_logs - add constraint fn_chat_logs_chat_log_id primary key (chat_log_id); --- --- name: fn_chat_room_chat_room_id; type: constraint --- -alter table fn_chat_room - add constraint fn_chat_room_chat_room_id primary key (chat_room_id); --- --- name: fn_chat_users_id; type: constraint --- -alter table fn_chat_users - add constraint fn_chat_users_id primary key (id); --- --- name: fn_lu_alert_method_alert_method_cd; type: constraint --- -alter table fn_lu_alert_method - add constraint fn_lu_alert_method_alert_method_cd primary key (alert_method_cd); --- --- name: fn_lu_broadcast_site_broadcast_site_cd; type: constraint --- -alter table fn_lu_broadcast_site - add constraint fn_lu_broadcast_site_broadcast_site_cd primary key (broadcast_site_cd); --- --- name: fn_lu_priority_priority_id; type: constraint --- -alter table fn_lu_priority - add constraint fn_lu_priority_priority_id primary key (priority_id); --- --- name: fn_lu_role_type_role_type_id; type: constraint --- -alter table fn_lu_role_type - add constraint fn_lu_role_type_role_type_id primary key (role_type_id); --- --- name: fn_lu_tab_set_tab_set_cd; type: constraint --- -alter table fn_lu_tab_set - add constraint fn_lu_tab_set_tab_set_cd primary key (tab_set_cd); --- --- name: fn_lu_timezone_timezone_id; type: constraint --- -alter table fn_lu_timezone - add constraint fn_lu_timezone_timezone_id primary key (timezone_id); --- --- name: fn_org_org_id; type: constraint --- -alter table fn_org - add constraint fn_org_org_id primary key (org_id); --- --- name: fn_restricted_url_restricted_urlfunction_cd; type: constraint --- -alter table fn_restricted_url - add constraint fn_restricted_url_restricted_urlfunction_cd primary key (restricted_url, function_cd); --- --- name: fn_role_composite_parent_role_idchild_role_id; type: constraint --- -alter table fn_role_composite - add constraint fn_role_composite_parent_role_idchild_role_id primary key (parent_role_id, child_role_id); --- --- name: fn_role_function_role_idfunction_cd; type: constraint --- -alter table fn_role_function - add constraint fn_role_function_role_idfunction_cd primary key (role_id, function_cd); --- --- name: fn_tab_tab_cd; type: constraint --- -alter table fn_tab - add constraint fn_tab_tab_cd primary key (tab_cd); --- --- name: fn_tab_selected_selected_tab_cdtab_uri; type: constraint --- -alter table fn_tab_selected - add constraint fn_tab_selected_selected_tab_cdtab_uri primary key (selected_tab_cd, tab_uri); --- --- name: fn_user_pseudo_role_pseudo_role_iduser_id; type: constraint --- -alter table fn_user_pseudo_role - add constraint fn_user_pseudo_role_pseudo_role_iduser_id primary key (pseudo_role_id, user_id); --- --- name: fn_user_role_user_idrole_id; type: constraint --- -alter table fn_user_role - add constraint fn_user_role_user_idrole_id primary key (user_id, role_id, app_id); --- ------------------ create index section --- --- name: cr_report_create_idpublic_yntitle; type: index --- -create index cr_report_create_idpublic_yntitle using btree on cr_report (create_id, public_yn, title); --- --- name: cr_table_join_dest_table_name; type: index --- -create index cr_table_join_dest_table_name using btree on cr_table_join (dest_table_name); --- --- name: cr_table_join_src_table_name; type: index --- -create index cr_table_join_src_table_name using btree on cr_table_join (src_table_name); --- --- name: fn_audit_log_activity_cd; type: index --- -create index fn_audit_log_activity_cd using btree on fn_audit_log (activity_cd); --- --- name: fn_audit_log_user_id; type: index --- -create index fn_audit_log_user_id using btree on fn_audit_log (user_id); --- --- name: fn_org_access_cd; type: index --- -create index fn_org_access_cd using btree on fn_org (access_cd); --- --- name: fn_role_function_function_cd; type: index --- -create index fn_role_function_function_cd using btree on fn_role_function (function_cd); --- --- name: fn_role_function_role_id; type: index --- -create index fn_role_function_role_id using btree on fn_role_function (role_id); --- --- name: fn_user_address_id; type: index --- -create index fn_user_address_id using btree on fn_user (address_id); --- --- name: fn_user_alert_method_cd; type: index --- -create index fn_user_alert_method_cd using btree on fn_user (alert_method_cd); --- --- name: fn_user_hrid; type: index --- -create unique index fn_user_hrid using btree on fn_user (hrid); --- --- name: fn_user_login_id; type: index --- -create unique index fn_user_login_id using btree on fn_user (login_id); --- --- name: fn_user_org_id; type: index --- -create index fn_user_org_id using btree on fn_user (org_id); --- --- name: fn_user_role_role_id; type: index --- -create index fn_user_role_role_id using btree on fn_user_role (role_id); --- --- name: fn_user_role_user_id; type: index --- -create index fn_user_role_user_id using btree on fn_user_role (user_id); --- --- name: fk_fn_user__ref_178_fn_app_idx; type: index --- -create index fk_fn_user__ref_178_fn_app_idx on fn_user_role (app_id); - -- - -- name: fn_role_name_app_id_idx; type: index - -- - create unique index fn_role_name_app_id_idx using btree on fn_role (role_name,app_id); - --- new for 1707 - -create index ep_notif_recv_user_id_idx using btree on ep_role_notification (recv_user_id); - --- end new for 1707 - --- ------------------ alter table add constraint foreign key section --- --- name: fk_fn_user__ref_178_fn_app; type: fk constraint --- -alter table fn_user_role - add constraint fk_fn_user__ref_178_fn_app foreign key (app_id) references fn_app(app_id); --- --- name: fk_cr_repor_ref_14707_cr_repor; type: fk constraint --- -alter table cr_report_schedule - add constraint fk_cr_repor_ref_14707_cr_repor foreign key (rep_id) references cr_report(rep_id); --- --- name: fk_cr_repor_ref_14716_cr_repor; type: fk constraint --- -alter table cr_report_schedule_users - add constraint fk_cr_repor_ref_14716_cr_repor foreign key (schedule_id) references cr_report_schedule(schedule_id); --- --- name: fk_cr_repor_ref_17645_cr_repor; type: fk constraint --- -alter table cr_report_log - add constraint fk_cr_repor_ref_17645_cr_repor foreign key (rep_id) references cr_report(rep_id); --- --- name: fk_cr_repor_ref_8550_cr_repor; type: fk constraint --- -alter table cr_report_access - add constraint fk_cr_repor_ref_8550_cr_repor foreign key (rep_id) references cr_report(rep_id); --- --- name: fk_cr_report_rep_id; type: fk constraint --- -alter table cr_report_email_sent_log - add constraint fk_cr_report_rep_id foreign key (rep_id) references cr_report(rep_id); --- --- name: fk_cr_table_ref_311_cr_tab; type: fk constraint --- -alter table cr_table_join - add constraint fk_cr_table_ref_311_cr_tab foreign key (src_table_name) references cr_table_source(table_name); --- --- name: fk_cr_table_ref_315_cr_tab; type: fk constraint --- -alter table cr_table_join - add constraint fk_cr_table_ref_315_cr_tab foreign key (dest_table_name) references cr_table_source(table_name); --- --- name: fk_cr_table_ref_32384_cr_table; type: fk constraint --- -alter table cr_table_role - add constraint fk_cr_table_ref_32384_cr_table foreign key (table_name) references cr_table_source(table_name); --- --- name: fk_fn_tab_function_cd; type: fk constraint --- -alter table fn_tab - add constraint fk_fn_tab_function_cd foreign key (function_cd) references fn_function(function_cd); --- --- name: fk_fn_tab_selected_tab_cd; type: fk constraint --- -alter table fn_tab_selected - add constraint fk_fn_tab_selected_tab_cd foreign key (selected_tab_cd) references fn_tab(tab_cd); --- --- name: fk_fn_tab_set_cd; type: fk constraint --- -alter table fn_tab - add constraint fk_fn_tab_set_cd foreign key (tab_set_cd) references fn_lu_tab_set(tab_set_cd); --- --- name: fk_fn_user_ref_110_fn_org; type: fk constraint --- -alter table fn_user - add constraint fk_fn_user_ref_110_fn_org foreign key (org_id) references fn_org(org_id); --- --- name: fk_fn_user_ref_123_fn_lu_al; type: fk constraint --- -alter table fn_user - add constraint fk_fn_user_ref_123_fn_lu_al foreign key (alert_method_cd) references fn_lu_alert_method(alert_method_cd); --- --- name: fk_fn_user_ref_197_fn_user; type: fk constraint --- - alter table fn_user - add constraint fk_fn_user_ref_197_fn_user foreign key (manager_id) references fn_user(user_id); --- --- name: fk_fn_user_ref_198_fn_user; type: fk constraint --- -alter table fn_user - add constraint fk_fn_user_ref_198_fn_user foreign key (created_id) references fn_user(user_id); --- --- name: fk_fn_user_ref_199_fn_user; type: fk constraint --- -alter table fn_user - add constraint fk_fn_user_ref_199_fn_user foreign key (modified_id) references fn_user(user_id); --- --- name: fk_parent_key_cr_folder; type: fk constraint --- -alter table cr_folder - add constraint fk_parent_key_cr_folder foreign key (parent_folder_id) references cr_folder(folder_id); --- --- name: fk_pseudo_role_pseudo_role_id; type: fk constraint --- -alter table fn_user_pseudo_role - add constraint fk_pseudo_role_pseudo_role_id foreign key (pseudo_role_id) references fn_role(role_id); --- --- name: fk_pseudo_role_user_id; type: fk constraint --- -alter table fn_user_pseudo_role - add constraint fk_pseudo_role_user_id foreign key (user_id) references fn_user(user_id); --- --- name: fk_restricted_url_function_cd; type: fk constraint --- -alter table fn_restricted_url - add constraint fk_restricted_url_function_cd foreign key (function_cd) references fn_function(function_cd); --- --- name: fk_timezone; type: fk constraint --- -alter table fn_user - add constraint fk_timezone foreign key (timezone) references fn_lu_timezone(timezone_id); --- --- name: sys_c0014614; type: fk constraint --- -alter table cr_report_file_history - add constraint sys_c0014614 foreign key (file_type_id) references cr_lu_file_type(lookup_id); --- --- name: sys_c0014615; type: fk constraint --- -alter table cr_report_file_history - add constraint sys_c0014615 foreign key (rep_id) references cr_report(rep_id); --- --- name: sys_c0014616; type: fk constraint --- -alter table cr_hist_user_map - add constraint sys_c0014616 foreign key (hist_id) references cr_report_file_history(hist_id); --- --- name: sys_c0014617; type: fk constraint --- -alter table cr_hist_user_map - add constraint sys_c0014617 foreign key (user_id) references fn_user(user_id); --- --- name: sys_c0014618; type: fk constraint --- -alter table fn_menu_favorites -add constraint sys_c0014618 foreign key (user_id) references fn_user(user_id); - --- --- name: sys_c0014619; type: fk constraint --- -alter table fn_menu_favorites -add constraint sys_c0014619 foreign key (menu_id) references fn_menu_functional(menu_id); - -commit;
\ No newline at end of file diff --git a/ecomp-portal-DB-common/PortalDDLMySql_2_4_Common.sql b/ecomp-portal-DB-common/PortalDDLMySql_2_4_Common.sql deleted file mode 100644 index f4898a00..00000000 --- a/ecomp-portal-DB-common/PortalDDLMySql_2_4_Common.sql +++ /dev/null @@ -1,1758 +0,0 @@ --- --------------------------------------------------------------------------------------------------------------- --- This is the 2.1.0 version of Portal database called portal - --- note to : database admin, set the mysql system variable called lower_case_table_names --- it can be set 3 different ways: --- command-line options (cmd-line), --- options valid in configuration files (option file), or --- server system variables (system var). - --- it needs to be set to 1, then table names are stored in lowercase on disk and comparisons are not case sensitive. --- ----------------------------------------------------------------------------------------------------------------- -set foreign_key_checks=1; - -create database portal; - -use portal; - --- ------------------ create table section --- --- name: cr_favorite_reports; type: table --- -create table cr_favorite_reports ( - user_id integer not null, - rep_id integer not null -); --- --- name: cr_filehist_log; type: table --- -create table cr_filehist_log ( - schedule_id numeric(11,0) not null, - url character varying(4000), - notes character varying(3500), - run_time timestamp -); --- --- name: cr_folder; type: table --- -create table cr_folder ( - folder_id integer not null, - folder_name character varying(50) not null, - descr character varying(500), - create_id integer not null, - create_date timestamp not null, - parent_folder_id integer, - public_yn character varying(1) default 'n' not null -); --- --- name: cr_folder_access; type: table --- -create table cr_folder_access ( - folder_access_id numeric(11,0) not null, - folder_id numeric(11,0) not null, - order_no numeric(11,0) not null, - role_id numeric(11,0), - user_id numeric(11,0), - read_only_yn character varying(1) default 'n' not null -); --- --- name: cr_hist_user_map; type: table --- -create table cr_hist_user_map ( - hist_id int(11) not null, - user_id int(11) not null -); --- --- name: cr_lu_file_type; type: table --- -create table cr_lu_file_type ( - lookup_id numeric(2,0) not null, - lookup_descr character varying(255) not null, - active_yn character(1) default 'y', - error_code numeric(11,0) -); --- --- name: cr_raptor_action_img; type: table --- -create table cr_raptor_action_img ( - image_id character varying(100) not null, - image_loc character varying(400) -); --- --- name: cr_raptor_pdf_img; type: table --- -create table cr_raptor_pdf_img ( - image_id character varying(100) not null, - image_loc character varying(400) -); --- --- name: cr_remote_schema_info; type: table --- -create table cr_remote_schema_info ( - schema_prefix character varying(5) not null, - schema_desc character varying(75) not null, - datasource_type character varying(100) -); --- --- name: cr_report; type: table --- -create table cr_report ( - rep_id numeric(11,0) not null, - title character varying(100) not null, - descr character varying(255), - public_yn character varying(1) default 'n' not null, - report_xml text, - create_id numeric(11,0), - create_date timestamp default now(), - maint_id numeric(11,0), - maint_date timestamp default now(), - menu_id character varying(500), - menu_approved_yn character varying(1) default 'n' not null, - owner_id numeric(11,0), - folder_id integer default 0, - dashboard_type_yn character varying(1) default 'n', - dashboard_yn character varying(1) default 'n' -); --- --- name: cr_report_access; type: table --- -create table cr_report_access ( - rep_id numeric(11,0) not null, - order_no numeric(11,0) not null, - role_id numeric(11,0), - user_id numeric(11,0), - read_only_yn character varying(1) default 'n' not null -); --- --- name: cr_report_dwnld_log; type: table --- -create table cr_report_dwnld_log ( - user_id numeric(11,0) not null, - rep_id integer not null, - file_name character varying(100) not null, - dwnld_start_time timestamp default now() not null, - record_ready_time timestamp default now(), - filter_params character varying(2000) -); --- --- name: cr_report_email_sent_log; type: table --- -create table cr_report_email_sent_log ( - log_id integer not null, - schedule_id numeric(11,0), - gen_key character varying(25) not null, - rep_id numeric(11,0) not null, - user_id numeric(11,0), - sent_date timestamp default now(), - access_flag character varying(1) default 'y' not null, - touch_date timestamp default now() -); --- --- name: cr_report_file_history; type: table --- -create table cr_report_file_history ( - hist_id int(11) not null, - sched_user_id numeric(11,0) not null, - schedule_id numeric(11,0) not null, - user_id numeric(11,0) not null, - rep_id numeric(11,0), - run_date timestamp, - recurrence character varying(50), - file_type_id numeric(2,0), - file_name character varying(80), - file_blob blob, - file_size numeric(11,0), - raptor_url character varying(4000), - error_yn character(1) default 'n', - error_code numeric(11,0), - deleted_yn character(1) default 'n', - deleted_by numeric(38,0) -); --- --- name: cr_report_log; type: table --- -create table cr_report_log ( - rep_id numeric(11,0) not null, - log_time timestamp not null, - user_id numeric(11,0) not null, - action character varying(2000) not null, - action_value character varying(50), - form_fields character varying(4000) -); --- --- name: cr_report_schedule; type: table --- -create table cr_report_schedule ( - schedule_id numeric(11,0) not null, - sched_user_id numeric(11,0) not null, - rep_id numeric(11,0) not null, - enabled_yn character varying(1) not null, - start_date timestamp default now(), - end_date timestamp default now(), - run_date timestamp default now(), - recurrence character varying(50), - conditional_yn character varying(1) not null, - condition_sql character varying(4000), - notify_type integer default 0, - max_row integer default 1000, - initial_formfields character varying(3500), - processed_formfields character varying(3500), - formfields character varying(3500), - condition_large_sql text, - encrypt_yn character(1) default 'n', - attachment_yn character(1) default 'y' -); --- --- name: cr_report_schedule_users; type: table --- -create table cr_report_schedule_users ( - schedule_id numeric(11,0) not null, - rep_id numeric(11,0) not null, - user_id numeric(11,0) not null, - role_id numeric(11,0), - order_no numeric(11,0) not null -); --- --- name: cr_report_template_map; type: table --- -create table cr_report_template_map ( - report_id integer not null, - template_file character varying(200) -); --- --- name: cr_schedule_activity_log; type: table --- -create table cr_schedule_activity_log ( - schedule_id numeric(11,0) not null, - url character varying(4000), - notes character varying(2000), - run_time timestamp -); --- --- name: cr_table_join; type: table --- -create table cr_table_join ( - src_table_name character varying(30) not null, - dest_table_name character varying(30) not null, - join_expr character varying(500) not null -); --- --- name: cr_table_role; type: table --- -create table cr_table_role ( - table_name character varying(30) not null, - role_id numeric(11,0) not null -); --- --- name: cr_table_source; type: table --- -create table cr_table_source ( - table_name character varying(30) not null, - display_name character varying(30) not null, - pk_fields character varying(200), - web_view_action character varying(50), - large_data_source_yn character varying(1) default 'n' not null, - filter_sql character varying(4000), - source_db character varying(50) -); --- --- name: fn_lu_timezone; type: table --- -create table fn_lu_timezone ( - timezone_id int(11) not null, - timezone_name character varying(100) not null, - timezone_value character varying(100) not null -); - -create table fn_user ( - user_id int(11) not null primary key auto_increment, - org_id int(11), - manager_id int(11), - first_name character varying(50), - middle_name character varying(50), - last_name character varying(50), - phone character varying(25), - fax character varying(25), - cellular character varying(25), - email character varying(50), - address_id numeric(11,0), - alert_method_cd character varying(10), - hrid character varying(20), - org_user_id CHARACTER VARYING(20), - org_code character varying(30), - login_id character varying(25), - login_pwd character varying(100), - last_login_date timestamp, - active_yn character varying(1) default 'y' not null, - created_id int(11), - created_date timestamp default now(), - modified_id int(11), - modified_date timestamp default now(), - is_internal_yn character(1) default 'n' not null, - address_line_1 character varying(100), - address_line_2 character varying(100), - city character varying(50), - state_cd character varying(3), - zip_code character varying(11), - country_cd character varying(3), - location_clli character varying(8), - org_manager_userid CHARACTER VARYING(20), - company character varying(100), - department_name character varying(100), - job_title character varying(100), - timezone int(11), - department character varying(25), - business_unit character varying(25), - business_unit_name character varying(100), - cost_center character varying(25), - fin_loc_code character varying(10), - silo_status character varying(10) -); --- --- name: fn_role; type: table --- -create table fn_role ( - role_id int(11) not null primary key auto_increment, - role_name character varying(300) not null, - active_yn character varying(1) default 'y' not null, - priority numeric(4,0), - app_id int(11) default null, - app_role_id int(11) default null - -); --- --- name: fn_audit_action; type: table --- -create table fn_audit_action ( - audit_action_id integer not null, - class_name character varying(500) not null, - method_name character varying(50) not null, - audit_action_cd character varying(20) not null, - audit_action_desc character varying(200), - active_yn character varying(1) -); --- --- name: fn_audit_action_log; type: table --- -create table fn_audit_action_log ( - audit_log_id integer not null primary key auto_increment, - audit_action_cd character varying(200), - action_time timestamp, - user_id numeric(11,0), - class_name character varying(100), - method_name character varying(50), - success_msg character varying(20), - error_msg character varying(500) -); --- --- name: fn_lu_activity; type: table --- -create table fn_lu_activity ( - activity_cd character varying(50) not null primary key, - activity character varying(50) not null -); --- --- name: fn_audit_log; type: table --- -create table fn_audit_log ( - log_id int(11) not null primary key auto_increment, - user_id int(11) not null, - activity_cd character varying(50) not null, - audit_date timestamp default now() not null, - comments character varying(1000), - affected_record_id_bk character varying(500), - affected_record_id character varying(4000), - constraint fk_fn_audit_ref_209_fn_user foreign key (user_id) references fn_user(user_id) -); --- --- name: fn_broadcast_message; type: table --- -create table fn_broadcast_message ( - message_id int(11) not null primary key auto_increment, - message_text character varying(1000) not null, - message_location_id numeric(11,0) not null, - broadcast_start_date timestamp not null default now(), - broadcast_end_date timestamp not null default now(), - active_yn character(1) default 'y' not null, - sort_order numeric(4,0) not null, - broadcast_site_cd character varying(50) -); --- --- name: fn_chat_logs; type: table --- -create table fn_chat_logs ( - chat_log_id integer not null, - chat_room_id integer, - user_id integer, - message character varying(1000), - message_date_time timestamp -); --- --- name: fn_chat_room; type: table --- -create table fn_chat_room ( - chat_room_id integer not null, - name character varying(50) not null, - description character varying(500), - owner_id integer, - created_date timestamp default now(), - updated_date timestamp default now() -); --- --- name: fn_chat_users; type: table --- -create table fn_chat_users ( - chat_room_id integer, - user_id integer, - last_activity_date_time timestamp, - chat_status character varying(20), - id integer not null -); --- --- name: fn_datasource; type: table --- -create table fn_datasource ( - id integer not null primary key auto_increment, - name character varying(50), - driver_name character varying(256), - server character varying(256), - port integer, - user_name character varying(256), - password character varying(256), - url character varying(256), - min_pool_size integer, - max_pool_size integer, - adapter_id integer, - ds_type character varying(20) -); --- --- name: fn_function; type: table --- -create table fn_function ( - function_cd character varying(30) not null primary key, - function_name character varying(50) not null -); --- --- name: fn_lu_alert_method; type: table --- -create table fn_lu_alert_method ( - alert_method_cd character varying(10) not null, - alert_method character varying(50) not null -); --- --- name: fn_lu_broadcast_site; type: table --- -create table fn_lu_broadcast_site ( - broadcast_site_cd character varying(50) not null, - broadcast_site_descr character varying(100) -); --- --- name: fn_lu_menu_set; type: table --- -create table fn_lu_menu_set ( - menu_set_cd character varying(10) not null primary key, - menu_set_name character varying(50) not null -); --- --- name: fn_lu_priority; type: table --- -create table fn_lu_priority ( - priority_id numeric(11,0) not null, - priority character varying(50) not null, - active_yn character(1) not null, - sort_order numeric(5,0) -); --- --- name: fn_lu_role_type; type: table --- -create table fn_lu_role_type ( - role_type_id numeric(11,0) not null, - role_type character varying(50) not null -); --- --- name: fn_lu_tab_set; type: table --- -create table fn_lu_tab_set ( - tab_set_cd character varying(30) not null, - tab_set_name character varying(50) not null -); --- --- name: fn_menu; type: table --- -create table fn_menu ( - menu_id int(11) not null primary key auto_increment, - label character varying(100), - parent_id int(11), - sort_order numeric(4,0), - action character varying(200), - function_cd character varying(30), - active_yn character varying(1) default 'y' not null, - servlet character varying(50), - query_string character varying(200), - external_url character varying(200), - target character varying(25), - menu_set_cd character varying(10) default 'app', - separator_yn character(1) default 'n', - image_src character varying(100), - constraint fk_fn_menu_ref_196_fn_menu foreign key (parent_id) references fn_menu(menu_id), - constraint fk_fn_menu_menu_set_cd foreign key (menu_set_cd) references fn_lu_menu_set(menu_set_cd) -); - -create index idx_fn_menu_label on fn_menu(label); --- --- name: fn_org; type: table --- -create table fn_org ( - org_id int(11) not null, - org_name character varying(50) not null, - access_cd character varying(10) -); --- --- name: fn_restricted_url; type: table --- -create table fn_restricted_url ( - restricted_url character varying(250) not null, - function_cd character varying(30) not null -); --- --- name: fn_role_composite; type: table --- -create table fn_role_composite ( - parent_role_id int(11) not null, - child_role_id int(11) not null, - constraint fk_fn_role_composite_child foreign key (child_role_id) references fn_role(role_id), - constraint fk_fn_role_composite_parent foreign key (parent_role_id) references fn_role(role_id) -); --- --- name: fn_role_function; type: table --- -create table fn_role_function ( - role_id int(11) not null, - function_cd character varying(30) not null, - constraint fk_fn_role__ref_198_fn_role foreign key (role_id) references fn_role(role_id) -); --- --- name: fn_tab; type: table --- -create table fn_tab ( - tab_cd character varying(30) not null, - tab_name character varying(50) not null, - tab_descr character varying(100), - action character varying(100) not null, - function_cd character varying(30) not null, - active_yn character(1) not null, - sort_order numeric(11,0) not null, - parent_tab_cd character varying(30), - tab_set_cd character varying(30) -); --- --- name: fn_tab_selected; type: table --- -create table fn_tab_selected ( - selected_tab_cd character varying(30) not null, - tab_uri character varying(40) not null -); --- --- name: fn_user_pseudo_role; type: table --- -create table fn_user_pseudo_role ( - pseudo_role_id int(11) not null, - user_id int(11) not null -); --- --- name: fn_user_role; type: table --- -create table fn_user_role ( - user_id int(10) not null, - role_id int(10) not null, - priority numeric(4,0), - app_id int(11) default 2, - constraint fk_fn_user__ref_172_fn_user foreign key (user_id) references fn_user(user_id), - constraint fk_fn_user__ref_175_fn_role foreign key (role_id) references fn_role(role_id) -); --- --- name: schema_info; type: table --- -create table schema_info ( - SCHEMA_ID CHARACTER VARYING(25) not null, - SCHEMA_DESC CHARACTER VARYING(75) not null, - DATASOURCE_TYPE CHARACTER VARYING(100), - CONNECTION_URL VARCHAR(200) not null, - USER_NAME VARCHAR(45) not null, - PASSWORD VARCHAR(45) null default null, - DRIVER_CLASS VARCHAR(100) not null, - MIN_POOL_SIZE INT not null, - MAX_POOL_SIZE INT not null, - IDLE_CONNECTION_TEST_PERIOD INT not null - -); --- ---------------------------------------------------------- --- name: fn_app; type: table --- ---------------------------------------------------------- -create table fn_app ( - app_id int(11) primary key not null auto_increment, - app_name varchar(100) not null default '?', - app_image_url varchar(256) default null, - app_description varchar(512) default null, - app_notes varchar(4096) default null, - app_url varchar(256) default null, - app_alternate_url varchar(256) default null, - app_rest_endpoint varchar(2000) default null, - ml_app_name varchar(50) not null default '?', - ml_app_admin_id varchar(7) not null default '?', - mots_id int(11) default null, - app_password varchar(256) default null, - open char(1) default 'N', - enabled char(1) default 'Y', - thumbnail mediumblob null default null, - app_username varchar(50), - ueb_key varchar(256) default null, - ueb_secret varchar(256) default null, - ueb_topic_name varchar(256) default null, - app_type int(11) not null default 1, - auth_central char(1) not null default 'N', - auth_namespace varchar(100) null default null -); - --- ------------------ functional menu tables ------------------- --- --- table structure for table fn_menu_functional --- -create table fn_menu_functional ( - menu_id int(11) not null auto_increment, - column_num int(2) not null, - text varchar(100) not null, - parent_menu_id int(11) default null, - url varchar(128) not null default '', - active_yn varchar(1) not null default 'y', - image_src varchar(100) default null, - primary key (menu_id), - key fk_fn_menu_func_parent_menu_id_idx (parent_menu_id), - constraint fk_fn_menu_func_parent_menu_id foreign key (parent_menu_id) references fn_menu_functional (menu_id) on delete no action on update no action -); --- --- table structure for table fn_menu_functional_ancestors --- - -create table fn_menu_functional_ancestors ( - id int(11) not null auto_increment, - menu_id int(11) not null, - ancestor_menu_id int(11) not null, - depth int(2) not null, - primary key (id), - key fk_fn_menu_func_anc_menu_id_idx (menu_id), - key fk_fn_menu_func_anc_anc_menu_id_idx (ancestor_menu_id), - constraint fk_fn_menu_func_anc_anc_menu_id foreign key (ancestor_menu_id) references fn_menu_functional (menu_id) on delete no action on update no action, - constraint fk_fn_menu_func_anc_menu_id foreign key (menu_id) references fn_menu_functional (menu_id) on delete no action on update no action -); --- --- table structure for table fn_menu_functional_roles --- -create table fn_menu_functional_roles ( - id int(11) not null auto_increment, - menu_id int(11) not null, - app_id int(11) not null, - role_id int(10) not null, - primary key (id), - key fk_fn_menu_func_roles_menu_id_idx (menu_id), - key fk_fn_menu_func_roles_app_id_idx (app_id), - key fk_fn_menu_func_roles_role_id_idx (role_id), - constraint fk_fn_menu_func_roles_app_id foreign key (app_id) references fn_app (app_id) on delete no action on update no action, - constraint fk_fn_menu_func_roles_menu_id foreign key (menu_id) references fn_menu_functional (menu_id) on delete no action on update no action, - constraint fk_fn_menu_func_roles_role_id foreign key (role_id) references fn_role (role_id) on delete no action on update no action -); --- ---------------------------------------------------------- --- NAME: FN_WORKFLOW; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_workflow ( - id mediumint(9) not null auto_increment, - name varchar(20) not null, - description varchar(500) default null, - run_link varchar(300) default null, - suspend_link varchar(300) default null, - modified_link varchar(300) default null, - active_yn varchar(300) default null, - created varchar(300) default null, - created_by int(11) default null, - modified varchar(300) default null, - modified_by int(11) default null, - workflow_key varchar(50) default null, - primary key (id), - UNIQUE KEY name (name) -); - - --- ---------------------------------------------------------- --- NAME: FN_SCHEDULE_WORKFLOWS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_schedule_workflows ( - id_schedule_workflows bigint(25) primary key not null auto_increment, - workflow_server_url varchar(45) default null, - workflow_key varchar(45) not null, - workflow_arguments varchar(45) default null, - startDateTimeCron varchar(45) default null, - endDateTime TIMESTAMP default NOW(), - start_date_time TIMESTAMP default NOW(), - recurrence varchar(45) default null - ); - - --- ---------------------------------------------------------- --- NAME: FN_SHARED_CONTEXT; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_shared_context ( - id int(11) not null auto_increment, - create_time timestamp not null, - context_id character varying(64) not null, - ckey character varying(128) not null, - cvalue character varying(1024), - primary key (id), - UNIQUE KEY session_key (context_id, ckey) ); - - --- ---------------------------------------------------------- --- NAME: FN_QZ_JOB_DETAILS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_job_details ( -SCHED_NAME VARCHAR(120) not null, -JOB_NAME VARCHAR(200) not null, -JOB_GROUP VARCHAR(200) not null, -DESCRIPTION VARCHAR(250) null, -JOB_CLASS_NAME VARCHAR(250) not null, -IS_DURABLE VARCHAR(1) not null, -IS_NONCONCURRENT VARCHAR(1) not null, -IS_UPDATE_DATA VARCHAR(1) not null, -REQUESTS_RECOVERY VARCHAR(1) not null, -JOB_DATA BLOB null, -primary key (SCHED_NAME,JOB_NAME,JOB_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_triggers ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -JOB_NAME VARCHAR(200) not null, -JOB_GROUP VARCHAR(200) not null, -DESCRIPTION VARCHAR(250) null, -NEXT_FIRE_TIME BIGINT(13) null, -PREV_FIRE_TIME BIGINT(13) null, -PRIORITY INTEGER null, -TRIGGER_STATE VARCHAR(16) not null, -TRIGGER_TYPE VARCHAR(8) not null, -START_TIME BIGINT(13) not null, -END_TIME BIGINT(13) null, -CALENDAR_NAME VARCHAR(200) null, -MISFIRE_INSTR SMALLINT(2) null, -JOB_DATA BLOB null, -primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) -REFERENCES FN_QZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_SIMPLE_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_simple_triggers ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -REPEAT_COUNT BIGINT(7) not null, -REPEAT_INTERVAL BIGINT(12) not null, -TIMES_TRIGGERED BIGINT(10) not null, -primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_CRON_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_cron_triggers ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -CRON_EXPRESSION VARCHAR(120) not null, -TIME_ZONE_ID VARCHAR(80), -primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_SIMPROP_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_simprop_triggers ( - SCHED_NAME VARCHAR(120) not null, - TRIGGER_NAME VARCHAR(200) not null, - TRIGGER_GROUP VARCHAR(200) not null, - STR_PROP_1 VARCHAR(512) null, - STR_PROP_2 VARCHAR(512) null, - STR_PROP_3 VARCHAR(512) null, - INT_PROP_1 INT null, - INT_PROP_2 INT null, - LONG_PROP_1 BIGINT null, - LONG_PROP_2 BIGINT null, - DEC_PROP_1 NUMERIC(13,4) null, - DEC_PROP_2 NUMERIC(13,4) null, - BOOL_PROP_1 VARCHAR(1) null, - BOOL_PROP_2 VARCHAR(1) null, - primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) - REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_BLOB_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_blob_triggers ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -BLOB_DATA BLOB null, -primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_CALENDARS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_calendars ( -SCHED_NAME VARCHAR(120) not null, -CALENDAR_NAME VARCHAR(200) not null, -CALENDAR BLOB not null, -primary key (SCHED_NAME,CALENDAR_NAME) -); - - --- ---------------------------------------------------------- --- NAME: FN_QZ_PAUSED_TRIGGER_GRPS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_paused_trigger_grps ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_GROUP VARCHAR(200) not null, -primary key (SCHED_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_FIRED_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_fired_triggers ( -SCHED_NAME VARCHAR(120) not null, -ENTRY_ID VARCHAR(95) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -INSTANCE_NAME VARCHAR(200) not null, -FIRED_TIME BIGINT(13) not null, -SCHED_TIME BIGINT(13) not null, -PRIORITY INTEGER not null, -STATE VARCHAR(16) not null, -JOB_NAME VARCHAR(200) null, -JOB_GROUP VARCHAR(200) null, -IS_NONCONCURRENT VARCHAR(1) null, -REQUESTS_RECOVERY VARCHAR(1) null, -primary key (SCHED_NAME,ENTRY_ID) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_SCHEDULER_STATE; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_scheduler_state ( -SCHED_NAME VARCHAR(120) not null, -INSTANCE_NAME VARCHAR(200) not null, -LAST_CHECKIN_TIME BIGINT(13) not null, -CHECKIN_INTERVAL BIGINT(13) not null, -primary key (SCHED_NAME,INSTANCE_NAME) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_LOCKS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_locks ( -SCHED_NAME VARCHAR(120) not null, -LOCK_NAME VARCHAR(40) not null, -primary key (SCHED_NAME,LOCK_NAME) -); - --- ---------------------------------------------------------- --- NAME: FN_MENU_FAVORITES; TYPE: TABLE --- ---------------------------------------------------------- - -create table fn_menu_favorites ( - user_id int(11) not null, - menu_id int(11) not null, - primary key (user_id,menu_id) -); - --- FACELIFT - Table for Events, News and Resources - -create table fn_common_widget_data( - id int auto_increment, - category varchar(32), - href varchar(512), - title varchar(256), - content varchar(4096), - event_date varchar(10), -- YYYY-MM-DD - sort_order int, - primary key (id) -); - -create table fn_app_contact_us ( - app_id int(11) not null, - contact_name varchar(128) default null, - contact_email varchar(128) default null, - url varchar(256) default null, - active_yn varchar(2) default null, - description varchar(1024) default null, - primary key (app_id), - constraint fk_fn_a_con__ref_202_fn_app foreign key (app_id) references fn_app (app_id) -); - --- new 1610.2 -create table fn_pers_user_app_sel ( - id int(11) not null auto_increment, - user_id int(11) not null, - app_id int(11) not null, - status_cd char(1) not null, - primary key(id), - constraint fk_1_fn_pers_user_app_sel_fn_user foreign key (user_id) references fn_user (user_id), - constraint fk_2_fn_pers_user_app_sel_fn_app foreign key (app_id) references fn_app (app_id) -); - --- end new 1610.2 - --- new 1702 tables/views - -- 1702 Additions for User Notifications - -- ---------------------------------------------------------- - -- NAME: ep_notification; TYPE: TABLE - -- ---------------------------------------------------------- - create table ep_notification ( - notification_ID int(11) primary key not null auto_increment, - is_for_online_users char(1) default 'N', - is_for_all_roles char(1) default 'N', - active_YN char(1) default 'Y', - msg_header varchar(100), - msg_description varchar(2000), - msg_source varchar(50) default 'EP', - start_time timestamp default now(), - end_time timestamp null, - priority int(11), - creator_ID int(11) null default null, - created_date timestamp null default null, - notification_hyperlink varchar(512) null default null -- new column for 1710 - ); - - -- ---------------------------------------------------------- - -- NAME: ep_role_notification; TYPE: TABLE - -- ---------------------------------------------------------- - create table ep_role_notification ( - ID int(11) primary key not null auto_increment, - notification_ID int(11), - role_ID int(11), - recv_user_id int(11) null, - constraint fk_ep_role_notif_fn_role foreign key (role_ID) references fn_role(role_id), - constraint fk_ep_role_notif_fn_notif foreign key (notification_ID) references ep_notification(notification_ID) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_user_notification; TYPE: TABLE - -- ---------------------------------------------------------- - create table ep_user_notification ( - ID int(11) primary key not null auto_increment, - User_ID int(11), - notification_ID int(11), - is_viewed char(1) default 'N', - updated_time timestamp default now(), - constraint fk_ep_urole_notif_fn_user foreign key (User_ID) references fn_user(user_id), - constraint fk_ep_urole_notif_fn_notif foreign key (notification_ID) references ep_notification(notification_ID) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_pers_user_app_sort; TYPE: Table - -- ---------------------------------------------------------- - - CREATE TABLE ep_pers_user_app_sort ( - id int(11) not null primary key auto_increment, - user_id int(11) not null, - sort_pref char(1) not null, - unique key uk_1_ep_pers_user_app_sort (user_id), - constraint fk_ep_pers_user_app_sort_fn_user foreign key (user_id) references fn_user(user_id) - ); - -- ---------------------------------------------------------- - -- NAME: ep_pers_user_app_man_sort; TYPE: Table - -- ---------------------------------------------------------- - - CREATE TABLE ep_pers_user_app_man_sort ( - id int(11) not null primary key auto_increment, - user_id int(11) not null, - app_id int(11) not null, - sort_order int(11) not null, - unique key uk_1_ep_pers_user_app_man_sort (user_id, app_id), - constraint fk_ep_pers_app_man_sort_fn_user foreign key (user_id) references fn_user(user_id), - constraint fk_ep_pers_app_man_sort_fn_app foreign key (app_id) references fn_app(app_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_catalog; TYPE: Table - -- ---------------------------------------------------------- - - CREATE TABLE ep_widget_catalog ( - widget_id int(11) not null auto_increment, - wdg_name varchar(100) not null default '?', - service_id int(11) default null, - wdg_desc varchar(200) default null, - wdg_file_loc varchar(256) not null default '?', - all_user_flag char(1) not null default 'N', - primary key (widget_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_catalog_role; TYPE: Table - -- ---------------------------------------------------------- - create table ep_widget_catalog_role ( - widget_id int(10) not null, - app_id int(11) default '1', - role_id int(10) not null, - key fk_ep_widget_catalog_role_fn_widget (widget_id), - key fk_ep_widget_catalog_role_ref_fn_role (role_id), - key fk_ep_widget_catalog_role_app_id (app_id), - constraint fk_ep_widget_catalog_role_fn_widget foreign key (widget_id) references ep_widget_catalog (widget_id), - constraint fk_ep_widget_catalog_role_ref_fn_role foreign key (role_id) references fn_role (role_id), - constraint fk_ep_widget_catalog_role_app_id foreign key (app_id) references fn_app (app_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_pers_user_widget_placement; TYPE: Table - -- ---------------------------------------------------------- - CREATE TABLE ep_pers_user_widget_placement ( - id int(11) not null primary key auto_increment, - user_id int(11) not null, - widget_id int(11) not null, - x int(11) not null, - y int(11), - height int(11), - width int(11), - unique key uk_1_ep_pers_user_widg_place (user_id, widget_id), - constraint fk_ep_pers_user_widg_place_fn_user foreign key (user_id) references fn_user(user_id), - constraint fk_ep_pers_user_widg_place_ep_widg foreign key (widget_id) references ep_widget_catalog(widget_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_pers_user_widget_sel; TYPE: TABLE - -- ---------------------------------------------------------- - CREATE TABLE ep_pers_user_widget_sel ( - id int(11) not null primary key auto_increment, - user_id int(11) not null, - widget_id int(11) not null, - status_cd char(1) not null, - unique key uk_1_ep_pers_user_widg_sel_user_widg (user_id, widget_id), - CONSTRAINT fk_1_ep_pers_user_wid_sel_fn_user FOREIGN KEY (user_id) REFERENCES fn_user (user_id), - CONSTRAINT fk_2_ep_pers_user_wid_sel_ep_wid FOREIGN KEY (widget_id) REFERENCES ep_widget_catalog (widget_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_catalog_files; TYPE: TABLE - -- ---------------------------------------------------------- - CREATE TABLE ep_widget_catalog_files ( - file_id int(11) not null primary key auto_increment, - widget_id int(11), - widget_name VARCHAR(100) NOT NULL, - framework_js LONGBLOB NULL, - controller_js LONGBLOB NULL, - markup_html LONGBLOB NULL, - widget_css LONGBLOB NULL - ); - - -- ---------------------------------------------------------- - -- NAME: fn_role_v; TYPE: VIEW - -- All roles without an APP_ID are Portal only. - -- ---------------------------------------------------------- - create view fn_role_v as - select fn_role.role_id as role_id, - fn_role.role_name as role_name, - fn_role.active_yn as active_yn, - fn_role.priority as priority, - fn_role.app_id as app_id, - fn_role.app_role_id as app_role_id - from fn_role where isnull(fn_role.app_id); - --- end new 1702 tables/views - --- new 1707 tables/views - - -- ---------------------------------------------------------- - -- NAME: ep_user_roles_request; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_user_roles_request ( - req_id int(11) not null primary key auto_increment, - user_id int(11) not null, - app_id int(11) not null, - created_date timestamp default now(), - updated_date timestamp default now(), - request_status character varying(50) not null, - constraint fk_user_roles_req_fn_user foreign key (user_id) references fn_user(user_id), - constraint fk_user_roles_req_fn_app foreign key (app_id) references fn_app(app_id) - ); - - - -- ---------------------------------------------------------- - -- NAME: ep_user_roles_request_det; TYPE: TABLE - -- ---------------------------------------------------------- -create table ep_user_roles_request_det ( - id int(11) not null primary key auto_increment, - req_id int(11) default null, - requested_role_id int(10) not null, - request_type character varying(10) not null, - constraint fk_user_roles_req_fn_req_id foreign key (req_id) references ep_user_roles_request(req_id), - constraint fk_user_roles_req_fn_role_id foreign key (requested_role_id) references fn_role(role_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_microservice; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_microservice ( - id INT(11) NOT NULL AUTO_INCREMENT, - name VARCHAR(50) NULL DEFAULT NULL, - description VARCHAR(50) NULL DEFAULT NULL, - appId INT(11) NULL DEFAULT NULL, - endpoint_url VARCHAR(200) NULL DEFAULT NULL, - security_type VARCHAR(50) NULL DEFAULT NULL, - username VARCHAR(50) NULL DEFAULT NULL, - password VARCHAR(50) NULL DEFAULT NULL, - active CHAR(1) NOT NULL DEFAULT 'Y', - PRIMARY KEY (id), - CONSTRAINT FK_FN_APP_EP_MICROSERVICE FOREIGN KEY (appId) REFERENCES fn_app (app_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_microservice_parameter; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_microservice_parameter ( - id INT(11) NOT NULL AUTO_INCREMENT, - service_id INT(11) NULL DEFAULT NULL, - para_key VARCHAR(50) NULL DEFAULT NULL, - para_value VARCHAR(50) NULL DEFAULT NULL, - PRIMARY KEY (id), - CONSTRAINT FK_EP_MICROSERIVCE_EP_MICROSERVICE_PARAMETER FOREIGN KEY (service_id) REFERENCES ep_microservice (id) -); - - - -- ---------------------------------------------------------- - -- NAME: ep_widget_preview_files; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_widget_preview_files ( - preview_id INT(11) NOT NULL AUTO_INCREMENT, - html_file LONGBLOB NULL, - css_file LONGBLOB NULL, - javascript_file LONGBLOB NULL, - framework_file LONGBLOB NULL, - PRIMARY KEY (preview_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_microservice; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_widget_microservice ( - id INT(11) NOT NULL AUTO_INCREMENT, - widget_id INT(11) NOT NULL DEFAULT '0', - microservice_id INT(11) NOT NULL DEFAULT '0', - PRIMARY KEY (id), - CONSTRAINT FK_EP_WIDGET_MICROSERVICE_EP_MICROSERVICE FOREIGN KEY (microservice_id) REFERENCES ep_microservice (id), - CONSTRAINT FK_EP_WIDGET_MICROSERVICE_EP_WIDGET FOREIGN KEY (widget_id) REFERENCES ep_widget_catalog (widget_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_basic_auth_account; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_basic_auth_account ( - id INT(11) NOT NULL AUTO_INCREMENT, - ext_app_name VARCHAR(50) NOT NULL, - username VARCHAR(50) NOT NULL, - password VARCHAR(50) null default null, - active_yn char(1) NOT NULL default 'Y', - PRIMARY KEY (id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_catalog_parameter; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_widget_catalog_parameter ( - id INT(11) NOT NULL AUTO_INCREMENT, - widget_id INT(11) NOT NULL, - user_id INT(11) NOT NULL, - param_id INT(11) NOT NULL, - user_value VARCHAR(50) NULL, - PRIMARY KEY (id), - CONSTRAINT EP_FN_USER_WIDGET_PARAMETER_FK FOREIGN KEY (user_id) REFERENCES fn_user (user_id), - CONSTRAINT EP_WIDGET_CATALOG_WIDGET_PARAMETER_FK FOREIGN KEY (widget_id) REFERENCES ep_widget_catalog (widget_id), - CONSTRAINT EP_PARAMETER_ID_WIDGET_PARAMETER_FK FOREIGN KEY (param_id) REFERENCES ep_microservice_parameter (id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_web_analytics_source; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_web_analytics_source( - resource_id int(11) NOT NULL auto_increment, - app_id int(11) NOT NULL, - report_source varchar(500), - report_name varchar(500), - PRIMARY KEY (resource_id), - FOREIGN KEY (app_id) REFERENCES fn_app(app_id) -); - - -- Machine Learning Tables - -- ---------------------------------------------------------- - -- NAME: ep_ml_model; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_ml_model( - time_stamp timestamp default now(), - group_id int(11) NOT NULL, - model longblob, - PRIMARY KEY (time_stamp,group_id) -); - -- ---------------------------------------------------------- - -- NAME: ep_ml_rec; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_ml_rec( - time_stamp timestamp default now(), - org_user_id varchar(20) NOT NULL, - rec varchar(4000) DEFAULT NULL, - PRIMARY KEY (time_stamp,org_user_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_ml_user; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_ml_user( - time_stamp timestamp default now(), - org_user_id varchar(20) NOT NULL, - group_id int(11) NOT NULL, - PRIMARY KEY (time_stamp,org_user_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_endpoints; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_endpoints ( - id INT(11) NOT NULL AUTO_INCREMENT, - url VARCHAR(50) NOT NULL, - PRIMARY KEY (id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_endpoints_basic_auth_account; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_endpoints_basic_auth_account ( - id INT(11) NOT NULL AUTO_INCREMENT, - ep_id INT(11) DEFAULT NULL, - account_id INT(11) DEFAULT NULL, - PRIMARY KEY (id), - CONSTRAINT ep_endpoints_basic_auth_account_account_id_fk FOREIGN KEY (account_id) REFERENCES ep_basic_auth_account (id), - CONSTRAINT ep_endpoints_basic_auth_account_ep_id_fk FOREIGN KEY (ep_id) REFERENCES ep_endpoints (id) - -); - --- end new 1707 tables/views - --- new 1710 tables/views - - -- ---------------------------------------------------------- - -- NAME: ep_app_function; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_app_function ( -app_id INT(11) NOT NULL, -function_cd VARCHAR(250) NOT NULL, -function_name VARCHAR(500) NOT NULL, -PRIMARY KEY (function_cd, app_id), -INDEX fk_ep_app_function_app_id (app_id), -CONSTRAINT fk_ep_app_function_app_id FOREIGN KEY (app_id) REFERENCES fn_app (app_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_app_role_function; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE `ep_app_role_function` ( -`id` INT(11) NOT NULL AUTO_INCREMENT, -`app_id` INT(11) NOT NULL, -`role_id` INT(11) NOT NULL, -`function_cd` VARCHAR(250) NOT NULL, -`role_app_id` VARCHAR(20) NULL DEFAULT NULL, -PRIMARY KEY (`id`), -UNIQUE INDEX `UNIQUE KEY` (`app_id`, `role_id`, `function_cd`), -CONSTRAINT `fk_ep_app_role_function_app_id` FOREIGN KEY (`app_id`) REFERENCES `fn_app` (`app_id`), -CONSTRAINT `fk_ep_app_role_function_ep_app_func` FOREIGN KEY (`app_id`, `function_cd`) REFERENCES `ep_app_function` (`app_id`, `function_cd`), -CONSTRAINT `fk_ep_app_role_function_role_id` FOREIGN KEY (`role_id`) REFERENCES `fn_role` (`role_id`) -); - --- end new 1710 tables/views - --- ---------------------------------------------------------- --- NAME: QUARTZ TYPE: INDEXES --- ---------------------------------------------------------- -create index idx_fn_qz_j_req_recovery on fn_qz_job_details(sched_name,requests_recovery); -create index idx_fn_qz_j_grp on fn_qz_job_details(sched_name,job_group); -create index idx_fn_qz_t_j on fn_qz_triggers(sched_name,job_name,job_group); -create index idx_fn_qz_t_jg on fn_qz_triggers(sched_name,job_group); -create index idx_fn_qz_t_c on fn_qz_triggers(sched_name,calendar_name); -create index idx_fn_qz_t_g on fn_qz_triggers(sched_name,trigger_group); -create index idx_fn_qz_t_state on fn_qz_triggers(sched_name,trigger_state); -create index idx_fn_qz_t_n_state on fn_qz_triggers(sched_name,trigger_name,trigger_group,trigger_state); -create index idx_fn_qz_t_n_g_state on fn_qz_triggers(sched_name,trigger_group,trigger_state); -create index idx_fn_qz_t_next_fire_time on fn_qz_triggers(sched_name,next_fire_time); -create index idx_fn_qz_t_nft_st on fn_qz_triggers(sched_name,trigger_state,next_fire_time); -create index idx_fn_qz_t_nft_misfire on fn_qz_triggers(sched_name,misfire_instr,next_fire_time); -create index idx_fn_qz_t_nft_st_misfire on fn_qz_triggers(sched_name,misfire_instr,next_fire_time,trigger_state); -create index idx_fn_qz_t_nft_st_misfire_grp on fn_qz_triggers(sched_name,misfire_instr,next_fire_time,trigger_group,trigger_state); -create index idx_fn_qz_ft_trig_inst_name on fn_qz_fired_triggers(sched_name,instance_name); -create index idx_fn_qz_ft_inst_job_req_rcvry on fn_qz_fired_triggers(sched_name,instance_name,requests_recovery); -create index idx_fn_qz_ft_j_g on fn_qz_fired_triggers(sched_name,job_name,job_group); -create index idx_fn_qz_ft_jg on fn_qz_fired_triggers(sched_name,job_group); -create index idx_fn_qz_ft_t_g on fn_qz_fired_triggers(sched_name,trigger_name,trigger_group); -create index idx_fn_qz_ft_tg on fn_qz_fired_triggers(sched_name,trigger_group); - - --- ------------------ create view section --- --- name: v_url_access; type: view --- -create view v_url_access as - select distinct m.action as url, - m.function_cd - from fn_menu m - where (m.action is not null) -union - select distinct t.action as url, - t.function_cd - from fn_tab t - where (t.action is not null) -union - select r.restricted_url as url, - r.function_cd - from fn_restricted_url r; - --- ------------------ alter table add constraint primary key section --- --- name: cr_favorite_reports_user_idrep_id; type: constraint --- -alter table cr_favorite_reports - add constraint cr_favorite_reports_user_idrep_id primary key (user_id, rep_id); --- --- name: cr_folder_folder_id; type: constraint --- -alter table cr_folder - add constraint cr_folder_folder_id primary key (folder_id); --- --- name: cr_folder_access_folder_access_id; type: constraint --- -alter table cr_folder_access - add constraint cr_folder_access_folder_access_id primary key (folder_access_id); --- --- name: cr_hist_user_map_hist_iduser_id; type: constraint --- -alter table cr_hist_user_map - add constraint cr_hist_user_map_hist_iduser_id primary key (hist_id, user_id); --- --- name: cr_lu_file_type_lookup_id; type: constraint --- -alter table cr_lu_file_type - add constraint cr_lu_file_type_lookup_id primary key (lookup_id); --- --- name: cr_raptor_action_img_image_id; type: constraint --- -alter table cr_raptor_action_img - add constraint cr_raptor_action_img_image_id primary key (image_id); --- --- name: cr_raptor_pdf_img_image_id; type: constraint --- -alter table cr_raptor_pdf_img - add constraint cr_raptor_pdf_img_image_id primary key (image_id); --- --- name: cr_remote_schema_info_schema_prefix; type: constraint --- -alter table cr_remote_schema_info - add constraint cr_remote_schema_info_schema_prefix primary key (schema_prefix); --- --- name: cr_report_rep_id; type: constraint --- -alter table cr_report - add constraint cr_report_rep_id primary key (rep_id); --- --- name: cr_report_access_rep_idorder_no; type: constraint --- -alter table cr_report_access - add constraint cr_report_access_rep_idorder_no primary key (rep_id, order_no); --- --- name: cr_report_email_sent_log_log_id; type: constraint --- -alter table cr_report_email_sent_log - add constraint cr_report_email_sent_log_log_id primary key (log_id); --- --- name: cr_report_file_history_hist_id; type: constraint --- -alter table cr_report_file_history - add constraint cr_report_file_history_hist_id primary key (hist_id); --- --- name: cr_report_schedule_schedule_id; type: constraint --- -alter table cr_report_schedule - add constraint cr_report_schedule_schedule_id primary key (schedule_id); --- --- name: cr_report_schedule_users_schedule_idrep_iduser_idorder_no; type: constraint --- -alter table cr_report_schedule_users - add constraint cr_report_schedule_users_schedule_idrep_iduser_idorder_no primary key (schedule_id, rep_id, user_id, order_no); --- --- name: cr_report_template_map_report_id; type: constraint --- -alter table cr_report_template_map - add constraint cr_report_template_map_report_id primary key (report_id); --- --- name: cr_table_role_table_namerole_id; type: constraint --- -alter table cr_table_role - add constraint cr_table_role_table_namerole_id primary key (table_name, role_id); --- --- name: cr_table_source_table_name; type: constraint --- -alter table cr_table_source - add constraint cr_table_source_table_name primary key (table_name); --- --- name: fn_audit_action_audit_action_id; type: constraint --- -alter table fn_audit_action - add constraint fn_audit_action_audit_action_id primary key (audit_action_id); --- --- --- name: fk_fn_audit_ref_205_fn_lu_ac; type: constraint --- -alter table fn_audit_log - add constraint fk_fn_audit_ref_205_fn_lu_ac foreign key (activity_cd) references fn_lu_activity(activity_cd); --- --- name: fk_fn_role__ref_201_fn_funct; type: constraint --- -alter table fn_role_function - add constraint fk_fn_role__ref_201_fn_funct foreign key (function_cd) references fn_function(function_cd); --- --- name: fn_chat_logs_chat_log_id; type: constraint --- -alter table fn_chat_logs - add constraint fn_chat_logs_chat_log_id primary key (chat_log_id); --- --- name: fn_chat_room_chat_room_id; type: constraint --- -alter table fn_chat_room - add constraint fn_chat_room_chat_room_id primary key (chat_room_id); --- --- name: fn_chat_users_id; type: constraint --- -alter table fn_chat_users - add constraint fn_chat_users_id primary key (id); --- --- name: fn_lu_alert_method_alert_method_cd; type: constraint --- -alter table fn_lu_alert_method - add constraint fn_lu_alert_method_alert_method_cd primary key (alert_method_cd); --- --- name: fn_lu_broadcast_site_broadcast_site_cd; type: constraint --- -alter table fn_lu_broadcast_site - add constraint fn_lu_broadcast_site_broadcast_site_cd primary key (broadcast_site_cd); --- --- name: fn_lu_priority_priority_id; type: constraint --- -alter table fn_lu_priority - add constraint fn_lu_priority_priority_id primary key (priority_id); --- --- name: fn_lu_role_type_role_type_id; type: constraint --- -alter table fn_lu_role_type - add constraint fn_lu_role_type_role_type_id primary key (role_type_id); --- --- name: fn_lu_tab_set_tab_set_cd; type: constraint --- -alter table fn_lu_tab_set - add constraint fn_lu_tab_set_tab_set_cd primary key (tab_set_cd); --- --- name: fn_lu_timezone_timezone_id; type: constraint --- -alter table fn_lu_timezone - add constraint fn_lu_timezone_timezone_id primary key (timezone_id); --- --- name: fn_org_org_id; type: constraint --- -alter table fn_org - add constraint fn_org_org_id primary key (org_id); --- --- name: fn_restricted_url_restricted_urlfunction_cd; type: constraint --- -alter table fn_restricted_url - add constraint fn_restricted_url_restricted_urlfunction_cd primary key (restricted_url, function_cd); --- --- name: fn_role_composite_parent_role_idchild_role_id; type: constraint --- -alter table fn_role_composite - add constraint fn_role_composite_parent_role_idchild_role_id primary key (parent_role_id, child_role_id); --- --- name: fn_role_function_role_idfunction_cd; type: constraint --- -alter table fn_role_function - add constraint fn_role_function_role_idfunction_cd primary key (role_id, function_cd); --- --- name: fn_tab_tab_cd; type: constraint --- -alter table fn_tab - add constraint fn_tab_tab_cd primary key (tab_cd); --- --- name: fn_tab_selected_selected_tab_cdtab_uri; type: constraint --- -alter table fn_tab_selected - add constraint fn_tab_selected_selected_tab_cdtab_uri primary key (selected_tab_cd, tab_uri); --- --- name: fn_user_pseudo_role_pseudo_role_iduser_id; type: constraint --- -alter table fn_user_pseudo_role - add constraint fn_user_pseudo_role_pseudo_role_iduser_id primary key (pseudo_role_id, user_id); --- --- name: fn_user_role_user_idrole_id; type: constraint --- -alter table fn_user_role - add constraint fn_user_role_user_idrole_id primary key (user_id, role_id, app_id); --- ------------------ create index section --- --- name: cr_report_create_idpublic_yntitle; type: index --- -create index cr_report_create_idpublic_yntitle using btree on cr_report (create_id, public_yn, title); --- --- name: cr_table_join_dest_table_name; type: index --- -create index cr_table_join_dest_table_name using btree on cr_table_join (dest_table_name); --- --- name: cr_table_join_src_table_name; type: index --- -create index cr_table_join_src_table_name using btree on cr_table_join (src_table_name); --- --- name: fn_audit_log_activity_cd; type: index --- -create index fn_audit_log_activity_cd using btree on fn_audit_log (activity_cd); --- --- name: fn_audit_log_user_id; type: index --- -create index fn_audit_log_user_id using btree on fn_audit_log (user_id); --- --- name: fn_org_access_cd; type: index --- -create index fn_org_access_cd using btree on fn_org (access_cd); --- --- name: fn_role_function_function_cd; type: index --- -create index fn_role_function_function_cd using btree on fn_role_function (function_cd); --- --- name: fn_role_function_role_id; type: index --- -create index fn_role_function_role_id using btree on fn_role_function (role_id); --- --- name: fn_user_address_id; type: index --- -create index fn_user_address_id using btree on fn_user (address_id); --- --- name: fn_user_alert_method_cd; type: index --- -create index fn_user_alert_method_cd using btree on fn_user (alert_method_cd); --- --- name: fn_user_hrid; type: index --- -create unique index fn_user_hrid using btree on fn_user (hrid); --- --- name: fn_user_login_id; type: index --- -create unique index fn_user_login_id using btree on fn_user (login_id); --- --- name: fn_user_org_id; type: index --- -create index fn_user_org_id using btree on fn_user (org_id); --- --- name: fn_user_role_role_id; type: index --- -create index fn_user_role_role_id using btree on fn_user_role (role_id); --- --- name: fn_user_role_user_id; type: index --- -create index fn_user_role_user_id using btree on fn_user_role (user_id); --- --- name: fk_fn_user__ref_178_fn_app_idx; type: index --- -create index fk_fn_user__ref_178_fn_app_idx on fn_user_role (app_id); - -- - -- name: fn_role_name_app_id_idx; type: index - -- - create unique index fn_role_name_app_id_idx using btree on fn_role (role_name,app_id); - --- new for 1707 - -create index ep_notif_recv_user_id_idx using btree on ep_role_notification (recv_user_id); - --- end new for 1707 - --- ------------------ alter table add constraint foreign key section --- --- name: fk_fn_user__ref_178_fn_app; type: fk constraint --- -alter table fn_user_role - add constraint fk_fn_user__ref_178_fn_app foreign key (app_id) references fn_app(app_id); --- --- name: fk_cr_repor_ref_14707_cr_repor; type: fk constraint --- -alter table cr_report_schedule - add constraint fk_cr_repor_ref_14707_cr_repor foreign key (rep_id) references cr_report(rep_id); --- --- name: fk_cr_repor_ref_14716_cr_repor; type: fk constraint --- -alter table cr_report_schedule_users - add constraint fk_cr_repor_ref_14716_cr_repor foreign key (schedule_id) references cr_report_schedule(schedule_id); --- --- name: fk_cr_repor_ref_17645_cr_repor; type: fk constraint --- -alter table cr_report_log - add constraint fk_cr_repor_ref_17645_cr_repor foreign key (rep_id) references cr_report(rep_id); --- --- name: fk_cr_repor_ref_8550_cr_repor; type: fk constraint --- -alter table cr_report_access - add constraint fk_cr_repor_ref_8550_cr_repor foreign key (rep_id) references cr_report(rep_id); --- --- name: fk_cr_report_rep_id; type: fk constraint --- -alter table cr_report_email_sent_log - add constraint fk_cr_report_rep_id foreign key (rep_id) references cr_report(rep_id); --- --- name: fk_cr_table_ref_311_cr_tab; type: fk constraint --- -alter table cr_table_join - add constraint fk_cr_table_ref_311_cr_tab foreign key (src_table_name) references cr_table_source(table_name); --- --- name: fk_cr_table_ref_315_cr_tab; type: fk constraint --- -alter table cr_table_join - add constraint fk_cr_table_ref_315_cr_tab foreign key (dest_table_name) references cr_table_source(table_name); --- --- name: fk_cr_table_ref_32384_cr_table; type: fk constraint --- -alter table cr_table_role - add constraint fk_cr_table_ref_32384_cr_table foreign key (table_name) references cr_table_source(table_name); --- --- name: fk_fn_tab_function_cd; type: fk constraint --- -alter table fn_tab - add constraint fk_fn_tab_function_cd foreign key (function_cd) references fn_function(function_cd); --- --- name: fk_fn_tab_selected_tab_cd; type: fk constraint --- -alter table fn_tab_selected - add constraint fk_fn_tab_selected_tab_cd foreign key (selected_tab_cd) references fn_tab(tab_cd); --- --- name: fk_fn_tab_set_cd; type: fk constraint --- -alter table fn_tab - add constraint fk_fn_tab_set_cd foreign key (tab_set_cd) references fn_lu_tab_set(tab_set_cd); --- --- name: fk_fn_user_ref_110_fn_org; type: fk constraint --- -alter table fn_user - add constraint fk_fn_user_ref_110_fn_org foreign key (org_id) references fn_org(org_id); --- --- name: fk_fn_user_ref_123_fn_lu_al; type: fk constraint --- -alter table fn_user - add constraint fk_fn_user_ref_123_fn_lu_al foreign key (alert_method_cd) references fn_lu_alert_method(alert_method_cd); --- --- name: fk_fn_user_ref_197_fn_user; type: fk constraint --- - alter table fn_user - add constraint fk_fn_user_ref_197_fn_user foreign key (manager_id) references fn_user(user_id); --- --- name: fk_fn_user_ref_198_fn_user; type: fk constraint --- -alter table fn_user - add constraint fk_fn_user_ref_198_fn_user foreign key (created_id) references fn_user(user_id); --- --- name: fk_fn_user_ref_199_fn_user; type: fk constraint --- -alter table fn_user - add constraint fk_fn_user_ref_199_fn_user foreign key (modified_id) references fn_user(user_id); --- --- name: fk_parent_key_cr_folder; type: fk constraint --- -alter table cr_folder - add constraint fk_parent_key_cr_folder foreign key (parent_folder_id) references cr_folder(folder_id); --- --- name: fk_pseudo_role_pseudo_role_id; type: fk constraint --- -alter table fn_user_pseudo_role - add constraint fk_pseudo_role_pseudo_role_id foreign key (pseudo_role_id) references fn_role(role_id); --- --- name: fk_pseudo_role_user_id; type: fk constraint --- -alter table fn_user_pseudo_role - add constraint fk_pseudo_role_user_id foreign key (user_id) references fn_user(user_id); --- --- name: fk_restricted_url_function_cd; type: fk constraint --- -alter table fn_restricted_url - add constraint fk_restricted_url_function_cd foreign key (function_cd) references fn_function(function_cd); --- --- name: fk_timezone; type: fk constraint --- -alter table fn_user - add constraint fk_timezone foreign key (timezone) references fn_lu_timezone(timezone_id); --- --- name: sys_c0014614; type: fk constraint --- -alter table cr_report_file_history - add constraint sys_c0014614 foreign key (file_type_id) references cr_lu_file_type(lookup_id); --- --- name: sys_c0014615; type: fk constraint --- -alter table cr_report_file_history - add constraint sys_c0014615 foreign key (rep_id) references cr_report(rep_id); --- --- name: sys_c0014616; type: fk constraint --- -alter table cr_hist_user_map - add constraint sys_c0014616 foreign key (hist_id) references cr_report_file_history(hist_id); --- --- name: sys_c0014617; type: fk constraint --- -alter table cr_hist_user_map - add constraint sys_c0014617 foreign key (user_id) references fn_user(user_id); --- --- name: sys_c0014618; type: fk constraint --- -alter table fn_menu_favorites -add constraint sys_c0014618 foreign key (user_id) references fn_user(user_id); - --- --- name: sys_c0014619; type: fk constraint --- -alter table fn_menu_favorites -add constraint sys_c0014619 foreign key (menu_id) references fn_menu_functional(menu_id); - -commit; diff --git a/ecomp-portal-DB-common/PortalDDLMySql_2_6_Common.sql b/ecomp-portal-DB-common/PortalDDLMySql_2_6_Common.sql deleted file mode 100644 index 1bf10c6c..00000000 --- a/ecomp-portal-DB-common/PortalDDLMySql_2_6_Common.sql +++ /dev/null @@ -1,1779 +0,0 @@ --- --------------------------------------------------------------------------------------------------------------- --- This is the 2.1.0 version of Portal database called portal - --- note to : database admin, set the mysql system variable called lower_case_table_names --- it can be set 3 different ways: --- command-line options (cmd-line), --- options valid in configuration files (option file), or --- server system variables (system var). - --- it needs to be set to 1, then table names are stored in lowercase on disk and comparisons are not case sensitive. --- ----------------------------------------------------------------------------------------------------------------- -set foreign_key_checks=1; - -SET GLOBAL character_set_client = utf8; -SET GLOBAL character_set_connection = utf8; -SET GLOBAL character_set_database = utf8; -SET GLOBAL character_set_results = utf8; -SET GLOBAL character_set_server = utf8; - -create database portal; - -use portal; - --- ------------------ create table section --- --- name: cr_favorite_reports; type: table --- -create table cr_favorite_reports ( - user_id integer not null, - rep_id integer not null -); --- --- name: cr_filehist_log; type: table --- -create table cr_filehist_log ( - schedule_id numeric(11,0) not null, - url character varying(4000), - notes character varying(3500), - run_time timestamp -); --- --- name: cr_folder; type: table --- -create table cr_folder ( - folder_id integer not null, - folder_name character varying(50) not null, - descr character varying(500), - create_id integer not null, - create_date timestamp not null, - parent_folder_id integer, - public_yn character varying(1) default 'n' not null -); --- --- name: cr_folder_access; type: table --- -create table cr_folder_access ( - folder_access_id numeric(11,0) not null, - folder_id numeric(11,0) not null, - order_no numeric(11,0) not null, - role_id numeric(11,0), - user_id numeric(11,0), - read_only_yn character varying(1) default 'n' not null -); --- --- name: cr_hist_user_map; type: table --- -create table cr_hist_user_map ( - hist_id int(11) not null, - user_id int(11) not null -); --- --- name: cr_lu_file_type; type: table --- -create table cr_lu_file_type ( - lookup_id numeric(2,0) not null, - lookup_descr character varying(255) not null, - active_yn character(1) default 'y', - error_code numeric(11,0) -); --- --- name: cr_raptor_action_img; type: table --- -create table cr_raptor_action_img ( - image_id character varying(100) not null, - image_loc character varying(400) -); --- --- name: cr_raptor_pdf_img; type: table --- -create table cr_raptor_pdf_img ( - image_id character varying(100) not null, - image_loc character varying(400) -); --- --- name: cr_remote_schema_info; type: table --- -create table cr_remote_schema_info ( - schema_prefix character varying(5) not null, - schema_desc character varying(75) not null, - datasource_type character varying(100) -); --- --- name: cr_report; type: table --- -create table cr_report ( - rep_id numeric(11,0) not null, - title character varying(100) not null, - descr character varying(255), - public_yn character varying(1) default 'n' not null, - report_xml text, - create_id numeric(11,0), - create_date timestamp default now(), - maint_id numeric(11,0), - maint_date timestamp default now(), - menu_id character varying(500), - menu_approved_yn character varying(1) default 'n' not null, - owner_id numeric(11,0), - folder_id integer default 0, - dashboard_type_yn character varying(1) default 'n', - dashboard_yn character varying(1) default 'n' -); --- --- name: cr_report_access; type: table --- -create table cr_report_access ( - rep_id numeric(11,0) not null, - order_no numeric(11,0) not null, - role_id numeric(11,0), - user_id numeric(11,0), - read_only_yn character varying(1) default 'n' not null -); --- --- name: cr_report_dwnld_log; type: table --- -create table cr_report_dwnld_log ( - user_id numeric(11,0) not null, - rep_id integer not null, - file_name character varying(100) not null, - dwnld_start_time timestamp default now() not null, - record_ready_time timestamp default now(), - filter_params character varying(2000) -); --- --- name: cr_report_email_sent_log; type: table --- -create table cr_report_email_sent_log ( - log_id integer not null, - schedule_id numeric(11,0), - gen_key character varying(25) not null, - rep_id numeric(11,0) not null, - user_id numeric(11,0), - sent_date timestamp default now(), - access_flag character varying(1) default 'y' not null, - touch_date timestamp default now() -); --- --- name: cr_report_file_history; type: table --- -create table cr_report_file_history ( - hist_id int(11) not null, - sched_user_id numeric(11,0) not null, - schedule_id numeric(11,0) not null, - user_id numeric(11,0) not null, - rep_id numeric(11,0), - run_date timestamp, - recurrence character varying(50), - file_type_id numeric(2,0), - file_name character varying(80), - file_blob blob, - file_size numeric(11,0), - raptor_url character varying(4000), - error_yn character(1) default 'n', - error_code numeric(11,0), - deleted_yn character(1) default 'n', - deleted_by numeric(38,0) -); --- --- name: cr_report_log; type: table --- -create table cr_report_log ( - rep_id numeric(11,0) not null, - log_time timestamp not null, - user_id numeric(11,0) not null, - action character varying(2000) not null, - action_value character varying(50), - form_fields character varying(4000) -); --- --- name: cr_report_schedule; type: table --- -create table cr_report_schedule ( - schedule_id numeric(11,0) not null, - sched_user_id numeric(11,0) not null, - rep_id numeric(11,0) not null, - enabled_yn character varying(1) not null, - start_date timestamp default now(), - end_date timestamp default now(), - run_date timestamp default now(), - recurrence character varying(50), - conditional_yn character varying(1) not null, - condition_sql character varying(4000), - notify_type integer default 0, - max_row integer default 1000, - initial_formfields character varying(3500), - processed_formfields character varying(3500), - formfields character varying(3500), - condition_large_sql text, - encrypt_yn character(1) default 'n', - attachment_yn character(1) default 'y' -); --- --- name: cr_report_schedule_users; type: table --- -create table cr_report_schedule_users ( - schedule_id numeric(11,0) not null, - rep_id numeric(11,0) not null, - user_id numeric(11,0) not null, - role_id numeric(11,0), - order_no numeric(11,0) not null -); --- --- name: cr_report_template_map; type: table --- -create table cr_report_template_map ( - report_id integer not null, - template_file character varying(200) -); --- --- name: cr_schedule_activity_log; type: table --- -create table cr_schedule_activity_log ( - schedule_id numeric(11,0) not null, - url character varying(4000), - notes character varying(2000), - run_time timestamp -); --- --- name: cr_table_join; type: table --- -create table cr_table_join ( - src_table_name character varying(30) not null, - dest_table_name character varying(30) not null, - join_expr character varying(500) not null -); --- --- name: cr_table_role; type: table --- -create table cr_table_role ( - table_name character varying(30) not null, - role_id numeric(11,0) not null -); --- --- name: cr_table_source; type: table --- -create table cr_table_source ( - table_name character varying(30) not null, - display_name character varying(30) not null, - pk_fields character varying(200), - web_view_action character varying(50), - large_data_source_yn character varying(1) default 'n' not null, - filter_sql character varying(4000), - source_db character varying(50) -); --- --- name: fn_lu_timezone; type: table --- -create table fn_lu_timezone ( - timezone_id int(11) not null, - timezone_name character varying(100) not null, - timezone_value character varying(100) not null -); - -create table fn_user ( - user_id int(11) not null primary key auto_increment, - org_id int(11), - manager_id int(11), - first_name character varying(50), - middle_name character varying(50), - last_name character varying(50), - phone character varying(25), - fax character varying(25), - cellular character varying(25), - email character varying(50), - address_id numeric(11,0), - alert_method_cd character varying(10), - hrid character varying(20), - org_user_id CHARACTER VARYING(60), - org_code character varying(30), - login_id character varying(60), - login_pwd character varying(100), - last_login_date timestamp, - active_yn character varying(1) default 'y' not null, - created_id int(11), - created_date timestamp default now(), - modified_id int(11), - modified_date timestamp default now(), - is_internal_yn character(1) default 'n' not null, - address_line_1 character varying(100), - address_line_2 character varying(100), - city character varying(50), - state_cd character varying(3), - zip_code character varying(11), - country_cd character varying(3), - location_clli character varying(8), - org_manager_userid CHARACTER VARYING(20), - company character varying(100), - department_name character varying(100), - job_title character varying(100), - timezone int(11), - department character varying(25), - business_unit character varying(25), - business_unit_name character varying(100), - cost_center character varying(25), - fin_loc_code character varying(10), - silo_status character varying(10), - is_system_user character(1) default 'N', - language_id int(2) default 1 -); - -create table fn_language( - language_id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, - language_name VARCHAR(100) NOT NULL, - language_alias VARCHAR(100) NOT NULL -); - -create table fn_display_text( - id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, - language_id int(11) NOT NULL, - text_id int(11) NOT NULL, - text_label VARCHAR(100) NOT NULL -); --- --- name: fn_role; type: table --- -create table fn_role ( - role_id int(11) not null primary key auto_increment, - role_name character varying(300) not null, - active_yn character varying(1) default 'y' not null, - priority numeric(4,0), - app_id int(11) default null, - app_role_id int(11) default null - -); --- --- name: fn_audit_action; type: table --- -create table fn_audit_action ( - audit_action_id integer not null, - class_name character varying(500) not null, - method_name character varying(50) not null, - audit_action_cd character varying(20) not null, - audit_action_desc character varying(200), - active_yn character varying(1) -); --- --- name: fn_audit_action_log; type: table --- -create table fn_audit_action_log ( - audit_log_id integer not null primary key auto_increment, - audit_action_cd character varying(200), - action_time timestamp, - user_id numeric(11,0), - class_name character varying(100), - method_name character varying(50), - success_msg character varying(20), - error_msg character varying(500) -); --- --- name: fn_lu_activity; type: table --- -create table fn_lu_activity ( - activity_cd character varying(50) not null primary key, - activity character varying(50) not null -); --- --- name: fn_audit_log; type: table --- -create table fn_audit_log ( - log_id int(11) not null primary key auto_increment, - user_id int(11) not null, - activity_cd character varying(50) not null, - audit_date timestamp default now() not null, - comments character varying(1000), - affected_record_id_bk character varying(500), - affected_record_id character varying(4000), - constraint fk_fn_audit_ref_209_fn_user foreign key (user_id) references fn_user(user_id) -); --- --- name: fn_broadcast_message; type: table --- -create table fn_broadcast_message ( - message_id int(11) not null primary key auto_increment, - message_text character varying(1000) not null, - message_location_id numeric(11,0) not null, - broadcast_start_date timestamp not null default now(), - broadcast_end_date timestamp not null default now(), - active_yn character(1) default 'y' not null, - sort_order numeric(4,0) not null, - broadcast_site_cd character varying(50) -); --- --- name: fn_chat_logs; type: table --- -create table fn_chat_logs ( - chat_log_id integer not null, - chat_room_id integer, - user_id integer, - message character varying(1000), - message_date_time timestamp -); --- --- name: fn_chat_room; type: table --- -create table fn_chat_room ( - chat_room_id integer not null, - name character varying(50) not null, - description character varying(500), - owner_id integer, - created_date timestamp default now(), - updated_date timestamp default now() -); --- --- name: fn_chat_users; type: table --- -create table fn_chat_users ( - chat_room_id integer, - user_id integer, - last_activity_date_time timestamp, - chat_status character varying(20), - id integer not null -); --- --- name: fn_datasource; type: table --- -create table fn_datasource ( - id integer not null primary key auto_increment, - name character varying(50), - driver_name character varying(256), - server character varying(256), - port integer, - user_name character varying(256), - password character varying(256), - url character varying(256), - min_pool_size integer, - max_pool_size integer, - adapter_id integer, - ds_type character varying(20) -); --- --- name: fn_function; type: table --- -create table fn_function ( - function_cd character varying(30) not null primary key, - function_name character varying(50) not null -); --- --- name: fn_lu_alert_method; type: table --- -create table fn_lu_alert_method ( - alert_method_cd character varying(10) not null, - alert_method character varying(50) not null -); --- --- name: fn_lu_broadcast_site; type: table --- -create table fn_lu_broadcast_site ( - broadcast_site_cd character varying(50) not null, - broadcast_site_descr character varying(100) -); --- --- name: fn_lu_menu_set; type: table --- -create table fn_lu_menu_set ( - menu_set_cd character varying(10) not null primary key, - menu_set_name character varying(50) not null -); --- --- name: fn_lu_priority; type: table --- -create table fn_lu_priority ( - priority_id numeric(11,0) not null, - priority character varying(50) not null, - active_yn character(1) not null, - sort_order numeric(5,0) -); --- --- name: fn_lu_role_type; type: table --- -create table fn_lu_role_type ( - role_type_id numeric(11,0) not null, - role_type character varying(50) not null -); --- --- name: fn_lu_tab_set; type: table --- -create table fn_lu_tab_set ( - tab_set_cd character varying(30) not null, - tab_set_name character varying(50) not null -); --- --- name: fn_menu; type: table --- -create table fn_menu ( - menu_id int(11) not null primary key auto_increment, - label character varying(100), - parent_id int(11), - sort_order numeric(4,0), - action character varying(200), - function_cd character varying(30), - active_yn character varying(1) default 'y' not null, - servlet character varying(50), - query_string character varying(200), - external_url character varying(200), - target character varying(25), - menu_set_cd character varying(10) default 'app', - separator_yn character(1) default 'n', - image_src character varying(100), - constraint fk_fn_menu_ref_196_fn_menu foreign key (parent_id) references fn_menu(menu_id), - constraint fk_fn_menu_menu_set_cd foreign key (menu_set_cd) references fn_lu_menu_set(menu_set_cd) -); - -create index idx_fn_menu_label on fn_menu(label); --- --- name: fn_org; type: table --- -create table fn_org ( - org_id int(11) not null, - org_name character varying(50) not null, - access_cd character varying(10) -); --- --- name: fn_restricted_url; type: table --- -create table fn_restricted_url ( - restricted_url character varying(250) not null, - function_cd character varying(30) not null -); --- --- name: fn_role_composite; type: table --- -create table fn_role_composite ( - parent_role_id int(11) not null, - child_role_id int(11) not null, - constraint fk_fn_role_composite_child foreign key (child_role_id) references fn_role(role_id), - constraint fk_fn_role_composite_parent foreign key (parent_role_id) references fn_role(role_id) -); --- --- name: fn_role_function; type: table --- -create table fn_role_function ( - role_id int(11) not null, - function_cd character varying(30) not null, - constraint fk_fn_role__ref_198_fn_role foreign key (role_id) references fn_role(role_id) -); --- --- name: fn_tab; type: table --- -create table fn_tab ( - tab_cd character varying(30) not null, - tab_name character varying(50) not null, - tab_descr character varying(100), - action character varying(100) not null, - function_cd character varying(30) not null, - active_yn character(1) not null, - sort_order numeric(11,0) not null, - parent_tab_cd character varying(30), - tab_set_cd character varying(30) -); --- --- name: fn_tab_selected; type: table --- -create table fn_tab_selected ( - selected_tab_cd character varying(30) not null, - tab_uri character varying(40) not null -); --- --- name: fn_user_pseudo_role; type: table --- -create table fn_user_pseudo_role ( - pseudo_role_id int(11) not null, - user_id int(11) not null -); --- --- name: fn_user_role; type: table --- -create table fn_user_role ( - user_id int(10) not null, - role_id int(10) not null, - priority numeric(4,0), - app_id int(11) default 2, - constraint fk_fn_user__ref_172_fn_user foreign key (user_id) references fn_user(user_id), - constraint fk_fn_user__ref_175_fn_role foreign key (role_id) references fn_role(role_id) -); --- --- name: schema_info; type: table --- -create table schema_info ( - SCHEMA_ID CHARACTER VARYING(25) not null, - SCHEMA_DESC CHARACTER VARYING(75) not null, - DATASOURCE_TYPE CHARACTER VARYING(100), - CONNECTION_URL VARCHAR(200) not null, - USER_NAME VARCHAR(45) not null, - PASSWORD VARCHAR(45) null default null, - DRIVER_CLASS VARCHAR(100) not null, - MIN_POOL_SIZE INT not null, - MAX_POOL_SIZE INT not null, - IDLE_CONNECTION_TEST_PERIOD INT not null - -); --- ---------------------------------------------------------- --- name: fn_app; type: table --- ---------------------------------------------------------- -create table fn_app ( - app_id int(11) primary key not null auto_increment, - app_name varchar(100) not null default '?', - app_image_url varchar(256) default null, - app_description varchar(512) default null, - app_notes varchar(4096) default null, - app_url varchar(256) default null, - app_alternate_url varchar(256) default null, - app_rest_endpoint varchar(2000) default null, - ml_app_name varchar(50) not null default '?', - ml_app_admin_id varchar(7) not null default '?', - mots_id int(11) default null, - app_password varchar(256) default null, - open char(1) default 'N', - enabled char(1) default 'Y', - thumbnail mediumblob null default null, - app_username varchar(50), - ueb_key varchar(256) default null, - ueb_secret varchar(256) default null, - ueb_topic_name varchar(256) default null, - app_type int(11) not null default 1, - auth_central char(1) not null default 'N', - auth_namespace varchar(100) null default null -); - --- ------------------ functional menu tables ------------------- --- --- table structure for table fn_menu_functional --- -create table fn_menu_functional ( - menu_id int(11) not null auto_increment, - column_num int(2) not null, - text varchar(100) not null, - parent_menu_id int(11) default null, - url varchar(128) not null default '', - active_yn varchar(1) not null default 'y', - image_src varchar(100) default null, - primary key (menu_id), - key fk_fn_menu_func_parent_menu_id_idx (parent_menu_id), - constraint fk_fn_menu_func_parent_menu_id foreign key (parent_menu_id) references fn_menu_functional (menu_id) on delete no action on update no action -); --- --- table structure for table fn_menu_functional_ancestors --- - -create table fn_menu_functional_ancestors ( - id int(11) not null auto_increment, - menu_id int(11) not null, - ancestor_menu_id int(11) not null, - depth int(2) not null, - primary key (id), - key fk_fn_menu_func_anc_menu_id_idx (menu_id), - key fk_fn_menu_func_anc_anc_menu_id_idx (ancestor_menu_id), - constraint fk_fn_menu_func_anc_anc_menu_id foreign key (ancestor_menu_id) references fn_menu_functional (menu_id) on delete no action on update no action, - constraint fk_fn_menu_func_anc_menu_id foreign key (menu_id) references fn_menu_functional (menu_id) on delete no action on update no action -); --- --- table structure for table fn_menu_functional_roles --- -create table fn_menu_functional_roles ( - id int(11) not null auto_increment, - menu_id int(11) not null, - app_id int(11) not null, - role_id int(10) not null, - primary key (id), - key fk_fn_menu_func_roles_menu_id_idx (menu_id), - key fk_fn_menu_func_roles_app_id_idx (app_id), - key fk_fn_menu_func_roles_role_id_idx (role_id), - constraint fk_fn_menu_func_roles_app_id foreign key (app_id) references fn_app (app_id) on delete no action on update no action, - constraint fk_fn_menu_func_roles_menu_id foreign key (menu_id) references fn_menu_functional (menu_id) on delete no action on update no action, - constraint fk_fn_menu_func_roles_role_id foreign key (role_id) references fn_role (role_id) on delete no action on update no action -); --- ---------------------------------------------------------- --- NAME: FN_WORKFLOW; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_workflow ( - id mediumint(9) not null auto_increment, - name varchar(20) not null, - description varchar(500) default null, - run_link varchar(300) default null, - suspend_link varchar(300) default null, - modified_link varchar(300) default null, - active_yn varchar(300) default null, - created varchar(300) default null, - created_by int(11) default null, - modified varchar(300) default null, - modified_by int(11) default null, - workflow_key varchar(50) default null, - primary key (id), - UNIQUE KEY name (name) -); - - --- ---------------------------------------------------------- --- NAME: FN_SCHEDULE_WORKFLOWS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_schedule_workflows ( - id_schedule_workflows bigint(25) primary key not null auto_increment, - workflow_server_url varchar(45) default null, - workflow_key varchar(45) not null, - workflow_arguments varchar(45) default null, - startDateTimeCron varchar(45) default null, - endDateTime TIMESTAMP default NOW(), - start_date_time TIMESTAMP default NOW(), - recurrence varchar(45) default null - ); - - --- ---------------------------------------------------------- --- NAME: FN_SHARED_CONTEXT; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_shared_context ( - id int(11) not null auto_increment, - create_time timestamp not null, - context_id character varying(64) not null, - ckey character varying(128) not null, - cvalue character varying(1024), - primary key (id), - UNIQUE KEY session_key (context_id, ckey) ); - - --- ---------------------------------------------------------- --- NAME: FN_QZ_JOB_DETAILS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_job_details ( -SCHED_NAME VARCHAR(120) not null, -JOB_NAME VARCHAR(200) not null, -JOB_GROUP VARCHAR(200) not null, -DESCRIPTION VARCHAR(250) null, -JOB_CLASS_NAME VARCHAR(250) not null, -IS_DURABLE VARCHAR(1) not null, -IS_NONCONCURRENT VARCHAR(1) not null, -IS_UPDATE_DATA VARCHAR(1) not null, -REQUESTS_RECOVERY VARCHAR(1) not null, -JOB_DATA BLOB null, -primary key (SCHED_NAME,JOB_NAME,JOB_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_triggers ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -JOB_NAME VARCHAR(200) not null, -JOB_GROUP VARCHAR(200) not null, -DESCRIPTION VARCHAR(250) null, -NEXT_FIRE_TIME BIGINT(13) null, -PREV_FIRE_TIME BIGINT(13) null, -PRIORITY INTEGER null, -TRIGGER_STATE VARCHAR(16) not null, -TRIGGER_TYPE VARCHAR(8) not null, -START_TIME BIGINT(13) not null, -END_TIME BIGINT(13) null, -CALENDAR_NAME VARCHAR(200) null, -MISFIRE_INSTR SMALLINT(2) null, -JOB_DATA BLOB null, -primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) -REFERENCES FN_QZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_SIMPLE_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_simple_triggers ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -REPEAT_COUNT BIGINT(7) not null, -REPEAT_INTERVAL BIGINT(12) not null, -TIMES_TRIGGERED BIGINT(10) not null, -primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_CRON_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_cron_triggers ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -CRON_EXPRESSION VARCHAR(120) not null, -TIME_ZONE_ID VARCHAR(80), -primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_SIMPROP_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_simprop_triggers ( - SCHED_NAME VARCHAR(120) not null, - TRIGGER_NAME VARCHAR(200) not null, - TRIGGER_GROUP VARCHAR(200) not null, - STR_PROP_1 VARCHAR(512) null, - STR_PROP_2 VARCHAR(512) null, - STR_PROP_3 VARCHAR(512) null, - INT_PROP_1 INT null, - INT_PROP_2 INT null, - LONG_PROP_1 BIGINT null, - LONG_PROP_2 BIGINT null, - DEC_PROP_1 NUMERIC(13,4) null, - DEC_PROP_2 NUMERIC(13,4) null, - BOOL_PROP_1 VARCHAR(1) null, - BOOL_PROP_2 VARCHAR(1) null, - primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), - FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) - REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_BLOB_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_blob_triggers ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -BLOB_DATA BLOB null, -primary key (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), -INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP), -FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_CALENDARS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_calendars ( -SCHED_NAME VARCHAR(120) not null, -CALENDAR_NAME VARCHAR(200) not null, -CALENDAR BLOB not null, -primary key (SCHED_NAME,CALENDAR_NAME) -); - - --- ---------------------------------------------------------- --- NAME: FN_QZ_PAUSED_TRIGGER_GRPS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_paused_trigger_grps ( -SCHED_NAME VARCHAR(120) not null, -TRIGGER_GROUP VARCHAR(200) not null, -primary key (SCHED_NAME,TRIGGER_GROUP) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_FIRED_TRIGGERS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_fired_triggers ( -SCHED_NAME VARCHAR(120) not null, -ENTRY_ID VARCHAR(95) not null, -TRIGGER_NAME VARCHAR(200) not null, -TRIGGER_GROUP VARCHAR(200) not null, -INSTANCE_NAME VARCHAR(200) not null, -FIRED_TIME BIGINT(13) not null, -SCHED_TIME BIGINT(13) not null, -PRIORITY INTEGER not null, -STATE VARCHAR(16) not null, -JOB_NAME VARCHAR(200) null, -JOB_GROUP VARCHAR(200) null, -IS_NONCONCURRENT VARCHAR(1) null, -REQUESTS_RECOVERY VARCHAR(1) null, -primary key (SCHED_NAME,ENTRY_ID) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_SCHEDULER_STATE; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_scheduler_state ( -SCHED_NAME VARCHAR(120) not null, -INSTANCE_NAME VARCHAR(200) not null, -LAST_CHECKIN_TIME BIGINT(13) not null, -CHECKIN_INTERVAL BIGINT(13) not null, -primary key (SCHED_NAME,INSTANCE_NAME) -); - --- ---------------------------------------------------------- --- NAME: FN_QZ_LOCKS; TYPE: TABLE --- ---------------------------------------------------------- -create table fn_qz_locks ( -SCHED_NAME VARCHAR(120) not null, -LOCK_NAME VARCHAR(40) not null, -primary key (SCHED_NAME,LOCK_NAME) -); - --- ---------------------------------------------------------- --- NAME: FN_MENU_FAVORITES; TYPE: TABLE --- ---------------------------------------------------------- - -create table fn_menu_favorites ( - user_id int(11) not null, - menu_id int(11) not null, - primary key (user_id,menu_id) -); - --- FACELIFT - Table for Events, News and Resources - -create table fn_common_widget_data( - id int auto_increment, - category varchar(32), - href varchar(512), - title varchar(256), - content varchar(4096), - event_date varchar(10), -- YYYY-MM-DD - sort_order int, - primary key (id) -); - -create table fn_app_contact_us ( - app_id int(11) not null, - contact_name varchar(128) default null, - contact_email varchar(128) default null, - url varchar(256) default null, - active_yn varchar(2) default null, - description varchar(1024) default null, - primary key (app_id), - constraint fk_fn_a_con__ref_202_fn_app foreign key (app_id) references fn_app (app_id) -); - --- new 1610.2 -create table fn_pers_user_app_sel ( - id int(11) not null auto_increment, - user_id int(11) not null, - app_id int(11) not null, - status_cd char(1) not null, - primary key(id), - constraint fk_1_fn_pers_user_app_sel_fn_user foreign key (user_id) references fn_user (user_id), - constraint fk_2_fn_pers_user_app_sel_fn_app foreign key (app_id) references fn_app (app_id) -); - --- end new 1610.2 - --- new 1702 tables/views - -- 1702 Additions for User Notifications - -- ---------------------------------------------------------- - -- NAME: ep_notification; TYPE: TABLE - -- ---------------------------------------------------------- - create table ep_notification ( - notification_ID int(11) primary key not null auto_increment, - is_for_online_users char(1) default 'N', - is_for_all_roles char(1) default 'N', - active_YN char(1) default 'Y', - msg_header varchar(100), - msg_description varchar(2000), - msg_source varchar(50) default 'EP', - start_time timestamp default now(), - end_time timestamp null, - priority int(11), - creator_ID int(11) null default null, - created_date timestamp null default null, - notification_hyperlink varchar(512) null default null -- new column for 1710 - ); - - -- ---------------------------------------------------------- - -- NAME: ep_role_notification; TYPE: TABLE - -- ---------------------------------------------------------- - create table ep_role_notification ( - ID int(11) primary key not null auto_increment, - notification_ID int(11), - role_ID int(11), - recv_user_id int(11) null, - constraint fk_ep_role_notif_fn_role foreign key (role_ID) references fn_role(role_id), - constraint fk_ep_role_notif_fn_notif foreign key (notification_ID) references ep_notification(notification_ID) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_user_notification; TYPE: TABLE - -- ---------------------------------------------------------- - create table ep_user_notification ( - ID int(11) primary key not null auto_increment, - User_ID int(11), - notification_ID int(11), - is_viewed char(1) default 'N', - updated_time timestamp default now(), - constraint fk_ep_urole_notif_fn_user foreign key (User_ID) references fn_user(user_id), - constraint fk_ep_urole_notif_fn_notif foreign key (notification_ID) references ep_notification(notification_ID) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_pers_user_app_sort; TYPE: Table - -- ---------------------------------------------------------- - - CREATE TABLE ep_pers_user_app_sort ( - id int(11) not null primary key auto_increment, - user_id int(11) not null, - sort_pref char(1) not null, - unique key uk_1_ep_pers_user_app_sort (user_id), - constraint fk_ep_pers_user_app_sort_fn_user foreign key (user_id) references fn_user(user_id) - ); - -- ---------------------------------------------------------- - -- NAME: ep_pers_user_app_man_sort; TYPE: Table - -- ---------------------------------------------------------- - - CREATE TABLE ep_pers_user_app_man_sort ( - id int(11) not null primary key auto_increment, - user_id int(11) not null, - app_id int(11) not null, - sort_order int(11) not null, - unique key uk_1_ep_pers_user_app_man_sort (user_id, app_id), - constraint fk_ep_pers_app_man_sort_fn_user foreign key (user_id) references fn_user(user_id), - constraint fk_ep_pers_app_man_sort_fn_app foreign key (app_id) references fn_app(app_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_catalog; TYPE: Table - -- ---------------------------------------------------------- - - CREATE TABLE ep_widget_catalog ( - widget_id int(11) not null auto_increment, - wdg_name varchar(100) not null default '?', - service_id int(11) default null, - wdg_desc varchar(200) default null, - wdg_file_loc varchar(256) not null default '?', - all_user_flag char(1) not null default 'N', - primary key (widget_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_catalog_role; TYPE: Table - -- ---------------------------------------------------------- - create table ep_widget_catalog_role ( - widget_id int(10) not null, - app_id int(11) default '1', - role_id int(10) not null, - key fk_ep_widget_catalog_role_fn_widget (widget_id), - key fk_ep_widget_catalog_role_ref_fn_role (role_id), - key fk_ep_widget_catalog_role_app_id (app_id), - constraint fk_ep_widget_catalog_role_fn_widget foreign key (widget_id) references ep_widget_catalog (widget_id), - constraint fk_ep_widget_catalog_role_ref_fn_role foreign key (role_id) references fn_role (role_id), - constraint fk_ep_widget_catalog_role_app_id foreign key (app_id) references fn_app (app_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_pers_user_widget_placement; TYPE: Table - -- ---------------------------------------------------------- - CREATE TABLE ep_pers_user_widget_placement ( - id int(11) not null primary key auto_increment, - user_id int(11) not null, - widget_id int(11) not null, - x int(11) not null, - y int(11), - height int(11), - width int(11), - unique key uk_1_ep_pers_user_widg_place (user_id, widget_id), - constraint fk_ep_pers_user_widg_place_fn_user foreign key (user_id) references fn_user(user_id), - constraint fk_ep_pers_user_widg_place_ep_widg foreign key (widget_id) references ep_widget_catalog(widget_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_pers_user_widget_sel; TYPE: TABLE - -- ---------------------------------------------------------- - CREATE TABLE ep_pers_user_widget_sel ( - id int(11) not null primary key auto_increment, - user_id int(11) not null, - widget_id int(11) not null, - status_cd char(1) not null, - unique key uk_1_ep_pers_user_widg_sel_user_widg (user_id, widget_id), - CONSTRAINT fk_1_ep_pers_user_wid_sel_fn_user FOREIGN KEY (user_id) REFERENCES fn_user (user_id), - CONSTRAINT fk_2_ep_pers_user_wid_sel_ep_wid FOREIGN KEY (widget_id) REFERENCES ep_widget_catalog (widget_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_catalog_files; TYPE: TABLE - -- ---------------------------------------------------------- - CREATE TABLE ep_widget_catalog_files ( - file_id int(11) not null primary key auto_increment, - widget_id int(11), - widget_name VARCHAR(100) NOT NULL, - framework_js LONGBLOB NULL, - controller_js LONGBLOB NULL, - markup_html LONGBLOB NULL, - widget_css LONGBLOB NULL - ); - - -- ---------------------------------------------------------- - -- NAME: fn_role_v; TYPE: VIEW - -- All roles without an APP_ID are Portal only. - -- ---------------------------------------------------------- - create view fn_role_v as - select fn_role.role_id as role_id, - fn_role.role_name as role_name, - fn_role.active_yn as active_yn, - fn_role.priority as priority, - fn_role.app_id as app_id, - fn_role.app_role_id as app_role_id - from fn_role where isnull(fn_role.app_id); - --- end new 1702 tables/views - --- new 1707 tables/views - - -- ---------------------------------------------------------- - -- NAME: ep_user_roles_request; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_user_roles_request ( - req_id int(11) not null primary key auto_increment, - user_id int(11) not null, - app_id int(11) not null, - created_date timestamp default now(), - updated_date timestamp default now(), - request_status character varying(50) not null, - constraint fk_user_roles_req_fn_user foreign key (user_id) references fn_user(user_id), - constraint fk_user_roles_req_fn_app foreign key (app_id) references fn_app(app_id) - ); - - - -- ---------------------------------------------------------- - -- NAME: ep_user_roles_request_det; TYPE: TABLE - -- ---------------------------------------------------------- -create table ep_user_roles_request_det ( - id int(11) not null primary key auto_increment, - req_id int(11) default null, - requested_role_id int(10) not null, - request_type character varying(10) not null, - constraint fk_user_roles_req_fn_req_id foreign key (req_id) references ep_user_roles_request(req_id), - constraint fk_user_roles_req_fn_role_id foreign key (requested_role_id) references fn_role(role_id) - ); - - -- ---------------------------------------------------------- - -- NAME: ep_microservice; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_microservice ( - id INT(11) NOT NULL AUTO_INCREMENT, - name VARCHAR(50) NULL DEFAULT NULL, - description VARCHAR(50) NULL DEFAULT NULL, - appId INT(11) NULL DEFAULT NULL, - endpoint_url VARCHAR(200) NULL DEFAULT NULL, - security_type VARCHAR(50) NULL DEFAULT NULL, - username VARCHAR(50) NULL DEFAULT NULL, - password VARCHAR(50) NULL DEFAULT NULL, - active CHAR(1) NOT NULL DEFAULT 'Y', - PRIMARY KEY (id), - CONSTRAINT FK_FN_APP_EP_MICROSERVICE FOREIGN KEY (appId) REFERENCES fn_app (app_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_microservice_parameter; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_microservice_parameter ( - id INT(11) NOT NULL AUTO_INCREMENT, - service_id INT(11) NULL DEFAULT NULL, - para_key VARCHAR(50) NULL DEFAULT NULL, - para_value VARCHAR(50) NULL DEFAULT NULL, - PRIMARY KEY (id), - CONSTRAINT FK_EP_MICROSERIVCE_EP_MICROSERVICE_PARAMETER FOREIGN KEY (service_id) REFERENCES ep_microservice (id) -); - - - -- ---------------------------------------------------------- - -- NAME: ep_widget_preview_files; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_widget_preview_files ( - preview_id INT(11) NOT NULL AUTO_INCREMENT, - html_file LONGBLOB NULL, - css_file LONGBLOB NULL, - javascript_file LONGBLOB NULL, - framework_file LONGBLOB NULL, - PRIMARY KEY (preview_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_microservice; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_widget_microservice ( - id INT(11) NOT NULL AUTO_INCREMENT, - widget_id INT(11) NOT NULL DEFAULT '0', - microservice_id INT(11) NOT NULL DEFAULT '0', - PRIMARY KEY (id), - CONSTRAINT FK_EP_WIDGET_MICROSERVICE_EP_MICROSERVICE FOREIGN KEY (microservice_id) REFERENCES ep_microservice (id), - CONSTRAINT FK_EP_WIDGET_MICROSERVICE_EP_WIDGET FOREIGN KEY (widget_id) REFERENCES ep_widget_catalog (widget_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_basic_auth_account; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_basic_auth_account ( - id INT(11) NOT NULL AUTO_INCREMENT, - ext_app_name VARCHAR(50) NOT NULL, - username VARCHAR(50) NOT NULL, - password VARCHAR(50) null default null, - active_yn char(1) NOT NULL default 'Y', - PRIMARY KEY (id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_widget_catalog_parameter; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_widget_catalog_parameter ( - id INT(11) NOT NULL AUTO_INCREMENT, - widget_id INT(11) NOT NULL, - user_id INT(11) NOT NULL, - param_id INT(11) NOT NULL, - user_value VARCHAR(50) NULL, - PRIMARY KEY (id), - CONSTRAINT EP_FN_USER_WIDGET_PARAMETER_FK FOREIGN KEY (user_id) REFERENCES fn_user (user_id), - CONSTRAINT EP_WIDGET_CATALOG_WIDGET_PARAMETER_FK FOREIGN KEY (widget_id) REFERENCES ep_widget_catalog (widget_id), - CONSTRAINT EP_PARAMETER_ID_WIDGET_PARAMETER_FK FOREIGN KEY (param_id) REFERENCES ep_microservice_parameter (id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_web_analytics_source; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_web_analytics_source( - resource_id int(11) NOT NULL auto_increment, - app_id int(11) NOT NULL, - report_source varchar(500), - report_name varchar(500), - PRIMARY KEY (resource_id), - FOREIGN KEY (app_id) REFERENCES fn_app(app_id) -); - - -- Machine Learning Tables - -- ---------------------------------------------------------- - -- NAME: ep_ml_model; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_ml_model( - time_stamp timestamp default now(), - group_id int(11) NOT NULL, - model longblob, - PRIMARY KEY (time_stamp,group_id) -); - -- ---------------------------------------------------------- - -- NAME: ep_ml_rec; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_ml_rec( - time_stamp timestamp default now(), - org_user_id varchar(20) NOT NULL, - rec varchar(4000) DEFAULT NULL, - PRIMARY KEY (time_stamp,org_user_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_ml_user; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_ml_user( - time_stamp timestamp default now(), - org_user_id varchar(20) NOT NULL, - group_id int(11) NOT NULL, - PRIMARY KEY (time_stamp,org_user_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_endpoints; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_endpoints ( - id INT(11) NOT NULL AUTO_INCREMENT, - url VARCHAR(50) NOT NULL, - PRIMARY KEY (id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_endpoints_basic_auth_account; TYPE: TABLE - -- ---------------------------------------------------------- - -create table ep_endpoints_basic_auth_account ( - id INT(11) NOT NULL AUTO_INCREMENT, - ep_id INT(11) DEFAULT NULL, - account_id INT(11) DEFAULT NULL, - PRIMARY KEY (id), - CONSTRAINT ep_endpoints_basic_auth_account_account_id_fk FOREIGN KEY (account_id) REFERENCES ep_basic_auth_account (id), - CONSTRAINT ep_endpoints_basic_auth_account_ep_id_fk FOREIGN KEY (ep_id) REFERENCES ep_endpoints (id) - -); - --- end new 1707 tables/views - --- new 1710 tables/views - - -- ---------------------------------------------------------- - -- NAME: ep_app_function; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE ep_app_function ( -app_id INT(11) NOT NULL, -function_cd VARCHAR(250) NOT NULL, -function_name VARCHAR(500) NOT NULL, -PRIMARY KEY (function_cd, app_id), -INDEX fk_ep_app_function_app_id (app_id), -CONSTRAINT fk_ep_app_function_app_id FOREIGN KEY (app_id) REFERENCES fn_app (app_id) -); - - -- ---------------------------------------------------------- - -- NAME: ep_app_role_function; TYPE: TABLE - -- ---------------------------------------------------------- - -CREATE TABLE `ep_app_role_function` ( -`id` INT(11) NOT NULL AUTO_INCREMENT, -`app_id` INT(11) NOT NULL, -`role_id` INT(11) NOT NULL, -`function_cd` VARCHAR(250) NOT NULL, -`role_app_id` VARCHAR(20) NULL DEFAULT NULL, -PRIMARY KEY (`id`), -UNIQUE INDEX `UNIQUE KEY` (`app_id`, `role_id`, `function_cd`), -CONSTRAINT `fk_ep_app_role_function_app_id` FOREIGN KEY (`app_id`) REFERENCES `fn_app` (`app_id`), -CONSTRAINT `fk_ep_app_role_function_ep_app_func` FOREIGN KEY (`app_id`, `function_cd`) REFERENCES `ep_app_function` (`app_id`, `function_cd`), -CONSTRAINT `fk_ep_app_role_function_role_id` FOREIGN KEY (`role_id`) REFERENCES `fn_role` (`role_id`) -); - --- end new 1710 tables/views - --- ---------------------------------------------------------- --- NAME: QUARTZ TYPE: INDEXES --- ---------------------------------------------------------- -create index idx_fn_qz_j_req_recovery on fn_qz_job_details(sched_name,requests_recovery); -create index idx_fn_qz_j_grp on fn_qz_job_details(sched_name,job_group); -create index idx_fn_qz_t_j on fn_qz_triggers(sched_name,job_name,job_group); -create index idx_fn_qz_t_jg on fn_qz_triggers(sched_name,job_group); -create index idx_fn_qz_t_c on fn_qz_triggers(sched_name,calendar_name); -create index idx_fn_qz_t_g on fn_qz_triggers(sched_name,trigger_group); -create index idx_fn_qz_t_state on fn_qz_triggers(sched_name,trigger_state); -create index idx_fn_qz_t_n_state on fn_qz_triggers(sched_name,trigger_name,trigger_group,trigger_state); -create index idx_fn_qz_t_n_g_state on fn_qz_triggers(sched_name,trigger_group,trigger_state); -create index idx_fn_qz_t_next_fire_time on fn_qz_triggers(sched_name,next_fire_time); -create index idx_fn_qz_t_nft_st on fn_qz_triggers(sched_name,trigger_state,next_fire_time); -create index idx_fn_qz_t_nft_misfire on fn_qz_triggers(sched_name,misfire_instr,next_fire_time); -create index idx_fn_qz_t_nft_st_misfire on fn_qz_triggers(sched_name,misfire_instr,next_fire_time,trigger_state); -create index idx_fn_qz_t_nft_st_misfire_grp on fn_qz_triggers(sched_name,misfire_instr,next_fire_time,trigger_group,trigger_state); -create index idx_fn_qz_ft_trig_inst_name on fn_qz_fired_triggers(sched_name,instance_name); -create index idx_fn_qz_ft_inst_job_req_rcvry on fn_qz_fired_triggers(sched_name,instance_name,requests_recovery); -create index idx_fn_qz_ft_j_g on fn_qz_fired_triggers(sched_name,job_name,job_group); -create index idx_fn_qz_ft_jg on fn_qz_fired_triggers(sched_name,job_group); -create index idx_fn_qz_ft_t_g on fn_qz_fired_triggers(sched_name,trigger_name,trigger_group); -create index idx_fn_qz_ft_tg on fn_qz_fired_triggers(sched_name,trigger_group); - - --- ------------------ create view section --- --- name: v_url_access; type: view --- -create view v_url_access as - select distinct m.action as url, - m.function_cd - from fn_menu m - where (m.action is not null) -union - select distinct t.action as url, - t.function_cd - from fn_tab t - where (t.action is not null) -union - select r.restricted_url as url, - r.function_cd - from fn_restricted_url r; - --- ------------------ alter table add constraint primary key section --- --- name: cr_favorite_reports_user_idrep_id; type: constraint --- -alter table cr_favorite_reports - add constraint cr_favorite_reports_user_idrep_id primary key (user_id, rep_id); --- --- name: cr_folder_folder_id; type: constraint --- -alter table cr_folder - add constraint cr_folder_folder_id primary key (folder_id); --- --- name: cr_folder_access_folder_access_id; type: constraint --- -alter table cr_folder_access - add constraint cr_folder_access_folder_access_id primary key (folder_access_id); --- --- name: cr_hist_user_map_hist_iduser_id; type: constraint --- -alter table cr_hist_user_map - add constraint cr_hist_user_map_hist_iduser_id primary key (hist_id, user_id); --- --- name: cr_lu_file_type_lookup_id; type: constraint --- -alter table cr_lu_file_type - add constraint cr_lu_file_type_lookup_id primary key (lookup_id); --- --- name: cr_raptor_action_img_image_id; type: constraint --- -alter table cr_raptor_action_img - add constraint cr_raptor_action_img_image_id primary key (image_id); --- --- name: cr_raptor_pdf_img_image_id; type: constraint --- -alter table cr_raptor_pdf_img - add constraint cr_raptor_pdf_img_image_id primary key (image_id); --- --- name: cr_remote_schema_info_schema_prefix; type: constraint --- -alter table cr_remote_schema_info - add constraint cr_remote_schema_info_schema_prefix primary key (schema_prefix); --- --- name: cr_report_rep_id; type: constraint --- -alter table cr_report - add constraint cr_report_rep_id primary key (rep_id); --- --- name: cr_report_access_rep_idorder_no; type: constraint --- -alter table cr_report_access - add constraint cr_report_access_rep_idorder_no primary key (rep_id, order_no); --- --- name: cr_report_email_sent_log_log_id; type: constraint --- -alter table cr_report_email_sent_log - add constraint cr_report_email_sent_log_log_id primary key (log_id); --- --- name: cr_report_file_history_hist_id; type: constraint --- -alter table cr_report_file_history - add constraint cr_report_file_history_hist_id primary key (hist_id); --- --- name: cr_report_schedule_schedule_id; type: constraint --- -alter table cr_report_schedule - add constraint cr_report_schedule_schedule_id primary key (schedule_id); --- --- name: cr_report_schedule_users_schedule_idrep_iduser_idorder_no; type: constraint --- -alter table cr_report_schedule_users - add constraint cr_report_schedule_users_schedule_idrep_iduser_idorder_no primary key (schedule_id, rep_id, user_id, order_no); --- --- name: cr_report_template_map_report_id; type: constraint --- -alter table cr_report_template_map - add constraint cr_report_template_map_report_id primary key (report_id); --- --- name: cr_table_role_table_namerole_id; type: constraint --- -alter table cr_table_role - add constraint cr_table_role_table_namerole_id primary key (table_name, role_id); --- --- name: cr_table_source_table_name; type: constraint --- -alter table cr_table_source - add constraint cr_table_source_table_name primary key (table_name); --- --- name: fn_audit_action_audit_action_id; type: constraint --- -alter table fn_audit_action - add constraint fn_audit_action_audit_action_id primary key (audit_action_id); --- --- --- name: fk_fn_audit_ref_205_fn_lu_ac; type: constraint --- -alter table fn_audit_log - add constraint fk_fn_audit_ref_205_fn_lu_ac foreign key (activity_cd) references fn_lu_activity(activity_cd); --- --- name: fk_fn_role__ref_201_fn_funct; type: constraint --- -alter table fn_role_function - add constraint fk_fn_role__ref_201_fn_funct foreign key (function_cd) references fn_function(function_cd); --- --- name: fn_chat_logs_chat_log_id; type: constraint --- -alter table fn_chat_logs - add constraint fn_chat_logs_chat_log_id primary key (chat_log_id); --- --- name: fn_chat_room_chat_room_id; type: constraint --- -alter table fn_chat_room - add constraint fn_chat_room_chat_room_id primary key (chat_room_id); --- --- name: fn_chat_users_id; type: constraint --- -alter table fn_chat_users - add constraint fn_chat_users_id primary key (id); --- --- name: fn_lu_alert_method_alert_method_cd; type: constraint --- -alter table fn_lu_alert_method - add constraint fn_lu_alert_method_alert_method_cd primary key (alert_method_cd); --- --- name: fn_lu_broadcast_site_broadcast_site_cd; type: constraint --- -alter table fn_lu_broadcast_site - add constraint fn_lu_broadcast_site_broadcast_site_cd primary key (broadcast_site_cd); --- --- name: fn_lu_priority_priority_id; type: constraint --- -alter table fn_lu_priority - add constraint fn_lu_priority_priority_id primary key (priority_id); --- --- name: fn_lu_role_type_role_type_id; type: constraint --- -alter table fn_lu_role_type - add constraint fn_lu_role_type_role_type_id primary key (role_type_id); --- --- name: fn_lu_tab_set_tab_set_cd; type: constraint --- -alter table fn_lu_tab_set - add constraint fn_lu_tab_set_tab_set_cd primary key (tab_set_cd); --- --- name: fn_lu_timezone_timezone_id; type: constraint --- -alter table fn_lu_timezone - add constraint fn_lu_timezone_timezone_id primary key (timezone_id); --- --- name: fn_org_org_id; type: constraint --- -alter table fn_org - add constraint fn_org_org_id primary key (org_id); --- --- name: fn_restricted_url_restricted_urlfunction_cd; type: constraint --- -alter table fn_restricted_url - add constraint fn_restricted_url_restricted_urlfunction_cd primary key (restricted_url, function_cd); --- --- name: fn_role_composite_parent_role_idchild_role_id; type: constraint --- -alter table fn_role_composite - add constraint fn_role_composite_parent_role_idchild_role_id primary key (parent_role_id, child_role_id); --- --- name: fn_role_function_role_idfunction_cd; type: constraint --- -alter table fn_role_function - add constraint fn_role_function_role_idfunction_cd primary key (role_id, function_cd); --- --- name: fn_tab_tab_cd; type: constraint --- -alter table fn_tab - add constraint fn_tab_tab_cd primary key (tab_cd); --- --- name: fn_tab_selected_selected_tab_cdtab_uri; type: constraint --- -alter table fn_tab_selected - add constraint fn_tab_selected_selected_tab_cdtab_uri primary key (selected_tab_cd, tab_uri); --- --- name: fn_user_pseudo_role_pseudo_role_iduser_id; type: constraint --- -alter table fn_user_pseudo_role - add constraint fn_user_pseudo_role_pseudo_role_iduser_id primary key (pseudo_role_id, user_id); --- --- name: fn_user_role_user_idrole_id; type: constraint --- -alter table fn_user_role - add constraint fn_user_role_user_idrole_id primary key (user_id, role_id, app_id); --- ------------------ create index section --- --- name: cr_report_create_idpublic_yntitle; type: index --- -create index cr_report_create_idpublic_yntitle using btree on cr_report (create_id, public_yn, title); --- --- name: cr_table_join_dest_table_name; type: index --- -create index cr_table_join_dest_table_name using btree on cr_table_join (dest_table_name); --- --- name: cr_table_join_src_table_name; type: index --- -create index cr_table_join_src_table_name using btree on cr_table_join (src_table_name); --- --- name: fn_audit_log_activity_cd; type: index --- -create index fn_audit_log_activity_cd using btree on fn_audit_log (activity_cd); --- --- name: fn_audit_log_user_id; type: index --- -create index fn_audit_log_user_id using btree on fn_audit_log (user_id); --- --- name: fn_org_access_cd; type: index --- -create index fn_org_access_cd using btree on fn_org (access_cd); --- --- name: fn_role_function_function_cd; type: index --- -create index fn_role_function_function_cd using btree on fn_role_function (function_cd); --- --- name: fn_role_function_role_id; type: index --- -create index fn_role_function_role_id using btree on fn_role_function (role_id); --- --- name: fn_user_address_id; type: index --- -create index fn_user_address_id using btree on fn_user (address_id); --- --- name: fn_user_alert_method_cd; type: index --- -create index fn_user_alert_method_cd using btree on fn_user (alert_method_cd); --- --- name: fn_user_hrid; type: index --- -create unique index fn_user_hrid using btree on fn_user (hrid); --- --- name: fn_user_login_id; type: index --- -create unique index fn_user_login_id using btree on fn_user (login_id); --- --- name: fn_user_org_id; type: index --- -create index fn_user_org_id using btree on fn_user (org_id); --- --- name: fn_user_role_role_id; type: index --- -create index fn_user_role_role_id using btree on fn_user_role (role_id); --- --- name: fn_user_role_user_id; type: index --- -create index fn_user_role_user_id using btree on fn_user_role (user_id); --- --- name: fk_fn_user__ref_178_fn_app_idx; type: index --- -create index fk_fn_user__ref_178_fn_app_idx on fn_user_role (app_id); - -- - -- name: fn_role_name_app_id_idx; type: index - -- - create unique index fn_role_name_app_id_idx using btree on fn_role (role_name,app_id); - --- new for 1707 - -create index ep_notif_recv_user_id_idx using btree on ep_role_notification (recv_user_id); - --- end new for 1707 - --- ------------------ alter table add constraint foreign key section --- --- name: fk_fn_user__ref_178_fn_app; type: fk constraint --- -alter table fn_user_role - add constraint fk_fn_user__ref_178_fn_app foreign key (app_id) references fn_app(app_id); --- --- name: fk_cr_repor_ref_14707_cr_repor; type: fk constraint --- -alter table cr_report_schedule - add constraint fk_cr_repor_ref_14707_cr_repor foreign key (rep_id) references cr_report(rep_id); --- --- name: fk_cr_repor_ref_14716_cr_repor; type: fk constraint --- -alter table cr_report_schedule_users - add constraint fk_cr_repor_ref_14716_cr_repor foreign key (schedule_id) references cr_report_schedule(schedule_id); --- --- name: fk_cr_repor_ref_17645_cr_repor; type: fk constraint --- -alter table cr_report_log - add constraint fk_cr_repor_ref_17645_cr_repor foreign key (rep_id) references cr_report(rep_id); --- --- name: fk_cr_repor_ref_8550_cr_repor; type: fk constraint --- -alter table cr_report_access - add constraint fk_cr_repor_ref_8550_cr_repor foreign key (rep_id) references cr_report(rep_id); --- --- name: fk_cr_report_rep_id; type: fk constraint --- -alter table cr_report_email_sent_log - add constraint fk_cr_report_rep_id foreign key (rep_id) references cr_report(rep_id); --- --- name: fk_cr_table_ref_311_cr_tab; type: fk constraint --- -alter table cr_table_join - add constraint fk_cr_table_ref_311_cr_tab foreign key (src_table_name) references cr_table_source(table_name); --- --- name: fk_cr_table_ref_315_cr_tab; type: fk constraint --- -alter table cr_table_join - add constraint fk_cr_table_ref_315_cr_tab foreign key (dest_table_name) references cr_table_source(table_name); --- --- name: fk_cr_table_ref_32384_cr_table; type: fk constraint --- -alter table cr_table_role - add constraint fk_cr_table_ref_32384_cr_table foreign key (table_name) references cr_table_source(table_name); --- --- name: fk_fn_tab_function_cd; type: fk constraint --- -alter table fn_tab - add constraint fk_fn_tab_function_cd foreign key (function_cd) references fn_function(function_cd); --- --- name: fk_fn_tab_selected_tab_cd; type: fk constraint --- -alter table fn_tab_selected - add constraint fk_fn_tab_selected_tab_cd foreign key (selected_tab_cd) references fn_tab(tab_cd); --- --- name: fk_fn_tab_set_cd; type: fk constraint --- -alter table fn_tab - add constraint fk_fn_tab_set_cd foreign key (tab_set_cd) references fn_lu_tab_set(tab_set_cd); --- --- name: fk_fn_user_ref_110_fn_org; type: fk constraint --- -alter table fn_user - add constraint fk_fn_user_ref_110_fn_org foreign key (org_id) references fn_org(org_id); --- --- name: fk_fn_user_ref_123_fn_lu_al; type: fk constraint --- -alter table fn_user - add constraint fk_fn_user_ref_123_fn_lu_al foreign key (alert_method_cd) references fn_lu_alert_method(alert_method_cd); --- --- name: fk_fn_user_ref_197_fn_user; type: fk constraint --- - alter table fn_user - add constraint fk_fn_user_ref_197_fn_user foreign key (manager_id) references fn_user(user_id); --- --- name: fk_fn_user_ref_198_fn_user; type: fk constraint --- -alter table fn_user - add constraint fk_fn_user_ref_198_fn_user foreign key (created_id) references fn_user(user_id); --- --- name: fk_fn_user_ref_199_fn_user; type: fk constraint --- -alter table fn_user - add constraint fk_fn_user_ref_199_fn_user foreign key (modified_id) references fn_user(user_id); --- --- name: fk_parent_key_cr_folder; type: fk constraint --- -alter table cr_folder - add constraint fk_parent_key_cr_folder foreign key (parent_folder_id) references cr_folder(folder_id); --- --- name: fk_pseudo_role_pseudo_role_id; type: fk constraint --- -alter table fn_user_pseudo_role - add constraint fk_pseudo_role_pseudo_role_id foreign key (pseudo_role_id) references fn_role(role_id); --- --- name: fk_pseudo_role_user_id; type: fk constraint --- -alter table fn_user_pseudo_role - add constraint fk_pseudo_role_user_id foreign key (user_id) references fn_user(user_id); --- --- name: fk_restricted_url_function_cd; type: fk constraint --- -alter table fn_restricted_url - add constraint fk_restricted_url_function_cd foreign key (function_cd) references fn_function(function_cd); --- --- name: fk_timezone; type: fk constraint --- -alter table fn_user - add constraint fk_timezone foreign key (timezone) references fn_lu_timezone(timezone_id); --- --- name: sys_c0014614; type: fk constraint --- -alter table cr_report_file_history - add constraint sys_c0014614 foreign key (file_type_id) references cr_lu_file_type(lookup_id); --- --- name: sys_c0014615; type: fk constraint --- -alter table cr_report_file_history - add constraint sys_c0014615 foreign key (rep_id) references cr_report(rep_id); --- --- name: sys_c0014616; type: fk constraint --- -alter table cr_hist_user_map - add constraint sys_c0014616 foreign key (hist_id) references cr_report_file_history(hist_id); --- --- name: sys_c0014617; type: fk constraint --- -alter table cr_hist_user_map - add constraint sys_c0014617 foreign key (user_id) references fn_user(user_id); --- --- name: sys_c0014618; type: fk constraint --- -alter table fn_menu_favorites -add constraint sys_c0014618 foreign key (user_id) references fn_user(user_id); - --- --- name: sys_c0014619; type: fk constraint --- -alter table fn_menu_favorites -add constraint sys_c0014619 foreign key (menu_id) references fn_menu_functional(menu_id); - -commit;
\ No newline at end of file diff --git a/ecomp-portal-DB-common/PortalDDLMySql_2_5_Common.sql b/ecomp-portal-DB-common/PortalDDLMySql_3_3_Common.sql index 1bf10c6c..180f1f69 100644 --- a/ecomp-portal-DB-common/PortalDDLMySql_2_5_Common.sql +++ b/ecomp-portal-DB-common/PortalDDLMySql_3_3_Common.sql @@ -1,5 +1,5 @@ -- --------------------------------------------------------------------------------------------------------------- --- This is the 2.1.0 version of Portal database called portal +-- This is the 3.2.0 version of Portal database called portal -- note to : database admin, set the mysql system variable called lower_case_table_names -- it can be set 3 different ways: @@ -630,6 +630,9 @@ create table fn_app ( ueb_key varchar(256) default null, ueb_secret varchar(256) default null, ueb_topic_name varchar(256) default null, + uses_cadi char(1) default null, + ack_app char(1) default 'Y', + mode_of_integration varchar(50) default null, app_type int(11) not null default 1, auth_central char(1) not null default 'N', auth_namespace varchar(100) null default null @@ -1776,4 +1779,4 @@ add constraint sys_c0014618 foreign key (user_id) references fn_user(user_id); alter table fn_menu_favorites add constraint sys_c0014619 foreign key (menu_id) references fn_menu_functional(menu_id); -commit;
\ No newline at end of file +commit; diff --git a/ecomp-portal-DB-common/PortalDMLMySql_2_1_Common.sql b/ecomp-portal-DB-common/PortalDMLMySql_2_1_Common.sql deleted file mode 100644 index c3234d0a..00000000 --- a/ecomp-portal-DB-common/PortalDMLMySql_2_1_Common.sql +++ /dev/null @@ -1,312 +0,0 @@ --- -------------------------------------------------------------------------------------------- --- This is the common default data for 2.1.0 Version of Portal database called portal - -USE portal; - -set foreign_key_checks=1; - -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (1,2,'Home'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (1,3,'Application Catalog'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (1,4,'Widget Catalog'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (1,5,'Admins'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (1,6,'Roles'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (1,7,'Users'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (1,8,'Portal Admins'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (1,9,'Application Onboarding'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (1,10,'Widget Onboarding'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (1,11,'Edit Functional Menu'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (1,12,'User Notifications'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (1,13,'Microservice Onboarding'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (1,15,'App Account Management'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (2,2,'主页'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (2,3,'应用目录'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (2,4,'部件目录'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (2,5,'管理员'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (2,6,'角色'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (2,7,'用户'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (2,8,'门户管理员'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (2,9,'应用管理'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (2,10,'部件管理'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (2,11,'编辑功能菜单'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (2,12,'用户通知'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (2,13,'微服务管理'); -INSERT INTO fn_display_text (language_id,text_id,text_label) VALUES (2,15,'应用账户管理'); - -INSERT INTO fn_language (language_name,language_alias) VALUES ('English','EN'); -INSERT INTO fn_language (language_name,language_alias) VALUES ('简体中文','CN'); - --- FN_FUNCTION -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_process','Process List'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_job','Job Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_job_create','Job Create'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_job_designer','Process in Designer view'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_task','Task Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_task_search','Task Search'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_map','Map Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_sample','Sample Pages Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('login','Login'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_home','Home Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_customer','Customer Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_reports','Reports Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_profile','Profile Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_admin','Admin Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_feedback','Feedback Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_help','Help Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_logout','Logout Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_notes','Notes Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_ajax','Ajax Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_customer_create','Customer Create'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_profile_create','Profile Create'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_profile_import','Profile Import'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_tab','Sample Tab Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('view_reports','View Raptor reports'); - --- new 1702 -Insert into fn_function (function_cd,function_name) values ('edit_notification','User Notification'); -Insert INTO fn_function (function_cd,function_name) values ('getAdminNotifications', 'Admin Notifications'); -Insert INTO fn_function (function_cd,function_name) values ('saveNotification', 'publish notifications'); --- end new 1702 - --- new 1707 -INSERT INTO fn_function (function_cd, function_name) VALUES ('menu_web_analytics', 'Web Analytics'); --- end new 1707 - --- FN_LU_ACTIVITY -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_role','add_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_role','remove_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_user_role','add_user_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_user_role','remove_user_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_role_function','add_role_function'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_role_function','remove_role_function'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_child_role','add_child_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_child_role','remove_child_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('mobile_login','Mobile Login'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('mobile_logout','Mobile Logout'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('login','Login'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('logout','Logout'); - --- new 1610.2 -insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values('guest_login','Guest Login'); --- end new 1610.2 - --- new 1702 -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('tab_access','Tab Access'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('app_access','App Access'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values('functional_access','Functional Access'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('left_menu_access','Left Menu Access'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('search','Search'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('apa','Add Portal Admin'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('dpa','Delete Portal Admin'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('uaa','Update Account Admin'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('uu','Update User'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('eaaf','External auth add function'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('eaar','External auth add role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('eadf','External auth delete function'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('eadr','External auth delete role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('eauf','External auth update function'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('eaurf','External auth update role and function'); - --- FN_LU_MENU_SET -Insert into fn_lu_menu_set (MENU_SET_CD,MENU_SET_NAME) values ('APP','Application Menu'); - --- FN_MENU Ecomp Portal now uses the left menu entries from fn_menu -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(1,'root',NULL,10,NULL,'menu_home','N','APP','N',NULL); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(2,'Home',1,10,'root.applicationsHome','menu_home','Y','APP','N','icon-building-home'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(3,'Application Catalog',1,15,'root.appCatalog','menu_home','Y','APP','N','icon-retail-gallery'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(4,'Widget Catalog',1,20,'root.widgetCatalog','menu_home','Y','APP','N','icon-retail-gallery'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(5,'Admins',1,40,'root.admins','menu_admin','Y','APP','N','icon-content-star'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(6,'Roles',1,45,'root.roles','menu_acc_admin','Y','APP','N','icon-people-groupcollaboration'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(7,'Users',1,50,'root.users','menu_acc_admin','Y','APP','N','icon-people-groupcollaboration'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(8,'Portal Admins',1,60,'root.portalAdmins','menu_admin','Y','APP','N','icon-controls-settingsconnectedactivity'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(9,'Application Onboarding',1,70,'root.applications','menu_admin','Y','APP','N','icon-content-grid2'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(10,'Widget Onboarding',1,80,'root.widgetOnboarding','menu_admin','Y','APP','N','icon-content-grid2'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(11,'Edit Functional Menu',1,90,'root.functionalMenu','menu_admin','Y','APP','N','icon-misc-pen'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(12,'User Notifications',1,100,'root.userNotifications','edit_notification','Y','APP','N','icon-controls-settingsconnectedactivity'); - --- end new 1702 - --- new 1707 -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values (13,'Microservice Onboarding', 1, 110, 'root.microserviceOnboarding', 'menu_admin', 'Y', 'APP', 'N', 'icon-content-grid2'); -Insert into fn_menu (menu_id, label, parent_id, sort_order, action, function_cd, active_yn, menu_set_cd, separator_yn, image_src) - values(15,'App Account Management', 1, 130, 'root.accountOnboarding', 'menu_admin', 'Y', 'App', 'N', 'icon-content-grid2'); - --- end new 1707 - --- FN_LU_ALERT_METHOD -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('PHONE','Phone'); -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('FAX','Fax'); -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('PAGER','Pager'); -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('EMAIL','Email'); -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('SMS','SMS'); - --- FN_LU_PRIORITY -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (10,'Low','Y',10); -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (20,'Normal','Y',20); -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (30,'High','Y',30); -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (40,'Urgent','Y',40); -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (50,'Fatal','Y',50); - --- FN_LU_TAB_SET -Insert into fn_lu_tab_set (TAB_SET_CD,TAB_SET_NAME) values ('APP','Application Tabs'); - --- FN_LU_TIMEZONE -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (10,'US/Eastern','US/Eastern'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (20,'US/Central','US/Central'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (30,'US/Mountain','US/Mountain'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (40,'US/Arizona','America/Phoenix'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (50,'US/Pacific','US/Pacific'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (60,'US/Alaska','US/Alaska'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (70,'US/Hawaii','US/Hawaii'); - --- FN_RESTRICTED_URL -Insert into fn_restricted_url (restricted_url, function_cd) values ('attachment.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('broadcast.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('file_upload.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('job.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('role.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('role_function.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('test.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('async_test.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('chatWindow.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('contact_list.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('customer_dynamic_list.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('event.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('event_list.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('mobile_welcome.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('sample_map.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('template.jsp','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('jbpm_designer.htm','menu_job_create'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('jbpm_drools.htm','menu_job_create'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('process_job.htm','menu_job_create'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('profile.htm','menu_profile_create'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor2.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor_blob_extract.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor_email_attachment.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor_search.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('report_list.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('gauge.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('gmap_controller.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('gmap_frame.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('map.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('map_download.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('map_grid_search.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('sample_animated_map.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('sample_map_2.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('sample_map_3.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab2_sub1.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab2_sub2_link1.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab2_sub2_link2.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab2_sub3.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab3.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab4.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor.htm','view_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor_blob_extract.htm','view_reports'); - --- FN_ROLE -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (1,'System Administrator','Y',1,NULL,NULL); -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (16,'Standard User','Y',5,NULL,NULL); -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (999,'Account Administrator','Y',1,NULL,NULL); -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (900,'Restricted App Role','Y','1',NULL,NULL); - --- new 1702 -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (950,'Portal Notification Admin','Y','1',NULL,NULL); --- end new 1702 - --- new 1707 -INSERT INTO fn_role (role_id, role_name, active_yn, priority) VALUES ('1010', 'Usage Analyst', 'Y', '1'); -INSERT INTO fn_role (role_id, role_name, active_yn, priority) VALUES ('2115', 'Portal Usage Analyst', 'Y', '6'); --- end new 1707 - --- FN_ROLE_Composite -Insert into fn_role_composite (PARENT_ROLE_ID,CHILD_ROLE_ID) values (1,16); - --- FN_ROLE_FUNCTION -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'login'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_admin'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_ajax'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_customer'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_customer_create'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_feedback'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_help'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_home'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_job'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_job_create'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_logout'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_notes'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_process'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_profile'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_profile_create'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_profile_import'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_reports'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_sample'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_tab'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'login'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_ajax'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_customer'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_customer_create'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_home'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_logout'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_map'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_profile'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_reports'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_tab'); - --- new 1702 -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (950,'edit_notification'); -Insert INTO fn_role_function (ROLE_ID,FUNCTION_CD) values (950, 'getAdminNotifications'); -Insert INTO fn_role_function (ROLE_ID,FUNCTION_CD) values (950, 'saveNotification'); --- end new 1702 - --- new 1707 -INSERT INTO fn_role_function (role_id, function_cd) VALUES ('1010', 'menu_web_analytics'); -INSERT INTO fn_role_function (role_id, function_cd) VALUES ('2115', 'menu_web_analytics'); --- end new 1707 - --- FN_TAB -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB1_S1','Left Tab 1','Sub - Sub Tab 1 Information','tab2_sub1.htm','menu_tab','Y',10,'TAB2_SUB1','APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB1','Tab 1','Tab 1 Information','tab1.htm','menu_tab','Y',10,null,'APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2','Tab 2','Tab 2 Information','tab2_sub1.htm','menu_tab','Y',20,null,'APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB3','Tab 3','Tab 3 Information','tab3.htm','menu_tab','Y',30,null,'APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB4','Tab 4','Tab 4 Information','tab4.htm','menu_tab','Y',40,null,'APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB1','Sub Tab 1','Sub Tab 1 Information','tab2_sub1.htm','menu_tab','Y',10,'TAB2','APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB2','Sub Tab 2','Sub Tab 2 Information','tab2_sub2.htm','menu_tab','Y',20,'TAB2','APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB3','Sub Tab 3','Sub Tab 3 Information','tab2_sub3.htm','menu_tab','Y',30,'TAB2','APP'); - --- FN_TAB_SELECTED -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB1','tab1'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2','tab2_sub1'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2','tab2_sub2'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2','tab2_sub3'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB1','tab2_sub1'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB1_S1','tab2_sub1'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB2','tab2_sub2'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB3','tab2_sub3'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB3','tab3'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB4','tab4'); - -commit;
\ No newline at end of file diff --git a/ecomp-portal-DB-common/PortalDMLMySql_2_4_Common.sql b/ecomp-portal-DB-common/PortalDMLMySql_2_4_Common.sql deleted file mode 100644 index 6c60c50f..00000000 --- a/ecomp-portal-DB-common/PortalDMLMySql_2_4_Common.sql +++ /dev/null @@ -1,276 +0,0 @@ --- -------------------------------------------------------------------------------------------- --- This is the common default data for 2.1.0 Version of Portal database called portal - -USE portal; - -set foreign_key_checks=1; - --- FN_FUNCTION -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_process','Process List'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_job','Job Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_job_create','Job Create'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_job_designer','Process in Designer view'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_task','Task Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_task_search','Task Search'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_map','Map Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_sample','Sample Pages Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('login','Login'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_home','Home Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_customer','Customer Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_reports','Reports Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_profile','Profile Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_admin','Admin Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_feedback','Feedback Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_help','Help Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_logout','Logout Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_notes','Notes Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_ajax','Ajax Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_customer_create','Customer Create'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_profile_create','Profile Create'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_profile_import','Profile Import'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_tab','Sample Tab Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('view_reports','View Raptor reports'); - --- new 1702 -Insert into fn_function (function_cd,function_name) values ('edit_notification','User Notification'); -Insert INTO fn_function (function_cd,function_name) values ('getAdminNotifications', 'Admin Notifications'); -Insert INTO fn_function (function_cd,function_name) values ('saveNotification', 'publish notifications'); --- end new 1702 - --- new 1707 -INSERT INTO fn_function (function_cd, function_name) VALUES ('menu_web_analytics', 'Web Analytics'); --- end new 1707 - --- FN_LU_ACTIVITY -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_role','add_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_role','remove_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_user_role','add_user_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_user_role','remove_user_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_role_function','add_role_function'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_role_function','remove_role_function'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_child_role','add_child_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_child_role','remove_child_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('mobile_login','Mobile Login'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('mobile_logout','Mobile Logout'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('login','Login'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('logout','Logout'); - --- new 1610.2 -insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values('guest_login','Guest Login'); --- end new 1610.2 - --- new 1702 -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('tab_access','Tab Access'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('app_access','App Access'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values('functional_access','Functional Access'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('left_menu_access','Left Menu Access'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('search','Search'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('apa','Add Portal Admin'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('dpa','Delete Portal Admin'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('uaa','Update Account Admin'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('uu','Update User'); - --- FN_LU_MENU_SET -Insert into fn_lu_menu_set (MENU_SET_CD,MENU_SET_NAME) values ('APP','Application Menu'); - --- FN_MENU Ecomp Portal now uses the left menu entries from fn_menu -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(1,'root',NULL,10,NULL,'menu_home','N','APP','N',NULL); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(2,'Home',1,10,'root.applicationsHome','menu_home','Y','APP','N','icon-building-home'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(3,'Application Catalog',1,15,'root.appCatalog','menu_home','Y','APP','N','icon-retail-gallery'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(4,'Widget Catalog',1,20,'root.widgetCatalog','menu_home','Y','APP','N','icon-retail-gallery'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(5,'Admins',1,40,'root.admins','menu_admin','Y','APP','N','icon-content-star'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(6,'Roles',1,45,'root.roles','menu_acc_admin','Y','APP','N','icon-people-groupcollaboration'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(7,'Users',1,50,'root.users','menu_acc_admin','Y','APP','N','icon-people-groupcollaboration'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(8,'Portal Admins',1,60,'root.portalAdmins','menu_admin','Y','APP','N','icon-controls-settingsconnectedactivity'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(9,'Application Onboarding',1,70,'root.applications','menu_admin','Y','APP','N','icon-content-grid2'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(10,'Widget Onboarding',1,80,'root.widgetOnboarding','menu_admin','Y','APP','N','icon-content-grid2'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(11,'Edit Functional Menu',1,90,'root.functionalMenu','menu_admin','Y','APP','N','icon-misc-pen'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(12,'User Notifications',1,100,'root.userNotifications','edit_notification','Y','APP','N','icon-controls-settingsconnectedactivity'); - --- end new 1702 - --- new 1707 -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values (13,'Microservice Onboarding', 1, 110, 'root.microserviceOnboarding', 'menu_admin', 'Y', 'APP', 'N', 'icon-content-grid2'); -Insert into fn_menu (menu_id, label, parent_id, sort_order, action, function_cd, active_yn, menu_set_cd, separator_yn, image_src) - values(15,'App Account Management', 1, 130, 'root.accountOnboarding', 'menu_admin', 'Y', 'App', 'N', 'icon-content-grid2'); - --- end new 1707 - --- FN_LU_ALERT_METHOD -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('PHONE','Phone'); -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('FAX','Fax'); -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('PAGER','Pager'); -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('EMAIL','Email'); -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('SMS','SMS'); - --- FN_LU_PRIORITY -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (10,'Low','Y',10); -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (20,'Normal','Y',20); -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (30,'High','Y',30); -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (40,'Urgent','Y',40); -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (50,'Fatal','Y',50); - --- FN_LU_TAB_SET -Insert into fn_lu_tab_set (TAB_SET_CD,TAB_SET_NAME) values ('APP','Application Tabs'); - --- FN_LU_TIMEZONE -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (10,'US/Eastern','US/Eastern'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (20,'US/Central','US/Central'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (30,'US/Mountain','US/Mountain'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (40,'US/Arizona','America/Phoenix'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (50,'US/Pacific','US/Pacific'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (60,'US/Alaska','US/Alaska'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (70,'US/Hawaii','US/Hawaii'); - --- FN_RESTRICTED_URL -Insert into fn_restricted_url (restricted_url, function_cd) values ('attachment.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('broadcast.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('file_upload.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('job.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('role.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('role_function.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('test.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('async_test.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('chatWindow.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('contact_list.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('customer_dynamic_list.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('event.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('event_list.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('mobile_welcome.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('sample_map.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('template.jsp','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('jbpm_designer.htm','menu_job_create'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('jbpm_drools.htm','menu_job_create'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('process_job.htm','menu_job_create'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('profile.htm','menu_profile_create'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor2.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor_blob_extract.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor_email_attachment.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor_search.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('report_list.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('gauge.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('gmap_controller.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('gmap_frame.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('map.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('map_download.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('map_grid_search.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('sample_animated_map.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('sample_map_2.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('sample_map_3.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab2_sub1.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab2_sub2_link1.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab2_sub2_link2.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab2_sub3.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab3.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab4.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor.htm','view_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor_blob_extract.htm','view_reports'); - --- FN_ROLE -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (1,'System Administrator','Y',1,NULL,NULL); -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (16,'Standard User','Y',5,NULL,NULL); -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (999,'Account Administrator','Y',1,NULL,NULL); -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (900,'Restricted App Role','Y','1',NULL,NULL); - --- new 1702 -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (950,'Portal Notification Admin','Y','1',NULL,NULL); --- end new 1702 - --- new 1707 -INSERT INTO fn_role (role_id, role_name, active_yn, priority) VALUES ('1010', 'Usage Analyst', 'Y', '1'); -INSERT INTO fn_role (role_id, role_name, active_yn, priority) VALUES ('2115', 'Portal Usage Analyst', 'Y', '6'); --- end new 1707 - --- FN_ROLE_Composite -Insert into fn_role_composite (PARENT_ROLE_ID,CHILD_ROLE_ID) values (1,16); - --- FN_ROLE_FUNCTION -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'login'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_admin'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_ajax'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_customer'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_customer_create'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_feedback'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_help'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_home'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_job'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_job_create'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_logout'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_notes'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_process'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_profile'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_profile_create'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_profile_import'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_reports'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_sample'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_tab'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'login'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_ajax'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_customer'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_customer_create'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_home'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_logout'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_map'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_profile'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_reports'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_tab'); - --- new 1702 -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (950,'edit_notification'); -Insert INTO fn_role_function (ROLE_ID,FUNCTION_CD) values (950, 'getAdminNotifications'); -Insert INTO fn_role_function (ROLE_ID,FUNCTION_CD) values (950, 'saveNotification'); --- end new 1702 - --- new 1707 -INSERT INTO fn_role_function (role_id, function_cd) VALUES ('1010', 'menu_web_analytics'); -INSERT INTO fn_role_function (role_id, function_cd) VALUES ('2115', 'menu_web_analytics'); --- end new 1707 - --- FN_TAB -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB1_S1','Left Tab 1','Sub - Sub Tab 1 Information','tab2_sub1.htm','menu_tab','Y',10,'TAB2_SUB1','APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB1','Tab 1','Tab 1 Information','tab1.htm','menu_tab','Y',10,null,'APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2','Tab 2','Tab 2 Information','tab2_sub1.htm','menu_tab','Y',20,null,'APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB3','Tab 3','Tab 3 Information','tab3.htm','menu_tab','Y',30,null,'APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB4','Tab 4','Tab 4 Information','tab4.htm','menu_tab','Y',40,null,'APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB1','Sub Tab 1','Sub Tab 1 Information','tab2_sub1.htm','menu_tab','Y',10,'TAB2','APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB2','Sub Tab 2','Sub Tab 2 Information','tab2_sub2.htm','menu_tab','Y',20,'TAB2','APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB3','Sub Tab 3','Sub Tab 3 Information','tab2_sub3.htm','menu_tab','Y',30,'TAB2','APP'); - --- FN_TAB_SELECTED -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB1','tab1'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2','tab2_sub1'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2','tab2_sub2'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2','tab2_sub3'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB1','tab2_sub1'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB1_S1','tab2_sub1'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB2','tab2_sub2'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB3','tab2_sub3'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB3','tab3'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB4','tab4'); - -commit;
\ No newline at end of file diff --git a/ecomp-portal-DB-common/PortalDMLMySql_2_5_Common.sql b/ecomp-portal-DB-common/PortalDMLMySql_2_5_Common.sql deleted file mode 100644 index 7b13984a..00000000 --- a/ecomp-portal-DB-common/PortalDMLMySql_2_5_Common.sql +++ /dev/null @@ -1,276 +0,0 @@ --- -------------------------------------------------------------------------------------------- --- This is the common default data for 2.1.0 Version of Portal database called portal - -USE portal; - -set foreign_key_checks=1; - --- FN_FUNCTION -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_process','Process List'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_job','Job Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_job_create','Job Create'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_job_designer','Process in Designer view'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_task','Task Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_task_search','Task Search'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_map','Map Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_sample','Sample Pages Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('login','Login'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_home','Home Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_customer','Customer Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_reports','Reports Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_profile','Profile Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_admin','Admin Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_feedback','Feedback Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_help','Help Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_logout','Logout Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_notes','Notes Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_ajax','Ajax Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_customer_create','Customer Create'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_profile_create','Profile Create'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_profile_import','Profile Import'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('menu_tab','Sample Tab Menu'); -Insert into fn_function (FUNCTION_CD,FUNCTION_NAME) values ('view_reports','View Raptor reports'); - --- new 1702 -Insert into fn_function (function_cd,function_name) values ('edit_notification','User Notification'); -Insert INTO fn_function (function_cd,function_name) values ('getAdminNotifications', 'Admin Notifications'); -Insert INTO fn_function (function_cd,function_name) values ('saveNotification', 'publish notifications'); --- end new 1702 - --- new 1707 -INSERT INTO fn_function (function_cd, function_name) VALUES ('menu_web_analytics', 'Web Analytics'); --- end new 1707 - --- FN_LU_ACTIVITY -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_role','add_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_role','remove_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_user_role','add_user_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_user_role','remove_user_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_role_function','add_role_function'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_role_function','remove_role_function'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_child_role','add_child_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_child_role','remove_child_role'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('mobile_login','Mobile Login'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('mobile_logout','Mobile Logout'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('login','Login'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('logout','Logout'); - --- new 1610.2 -insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values('guest_login','Guest Login'); --- end new 1610.2 - --- new 1702 -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('tab_access','Tab Access'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('app_access','App Access'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values('functional_access','Functional Access'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('left_menu_access','Left Menu Access'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('search','Search'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('apa','Add Portal Admin'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('dpa','Delete Portal Admin'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('uaa','Update Account Admin'); -Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('uu','Update User'); - --- FN_LU_MENU_SET -Insert into fn_lu_menu_set (MENU_SET_CD,MENU_SET_NAME) values ('APP','Application Menu'); - --- FN_MENU Ecomp Portal now uses the left menu entries from fn_menu -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(1,'root',NULL,10,NULL,'menu_home','N','APP','N',NULL); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(2,'Home',1,10,'root.applicationsHome','menu_home','Y','APP','N','icon-building-home'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(3,'Application Catalog',1,15,'root.appCatalog','menu_home','Y','APP','N','icon-retail-gallery'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(4,'Widget Catalog',1,20,'root.widgetCatalog','menu_home','Y','APP','N','icon-retail-gallery'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(5,'Admins',1,40,'root.admins','menu_admin','Y','APP','N','icon-content-star'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(6,'Roles',1,45,'root.roles','menu_acc_admin','Y','APP','N','icon-people-groupcollaboration'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(7,'Users',1,50,'root.users','menu_acc_admin','Y','APP','N','icon-people-groupcollaboration'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(8,'Portal Admins',1,60,'root.portalAdmins','menu_admin','Y','APP','N','icon-controls-settingsconnectedactivity'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(9,'Application Onboarding',1,70,'root.applications','menu_app_onboarding','Y','APP','N','icon-content-grid2'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(10,'Widget Onboarding',1,80,'root.widgetOnboarding','menu_admin','Y','APP','N','icon-content-grid2'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(11,'Edit Functional Menu',1,90,'root.functionalMenu','menu_admin','Y','APP','N','icon-misc-pen'); - -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(12,'User Notifications',1,100,'root.userNotifications','edit_notification','Y','APP','N','icon-controls-settingsconnectedactivity'); - --- end new 1702 - --- new 1707 -Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values (13,'Microservice Onboarding', 1, 110, 'root.microserviceOnboarding', 'menu_admin', 'Y', 'APP', 'N', 'icon-content-grid2'); -Insert into fn_menu (menu_id, label, parent_id, sort_order, action, function_cd, active_yn, menu_set_cd, separator_yn, image_src) - values(15,'App Account Management', 1, 130, 'root.accountOnboarding', 'menu_admin', 'Y', 'App', 'N', 'icon-content-grid2'); - --- end new 1707 - --- FN_LU_ALERT_METHOD -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('PHONE','Phone'); -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('FAX','Fax'); -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('PAGER','Pager'); -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('EMAIL','Email'); -Insert into fn_lu_alert_method (ALERT_METHOD_CD,ALERT_METHOD) values ('SMS','SMS'); - --- FN_LU_PRIORITY -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (10,'Low','Y',10); -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (20,'Normal','Y',20); -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (30,'High','Y',30); -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (40,'Urgent','Y',40); -Insert into fn_lu_priority (PRIORITY_ID,PRIORITY,ACTIVE_YN,SORT_ORDER) values (50,'Fatal','Y',50); - --- FN_LU_TAB_SET -Insert into fn_lu_tab_set (TAB_SET_CD,TAB_SET_NAME) values ('APP','Application Tabs'); - --- FN_LU_TIMEZONE -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (10,'US/Eastern','US/Eastern'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (20,'US/Central','US/Central'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (30,'US/Mountain','US/Mountain'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (40,'US/Arizona','America/Phoenix'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (50,'US/Pacific','US/Pacific'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (60,'US/Alaska','US/Alaska'); -Insert into fn_lu_timezone (TIMEZONE_ID,TIMEZONE_NAME,TIMEZONE_VALUE) values (70,'US/Hawaii','US/Hawaii'); - --- FN_RESTRICTED_URL -Insert into fn_restricted_url (restricted_url, function_cd) values ('attachment.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('broadcast.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('file_upload.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('job.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('role.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('role_function.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('test.htm','menu_admin'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('async_test.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('chatWindow.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('contact_list.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('customer_dynamic_list.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('event.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('event_list.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('mobile_welcome.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('sample_map.htm','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('template.jsp','menu_home'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('jbpm_designer.htm','menu_job_create'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('jbpm_drools.htm','menu_job_create'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('process_job.htm','menu_job_create'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('profile.htm','menu_profile_create'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor2.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor_blob_extract.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor_email_attachment.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor_search.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('report_list.htm','menu_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('gauge.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('gmap_controller.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('gmap_frame.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('map.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('map_download.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('map_grid_search.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('sample_animated_map.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('sample_map_2.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('sample_map_3.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab2_sub1.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab2_sub2_link1.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab2_sub2_link2.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab2_sub3.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab3.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('tab4.htm','menu_tab'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor.htm','view_reports'); -Insert into fn_restricted_url (restricted_url, function_cd) values ('raptor_blob_extract.htm','view_reports'); - --- FN_ROLE -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (1,'System Administrator','Y',1,NULL,NULL); -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (16,'Standard User','Y',5,NULL,NULL); -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (999,'Account Administrator','Y',1,NULL,NULL); -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (900,'Restricted App Role','Y','1',NULL,NULL); - --- new 1702 -Insert into fn_role (ROLE_ID, ROLE_NAME, ACTIVE_YN, PRIORITY, APP_ID, APP_ROLE_ID) values (950,'Portal Notification Admin','Y','1',NULL,NULL); --- end new 1702 - --- new 1707 -INSERT INTO fn_role (role_id, role_name, active_yn, priority) VALUES ('1010', 'Usage Analyst', 'Y', '1'); -INSERT INTO fn_role (role_id, role_name, active_yn, priority) VALUES ('2115', 'Portal Usage Analyst', 'Y', '6'); --- end new 1707 - --- FN_ROLE_Composite -Insert into fn_role_composite (PARENT_ROLE_ID,CHILD_ROLE_ID) values (1,16); - --- FN_ROLE_FUNCTION -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'login'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_admin'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_ajax'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_customer'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_customer_create'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_feedback'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_help'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_home'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_job'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_job_create'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_logout'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_notes'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_process'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_profile'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_profile_create'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_profile_import'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_reports'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_sample'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (1,'menu_tab'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'login'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_ajax'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_customer'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_customer_create'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_home'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_logout'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_map'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_profile'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_reports'); -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (16,'menu_tab'); - --- new 1702 -Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (950,'edit_notification'); -Insert INTO fn_role_function (ROLE_ID,FUNCTION_CD) values (950, 'getAdminNotifications'); -Insert INTO fn_role_function (ROLE_ID,FUNCTION_CD) values (950, 'saveNotification'); --- end new 1702 - --- new 1707 -INSERT INTO fn_role_function (role_id, function_cd) VALUES ('1010', 'menu_web_analytics'); -INSERT INTO fn_role_function (role_id, function_cd) VALUES ('2115', 'menu_web_analytics'); --- end new 1707 - --- FN_TAB -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB1_S1','Left Tab 1','Sub - Sub Tab 1 Information','tab2_sub1.htm','menu_tab','Y',10,'TAB2_SUB1','APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB1','Tab 1','Tab 1 Information','tab1.htm','menu_tab','Y',10,null,'APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2','Tab 2','Tab 2 Information','tab2_sub1.htm','menu_tab','Y',20,null,'APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB3','Tab 3','Tab 3 Information','tab3.htm','menu_tab','Y',30,null,'APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB4','Tab 4','Tab 4 Information','tab4.htm','menu_tab','Y',40,null,'APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB1','Sub Tab 1','Sub Tab 1 Information','tab2_sub1.htm','menu_tab','Y',10,'TAB2','APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB2','Sub Tab 2','Sub Tab 2 Information','tab2_sub2.htm','menu_tab','Y',20,'TAB2','APP'); -Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB3','Sub Tab 3','Sub Tab 3 Information','tab2_sub3.htm','menu_tab','Y',30,'TAB2','APP'); - --- FN_TAB_SELECTED -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB1','tab1'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2','tab2_sub1'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2','tab2_sub2'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2','tab2_sub3'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB1','tab2_sub1'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB1_S1','tab2_sub1'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB2','tab2_sub2'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB3','tab2_sub3'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB3','tab3'); -Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB4','tab4'); - -commit;
\ No newline at end of file diff --git a/ecomp-portal-DB-common/PortalDMLMySql_2_6_Common.sql b/ecomp-portal-DB-common/PortalDMLMySql_3_3_Common.sql index dcebc86a..6b974dec 100644 --- a/ecomp-portal-DB-common/PortalDMLMySql_2_6_Common.sql +++ b/ecomp-portal-DB-common/PortalDMLMySql_3_3_Common.sql @@ -1,5 +1,5 @@ -- -------------------------------------------------------------------------------------------- --- This is the common default data for 2.1.0 Version of Portal database called portal +-- This is the common default data for 3.3.0 Version of Portal database called portal USE portal; @@ -72,6 +72,11 @@ Insert INTO fn_function (function_cd,function_name) values ('saveNotification', INSERT INTO fn_function (function_cd, function_name) VALUES ('menu_web_analytics', 'Web Analytics'); -- end new 1707 +-- new 3_2 +insert into fn_function (function_cd, function_name) values ('menu_acc_admin', 'Account Admin Menu'); +insert into fn_function (function_cd, function_name) values ('menu_app_onboarding', 'App Onboarding menu'); +-- end new 3_2 + -- FN_LU_ACTIVITY Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('add_role','add_role'); Insert into fn_lu_activity (ACTIVITY_CD,ACTIVITY) values ('remove_role','remove_role'); @@ -117,45 +122,46 @@ Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE values(1,'root',NULL,10,NULL,'menu_home','N','APP','N',NULL); Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(2,'Home',1,10,'root.applicationsHome','menu_home','Y','APP','N','icon-building-home'); + values(2,'Home',1,10,'applicationsHome','menu_home','Y','APP','N','home'); Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(3,'Application Catalog',1,15,'root.appCatalog','menu_home','Y','APP','N','icon-retail-gallery'); + values(3,'Application Catalog',1,15,'appCatalog','menu_home','Y','APP','N','apps'); Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(4,'Widget Catalog',1,20,'root.widgetCatalog','menu_home','Y','APP','N','icon-retail-gallery'); + values(4,'Widget Catalog',1,20,'widgetCatalog','menu_home','Y','APP','N','apps'); Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(5,'Admins',1,40,'root.admins','menu_admin','Y','APP','N','icon-content-star'); + values(5,'Admins',1,40,'admins','menu_admin','Y','APP','N','star'); Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(6,'Roles',1,45,'root.roles','menu_acc_admin','Y','APP','N','icon-people-groupcollaboration'); + values(6,'Roles',1,45,'roles','menu_acc_admin','Y','APP','N','person'); Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(7,'Users',1,50,'root.users','menu_acc_admin','Y','APP','N','icon-people-groupcollaboration'); + values(7,'Users',1,50,'users','menu_acc_admin','Y','APP','N','person'); Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(8,'Portal Admins',1,60,'root.portalAdmins','menu_admin','Y','APP','N','icon-controls-settingsconnectedactivity'); + values(8,'Portal Admins',1,60,'portalAdmins','menu_admin','Y','APP','N','settings'); Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(9,'Application Onboarding',1,70,'root.applications','menu_app_onboarding','Y','APP','N','icon-content-grid2'); + values(9,'Application Onboarding',1,70,'applications','menu_app_onboarding','Y','APP','N','filing'); Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(10,'Widget Onboarding',1,80,'root.widgetOnboarding','menu_admin','Y','APP','N','icon-content-grid2'); + values(10,'Widget Onboarding',1,80,'widgetOnboarding','menu_admin','Y','APP','N','filing'); Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(11,'Edit Functional Menu',1,90,'root.functionalMenu','menu_admin','Y','APP','N','icon-misc-pen'); + values(11,'Edit Functional Menu',1,90,'functionalMenu','menu_admin','Y','APP','N','menu'); Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values(12,'User Notifications',1,100,'root.userNotifications','edit_notification','Y','APP','N','icon-controls-settingsconnectedactivity'); + values(12,'User Notifications',1,100,'userNotifications','edit_notification','Y','APP','N','settings'); -- end new 1702 -- new 1707 Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC) - values (13,'Microservice Onboarding', 1, 110, 'root.microserviceOnboarding', 'menu_admin', 'Y', 'APP', 'N', 'icon-content-grid2'); + values (13,'Microservice Onboarding', 1, 110, 'microserviceOnboarding', 'menu_admin', 'Y', 'APP', 'N', 'filing'); + Insert into fn_menu (menu_id, label, parent_id, sort_order, action, function_cd, active_yn, menu_set_cd, separator_yn, image_src) - values(15,'App Account Management', 1, 130, 'root.accountOnboarding', 'menu_admin', 'Y', 'App', 'N', 'icon-content-grid2'); + values(15,'App Account Management', 1, 130, 'accountOnboarding', 'menu_admin', 'Y', 'App', 'N', 'filing'); -- end new 1707 @@ -290,6 +296,11 @@ INSERT INTO fn_role_function (role_id, function_cd) VALUES ('1010', 'menu_web_an INSERT INTO fn_role_function (role_id, function_cd) VALUES ('2115', 'menu_web_analytics'); -- end new 1707 +-- new 3_2 +insert into fn_role_function (role_id, function_cd) values (16, 'menu_acc_admin'); +insert into fn_role_function (role_id, function_cd) values (16, 'menu_app_onboarding'); +-- end new 3_2 + -- FN_TAB Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB2_SUB1_S1','Left Tab 1','Sub - Sub Tab 1 Information','tab2_sub1.htm','menu_tab','Y',10,'TAB2_SUB1','APP'); Insert into fn_tab (TAB_CD,TAB_NAME,TAB_DESCR,ACTION,FUNCTION_CD,ACTIVE_YN,SORT_ORDER,PARENT_TAB_CD,TAB_SET_CD) values ('TAB1','Tab 1','Tab 1 Information','tab1.htm','menu_tab','Y',10,null,'APP'); @@ -312,4 +323,154 @@ Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB2_SUB3','tab2_ Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB3','tab3'); Insert into fn_tab_selected (SELECTED_TAB_CD,TAB_URI) values ('TAB4','tab4'); -commit;
\ No newline at end of file +UPDATE + fn_menu +SET + ACTION = 'webAnalytics', + image_src= 'pie' +WHERE + active_yn = 'Y' AND label = 'Web Analytics'; + + +UPDATE + fn_menu +SET + ACTION = 'webAnlayticsSource', + image_src= 'pie' +WHERE + active_yn = 'Y' AND label = 'Web Analytics Onboarding'; + + +UPDATE + fn_menu +SET + ACTION = 'applicationsHome', + image_src = 'home' +WHERE + active_yn = 'Y' AND label = 'Home'; + + +UPDATE + fn_menu +SET + ACTION = 'appCatalog', + image_src= 'apps' +WHERE + active_yn = 'Y' AND label = 'Application Catalog'; + + +UPDATE + fn_menu +SET + ACTION = 'widgetCatalog', + image_src= 'apps' +WHERE + active_yn = 'Y' AND label = 'Widget Catalog'; + +UPDATE + fn_menu +SET + ACTION = 'admins' , + image_src= 'star' +WHERE + active_yn = 'Y' AND label = 'Admins'; + +UPDATE + fn_menu +SET + ACTION = 'roles' , + image_src= 'person' +WHERE + active_yn = 'Y' AND label = 'Roles'; + + +UPDATE + fn_menu +SET + ACTION = 'users', + image_src= 'person' +WHERE + active_yn = 'Y' AND label = 'Users'; + + +UPDATE + fn_menu +SET + ACTION = 'portalAdmins', + image_src= 'settings' +WHERE + active_yn = 'Y' AND label = 'Portal Admins'; + + +UPDATE + fn_menu +SET + ACTION = 'applications', + image_src= 'filing' +WHERE + active_yn = 'Y' AND label = 'Application Onboarding'; + +UPDATE + fn_menu +SET + ACTION = 'widgetOnboarding', + image_src= 'filing' +WHERE + active_yn = 'Y' AND label = 'Widget Onboarding'; + +UPDATE + fn_menu +SET + ACTION = 'functionalMenu', + image_src= 'menu' +WHERE + active_yn = 'Y' AND label = 'Edit Functional Menu'; + + +UPDATE + fn_menu +SET + ACTION = 'userNotifications', + image_src= 'settings' +WHERE + active_yn = 'Y' AND label = 'User Notifications'; + + +UPDATE + fn_menu +SET + ACTION = 'microserviceOnboarding', + image_src= 'filing' +WHERE + active_yn = 'Y' AND label = 'Microservice Onboarding'; + + + +UPDATE + fn_menu +SET + ACTION = 'webAnalytics', + image_src= 'pie' +WHERE + active_yn = 'Y' AND label = 'Web Analytics'; + + +UPDATE + fn_menu +SET + ACTION = 'webAnlayticsSource', + image_src= 'pie' +WHERE + active_yn = 'Y' AND label = 'Web Analytics Onboarding'; + +UPDATE + fn_menu +SET + ACTION = 'accountOnboarding', + image_src= 'filing' +WHERE + active_yn = 'Y' AND label = 'App Account Management'; + + + +commit; diff --git a/ecomp-portal-DB-os/PortalDDLMySql_2_1_OS.sql b/ecomp-portal-DB-os/PortalDDLMySql_2_1_OS.sql deleted file mode 100644 index 8099aade..00000000 --- a/ecomp-portal-DB-os/PortalDDLMySql_2_1_OS.sql +++ /dev/null @@ -1,12 +0,0 @@ --- --------------------------------------------------------------------------------------------------------------- --- This script adds tables for the OPEN-SOURCE 2.1.0 version of the Portal database. --- The COMMON DDL script must be executed first! --- --------------------------------------------------------------------------------------------------------------- - -SET FOREIGN_KEY_CHECKS=1; - -USE portal; - --- No additional tables required at this time - -commit; diff --git a/ecomp-portal-DB-os/PortalDDLMySql_2_5_OS.sql b/ecomp-portal-DB-os/PortalDDLMySql_2_5_OS.sql deleted file mode 100644 index 8099aade..00000000 --- a/ecomp-portal-DB-os/PortalDDLMySql_2_5_OS.sql +++ /dev/null @@ -1,12 +0,0 @@ --- --------------------------------------------------------------------------------------------------------------- --- This script adds tables for the OPEN-SOURCE 2.1.0 version of the Portal database. --- The COMMON DDL script must be executed first! --- --------------------------------------------------------------------------------------------------------------- - -SET FOREIGN_KEY_CHECKS=1; - -USE portal; - --- No additional tables required at this time - -commit; diff --git a/ecomp-portal-DB-os/PortalDDLMySql_2_6_OS.sql b/ecomp-portal-DB-os/PortalDDLMySql_2_6_OS.sql deleted file mode 100644 index 8099aade..00000000 --- a/ecomp-portal-DB-os/PortalDDLMySql_2_6_OS.sql +++ /dev/null @@ -1,12 +0,0 @@ --- --------------------------------------------------------------------------------------------------------------- --- This script adds tables for the OPEN-SOURCE 2.1.0 version of the Portal database. --- The COMMON DDL script must be executed first! --- --------------------------------------------------------------------------------------------------------------- - -SET FOREIGN_KEY_CHECKS=1; - -USE portal; - --- No additional tables required at this time - -commit; diff --git a/ecomp-portal-DB-os/PortalDMLMySql_2_1_OS.sql b/ecomp-portal-DB-os/PortalDMLMySql_2_1_OS.sql deleted file mode 100644 index fcb89973..00000000 --- a/ecomp-portal-DB-os/PortalDMLMySql_2_1_OS.sql +++ /dev/null @@ -1,153 +0,0 @@ --- --------------------------------------------------------------------------------------------------------------- --- This is the default data for the 2.1.0 Version of Portal database called portal - the Opensource project --- First run the common Opensource DML; then run this file to add The Opensource only data -USE portal; - -set foreign_key_checks=1; - ---- update fn_menu for roles -UPDATE fn_menu -SET function_cd = 'menu_acc_admin' -WHERE label = 'Roles'; - ---- update fn_menu for users -UPDATE fn_menu -SET function_cd = 'menu_acc_admin' -WHERE label = 'Users'; - - --- fn_user -Insert into fn_user (USER_ID, ORG_ID, MANAGER_ID,FIRST_NAME,MIDDLE_NAME,LAST_NAME,PHONE,FAX,CELLULAR,EMAIL,ADDRESS_ID,ALERT_METHOD_CD,HRID,ORG_USER_ID,ORG_CODE,LOGIN_ID,LOGIN_PWD,LAST_LOGIN_DATE,ACTIVE_YN,CREATED_ID,CREATED_DATE,MODIFIED_ID,MODIFIED_DATE,IS_INTERNAL_YN,ADDRESS_LINE_1,ADDRESS_LINE_2,CITY,STATE_CD,ZIP_CODE,COUNTRY_CD,LOCATION_CLLI,ORG_MANAGER_USERID,COMPANY,DEPARTMENT_NAME,JOB_TITLE,TIMEZONE,DEPARTMENT,BUSINESS_UNIT,BUSINESS_UNIT_NAME,COST_CENTER,FIN_LOC_CODE,SILO_STATUS) values (1,NULL,NULL,'Demo',NULL,'User',NULL,NULL,NULL,'demo@openecomp.org',NULL,NULL,NULL,'demo',NULL,'demo','4Gl6WL1bmwviYm+XZa6pS1vC0qKXWtn9wcZWdLx61L0=','2016-10-20 15:11:16','Y',NULL,'2016-10-14 21:00:00',1,'2016-10-20 15:11:16','N',NULL,NULL,NULL,'NJ',NULL,'US',NULL,NULL,NULL,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL); - --- fn_appokYTaDrhzibcbGVq5mjkVQ== -Insert INTO fn_app (APP_ID, APP_NAME, APP_IMAGE_URL, APP_DESCRIPTION, APP_NOTES, APP_URL, APP_ALTERNATE_URL, APP_REST_ENDPOINT, ML_APP_NAME, ML_APP_ADMIN_ID, MOTS_ID, APP_PASSWORD, OPEN, ENABLED, THUMBNAIL, APP_USERNAME, UEB_KEY, UEB_SECRET, UEB_TOPIC_NAME, APP_TYPE, AUTH_CENTRAL, AUTH_NAMESPACE) values (1,'Default','assets/images/tmp/portal1.png','Some Default Description','Some Default Note','http://localhost','http://localhost','http://localhost:8080/ecompportal','EcompPortal','',NULL,'dR2NABMkxPaFbIbym87ZwQ==','N','N',NULL,'m00468@portal.onap.org','EkrqsjQqZt4ZrPh6',NULL,NULL,1,'Y',NULL); - --- fn_user_role -Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,1,NULL,1); -Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,950,NULL,1); -Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,999,NULL,1); - -INSERT INTO cr_report - (rep_id, title, descr, public_yn, report_xml, create_id, create_date, maint_id, maint_date, menu_id, menu_approved_yn, owner_id, folder_id, dashboard_type_yn, dashboard_yn) - VALUES ( - 15, - 'Application Usage Report Wid', - '', - 'Y', - '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<customReport pageSize="200" reportType="Linear">\n <reportName>Application Usage Report Wid</reportName>\n <reportDescr></reportDescr>\n <dbInfo>local</dbInfo>\n <dbType>mysql</dbType>\n <chartType>BarChart3D</chartType>\n <chartWidth>700</chartWidth>\n <chartHeight>500</chartHeight>\n <showChartTitle>false</showChartTitle>\n <public>false</public>\n <hideFormFieldAfterRun>false</hideFormFieldAfterRun>\n <createId>27</createId>\n <createDate>2017-01-28-05:00</createDate>\n <reportSQL>SELECT \n l.date audit_date, \n app_id app_id, \n IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name) app_name, \n IFNULL(r.ct,0) ct \nfrom\n(\n select a.Date, app_id, app_name\n from (\n select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as Date\n from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c\n ) a, \n (\n SELECT \n app_id, app_name\n from\n (\n select @rn := @rn+1 AS rowId, app_id, app_name from \n (\n select app_id, app_name, ct from \n (\n select affected_record_id, count(*) ct\n from fn_audit_log l\n where audit_date > date_add( curdate(), interval -6 day)\n and affected_record_id not in ( 1, -1)\n and activity_cd in (\'tab_access\', \'app_access\')\n and user_id = [USER_ID]\n group by affected_record_id\n ) a, fn_app f\n where a.affected_record_id = f.app_id\n order by ct desc \n ) b,\n (SELECT @rn := 0) t2\n ) mm where rowId <= 4\n )b\n where a.Date between date_add( curdate(), interval -6 day) and curdate()\n) l left outer join\n(\n select app_name, DATE(audit_date) audit_date_1 ,count(*) ct from fn_audit_log a, fn_app b\n where user_id = [USER_ID]\n and audit_date > date_add( curdate(), interval -6 day)\n and activity_cd in (\'tab_access\', \'app_access\')\n and a.affected_record_id = b.app_id\n and b.app_id <> 1\n and b.app_id in \n (\n SELECT \n app_id\n from\n (\n select @rn := @rn+1 AS rowId, app_id from \n (\n select app_id, ct from \n (\n select affected_record_id app_id, count(*) ct\n from fn_audit_log \n where audit_date > date_add( curdate(), interval -6 day)\n and affected_record_id not in ( 1, -1)\n and activity_cd in (\'tab_access\', \'app_access\')\n and user_id = [USER_ID]\n group by affected_record_id\n ) a\n order by ct desc \n ) b,\n (SELECT @rn := 0) t2\n ) mm \n )\n group by app_name, DATE(audit_date)\n) r\non l.Date = r.audit_date_1\nand l.app_name = r.app_name</reportSQL>\n <reportTitle></reportTitle>\n <reportSubTitle></reportSubTitle>\n <reportHeader></reportHeader>\n <frozenColumns>0</frozenColumns>\n <emptyMessage>Your Search didn\'t yield any results.</emptyMessage>\n <dataGridAlign>left</dataGridAlign>\n <reportFooter></reportFooter>\n <numFormCols>1</numFormCols>\n <displayOptions>NNNNNNN</displayOptions>\n <dataContainerHeight>100</dataContainerHeight>\n <dataContainerWidth>100</dataContainerWidth>\n <allowSchedule>N</allowSchedule>\n <multiGroupColumn>N</multiGroupColumn>\n <topDown>N</topDown>\n <sizedByContent>N</sizedByContent>\n <comment>N|</comment>\n <dataSourceList>\n <dataSource tableId="du0">\n <tableName>DUAL</tableName>\n <tablePK></tablePK>\n <displayName>DUAL</displayName>\n <dataColumnList>\n <dataColumn colId="audit_date">\n <tableId>du0</tableId>\n <dbColName>l.date</dbColName>\n <colName>l.date</colName>\n <displayName>audit_date_1</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>1</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>LEGEND</colOnChart>\n <chartSeq>1</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>false</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n </dataColumn>\n <dataColumn colId="app_id">\n <tableId>du0</tableId>\n <dbColName>app_id</dbColName>\n <colName>app_id</colName>\n <displayName>app_id</displayName>\n <displayWidth>10</displayWidth>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>2</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <dbColType>VARCHAR2</dbColType>\n </dataColumn>\n <dataColumn colId="app_name">\n <tableId>du0</tableId>\n <dbColName>IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</dbColName>\n <colName>IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</colName>\n <displayName>app_name</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>3</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <chartSeq>2</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>true</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n </dataColumn>\n <dataColumn colId="ct">\n <tableId>du0</tableId>\n <dbColName>IFNULL(r.ct,0)</dbColName>\n <colName>IFNULL(r.ct,0)</colName>\n <displayName>ct</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>4</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>0</colOnChart>\n <chartSeq>1</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>false</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n </dataColumn>\n </dataColumnList>\n </dataSource>\n </dataSourceList>\n <reportInNewWindow>false</reportInNewWindow>\n <displayFolderTree>false</displayFolderTree>\n <maxRowsInExcelDownload>500</maxRowsInExcelDownload>\n <chartAdditionalOptions>\n <chartOrientation>vertical</chartOrientation>\n <hidechartLegend>N</hidechartLegend>\n <legendPosition>bottom</legendPosition>\n <labelAngle>up90</labelAngle>\n <rangeAxisUpperLimit></rangeAxisUpperLimit>\n <rangeAxisLowerLimit></rangeAxisLowerLimit>\n <animate>true</animate>\n <animateAnimatedChart>true</animateAnimatedChart>\n <stacked>true</stacked>\n <barControls>false</barControls>\n <xAxisDateType>false</xAxisDateType>\n <lessXaxisTickers>false</lessXaxisTickers>\n <timeAxis>true</timeAxis>\n <logScale>false</logScale>\n <topMargin>30</topMargin>\n <bottomMargin>50</bottomMargin>\n <rightMargin>60</rightMargin>\n <leftMargin>100</leftMargin>\n </chartAdditionalOptions>\n <folderId>NULL</folderId>\n <isOneTimeScheduleAllowed>N</isOneTimeScheduleAllowed>\n <isHourlyScheduleAllowed>N</isHourlyScheduleAllowed>\n <isDailyScheduleAllowed>N</isDailyScheduleAllowed>\n <isDailyMFScheduleAllowed>N</isDailyMFScheduleAllowed>\n <isWeeklyScheduleAllowed>N</isWeeklyScheduleAllowed>\n <isMonthlyScheduleAllowed>N</isMonthlyScheduleAllowed>\n</customReport>\n', - 1, - now(), - 1, - now(), - '', - 'N', - (select user_id from fn_user where org_user_id = 'demo'), - NULL, - 'N', - 'N' - ); - --- new for 1707 -INSERT INTO cr_report - (rep_id, title, descr, public_yn, report_xml, create_id, create_date, maint_id, maint_date, menu_id, menu_approved_yn, owner_id, folder_id, dashboard_type_yn, dashboard_yn) - VALUES ( - 18, - 'Application Usage bar Wid', - '', - 'Y', - '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<customReport pageSize=\"200\" reportType=\"Linear\">\n <reportName>Application Usage Line Wid</reportName>\n <reportDescr></reportDescr>\n <dbInfo>local</dbInfo>\n <dbType>mysql</dbType>\n <chartType>TimeSeriesChart</chartType>\n <chartMultiSeries>N</chartMultiSeries>\n <chartWidth>700</chartWidth>\n <chartHeight>300</chartHeight>\n <showChartTitle>false</showChartTitle>\n <public>false</public>\n <hideFormFieldAfterRun>false</hideFormFieldAfterRun>\n <createId>27</createId>\n <createDate>2017-01-28-05:00</createDate>\n <reportSQL>SELECT \n l.date audit_date, \n IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name) app_name, \n IFNULL(r.ct,0) ct \nfrom\n(\n select a.Date, app_id, app_name\n from (\n select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as Date\n from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c\n ) a, \n (\n SELECT \n app_id, app_name\n from\n (\n select @rn := @rn+1 AS rowId, app_id, app_name from \n (\n select app_id, app_name, ct from \n (\n select affected_record_id, count(*) ct\n from fn_audit_log l\n where audit_date > date_add( curdate(), interval -30 day)\n and affected_record_id not in ( 1, -1)\n and activity_cd in (\'tab_access\', \'app_access\')\n and user_id = [USER_ID]\n group by affected_record_id\n ) a, fn_app f\n where a.affected_record_id = f.app_id\n order by ct desc \n ) b,\n (SELECT @rn := 0) t2\n ) mm where rowId <= 4\n )b\n where a.Date between date_add( curdate(), interval -30 day) and curdate()\n) l left outer join\n(\n select app_name, DATE(audit_date) audit_date_1 ,count(*) ct from fn_audit_log a, fn_app b\n where user_id = [USER_ID]\n and audit_date > date_add( curdate(), interval -30 day)\n and activity_cd in (\'tab_access\', \'app_access\')\n and a.affected_record_id = b.app_id\n and b.app_id <> 1\n and b.app_id in \n (\n SELECT \n app_id\n from\n (\n select @rn := @rn+1 AS rowId, app_id from \n (\n select app_id, ct from \n (\n select affected_record_id app_id, count(*) ct\n from fn_audit_log \n where audit_date > date_add( curdate(), interval -30 day)\n and affected_record_id not in ( 1, -1)\n and activity_cd in (\'tab_access\', \'app_access\')\n and user_id = [USER_ID]\n group by affected_record_id\n ) a\n order by ct desc \n ) b,\n (SELECT @rn := 0) t2\n ) mm \n )\n group by app_name, DATE(audit_date)\n) r\non l.Date = r.audit_date_1\nand l.app_name = r.app_name</reportSQL>\n <reportTitle></reportTitle>\n <reportSubTitle></reportSubTitle>\n <reportHeader></reportHeader>\n <frozenColumns>0</frozenColumns>\n <emptyMessage>Your Search didn\'t yield any results.</emptyMessage>\n <dataGridAlign>left</dataGridAlign>\n <reportFooter></reportFooter>\n <numFormCols>1</numFormCols>\n <displayOptions>NNNNNNN</displayOptions>\n <dataContainerHeight>100</dataContainerHeight>\n <dataContainerWidth>100</dataContainerWidth>\n <allowSchedule>N</allowSchedule>\n <multiGroupColumn>N</multiGroupColumn>\n <topDown>N</topDown>\n <sizedByContent>N</sizedByContent>\n <comment>N|</comment>\n <dataSourceList>\n <dataSource tableId=\"du0\">\n <tableName>DUAL</tableName>\n <tablePK></tablePK>\n <displayName>DUAL</displayName>\n <dataColumnList>\n <dataColumn colId=\"audit_date\">\n <tableId>du0</tableId>\n <dbColName>l.date</dbColName>\n <colName>l.date</colName>\n <displayName>audit_date_1</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>1</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>LEGEND</colOnChart>\n <chartSeq>1</chartSeq>\n <chartSeries>false</chartSeries>\n <isRangeAxisFilled>false</isRangeAxisFilled>\n <drillinPoPUp>false</drillinPoPUp>\n <dbColType>VARCHAR2</dbColType>\n <enhancedPagination>false</enhancedPagination>\n </dataColumn>\n <dataColumn colId=\"app_name\">\n <tableId>du0</tableId>\n <dbColName>IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</dbColName>\n <colName>IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</colName>\n <displayName>app_name</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>2</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>0</colOnChart>\n <chartSeq>2</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>true</chartSeries>\n <isRangeAxisFilled>false</isRangeAxisFilled>\n <drillinPoPUp>false</drillinPoPUp>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n <enhancedPagination>false</enhancedPagination>\n </dataColumn>\n <dataColumn colId=\"ct\">\n <tableId>du0</tableId>\n <dbColName>IFNULL(r.ct,0)</dbColName>\n <colName>IFNULL(r.ct,0)</colName>\n <displayName>ct</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>3</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>0</colOnChart>\n <chartSeq>1</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>false</chartSeries>\n <isRangeAxisFilled>false</isRangeAxisFilled>\n <drillinPoPUp>false</drillinPoPUp>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n <enhancedPagination>false</enhancedPagination>\n </dataColumn>\n </dataColumnList>\n </dataSource>\n </dataSourceList>\n <reportInNewWindow>false</reportInNewWindow>\n <displayFolderTree>false</displayFolderTree>\n <maxRowsInExcelDownload>500</maxRowsInExcelDownload>\n <chartAdditionalOptions>\n <chartOrientation>vertical</chartOrientation>\n <hidechartLegend>N</hidechartLegend>\n <legendPosition>bottom</legendPosition>\n <labelAngle>down45</labelAngle>\n <animate>true</animate>\n <animateAnimatedChart>true</animateAnimatedChart>\n <stacked>true</stacked>\n <barControls>false</barControls>\n <xAxisDateType>false</xAxisDateType>\n <lessXaxisTickers>false</lessXaxisTickers>\n <timeAxis>true</timeAxis>\n <timeSeriesRender>line</timeSeriesRender>\n <multiSeries>false</multiSeries>\n <showXAxisLabel>false</showXAxisLabel>\n <addXAxisTickers>false</addXAxisTickers>\n <topMargin>30</topMargin>\n <bottomMargin>50</bottomMargin>\n <rightMargin>60</rightMargin>\n <leftMargin>100</leftMargin>\n </chartAdditionalOptions>\n <folderId>NULL</folderId>\n <drillURLInPoPUpPresent>false</drillURLInPoPUpPresent>\n <isOneTimeScheduleAllowed>N</isOneTimeScheduleAllowed>\n <isHourlyScheduleAllowed>N</isHourlyScheduleAllowed>\n <isDailyScheduleAllowed>N</isDailyScheduleAllowed>\n <isDailyMFScheduleAllowed>N</isDailyMFScheduleAllowed>\n <isWeeklyScheduleAllowed>N</isWeeklyScheduleAllowed>\n <isMonthlyScheduleAllowed>N</isMonthlyScheduleAllowed>\n</customReport>\n', - 1, - now(), - 1, - now(), - '', - 'N', - (select user_id from fn_user where org_user_id = 'demo'), - NULL, - 'N', - 'N' - ); - -INSERT INTO cr_report - (rep_id, title, descr, public_yn, report_xml, create_id, create_date, maint_id, maint_date, menu_id, menu_approved_yn, owner_id, folder_id, dashboard_type_yn, dashboard_yn) - VALUES ( - 20, - 'Average time spend on portal', - '', - 'Y', - '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<customReport pageSize=\"200\" reportType=\"Linear\">\n <reportName>Average time spend on portal</reportName>\n <reportDescr></reportDescr>\n <dbInfo>local</dbInfo>\n <dbType>mysql</dbType>\n <chartType>TimeSeriesChart</chartType>\n <chartMultiSeries>N</chartMultiSeries>\n <chartWidth>700</chartWidth>\n <chartHeight>300</chartHeight>\n <showChartTitle>false</showChartTitle>\n <public>true</public>\n <hideFormFieldAfterRun>false</hideFormFieldAfterRun>\n <createId>27</createId>\n <createDate>2017-01-28-05:00</createDate>\n <reportSQL>SELECT \n d.dat audit_date, \n \'# of Minutes\' app, \n coalesce(diff, null, 0) mins \nfrom\n(\n select * from\n (\n select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as dat\n from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c \n ) d where d.dat between date_add( curdate(), interval -30 day) and curdate()\n) d left outer join\n(\n select dat, mi, mx, TIMESTAMPDIFF(MINUTE, coalesce(mi, null, 0), coalesce(mx, null, 0)) + 30 diff\n from\n (\n select DATE(audit_date) dat, coalesce(min(audit_date), null, 0) mi, coalesce(max(audit_date), null, 0) mx\n from fn_audit_log \n where user_id = [USER_ID] and DATE(audit_date) between CURDATE()-300 and CURDATE()\n group by DATE(audit_date)\n ) a\n) a\non a.dat = d.dat\norder by 1</reportSQL>\n <reportTitle></reportTitle>\n <reportSubTitle></reportSubTitle>\n <reportHeader></reportHeader>\n <frozenColumns>0</frozenColumns>\n <emptyMessage>Your Search didn\'t yield any results.</emptyMessage>\n <dataGridAlign>left</dataGridAlign>\n <reportFooter></reportFooter>\n <numFormCols>1</numFormCols>\n <displayOptions>NNNNNNN</displayOptions>\n <dataContainerHeight>100</dataContainerHeight>\n <dataContainerWidth>100</dataContainerWidth>\n <allowSchedule>N</allowSchedule>\n <multiGroupColumn>N</multiGroupColumn>\n <topDown>N</topDown>\n <sizedByContent>N</sizedByContent>\n <comment>N|</comment>\n <dataSourceList>\n <dataSource tableId=\"du0\">\n <tableName>DUAL</tableName>\n <tablePK></tablePK>\n <displayName>DUAL</displayName>\n <dataColumnList>\n <dataColumn colId=\"audit_date\">\n <tableId>du0</tableId>\n <dbColName>d.dat</dbColName>\n <colName>d.dat</colName>\n <displayName>audit_date_1</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>1</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>LEGEND</colOnChart>\n <chartSeq>1</chartSeq>\n <chartSeries>false</chartSeries>\n <isRangeAxisFilled>false</isRangeAxisFilled>\n <drillinPoPUp>false</drillinPoPUp>\n <dbColType>VARCHAR2</dbColType>\n <enhancedPagination>false</enhancedPagination>\n </dataColumn>\n <dataColumn colId=\"app\">\n <tableId>du0</tableId>\n <dbColName>\'# of Minutes\'</dbColName>\n <colName>\'# of Minutes\'</colName>\n <displayName>app</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>2</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <chartSeries>true</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n </dataColumn>\n <dataColumn colId=\"mins\">\n <tableId>du0</tableId>\n <dbColName>coalesce(diff, null, 0)</dbColName>\n <colName>coalesce(diff, null, 0)</colName>\n <displayName>mins</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>3</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>0</colOnChart>\n <chartSeq>1</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>false</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n </dataColumn>\n </dataColumnList>\n </dataSource>\n </dataSourceList>\n <reportInNewWindow>false</reportInNewWindow>\n <displayFolderTree>false</displayFolderTree>\n <maxRowsInExcelDownload>500</maxRowsInExcelDownload>\n <chartAdditionalOptions>\n <chartOrientation>vertical</chartOrientation>\n <hidechartLegend>N</hidechartLegend>\n <legendPosition>bottom</legendPosition>\n <labelAngle>down45</labelAngle>\n <animate>true</animate>\n <animateAnimatedChart>true</animateAnimatedChart>\n <stacked>true</stacked>\n <barControls>false</barControls>\n <xAxisDateType>false</xAxisDateType>\n <lessXaxisTickers>false</lessXaxisTickers>\n <timeAxis>true</timeAxis>\n <timeSeriesRender>line</timeSeriesRender>\n <multiSeries>false</multiSeries>\n <showXAxisLabel>false</showXAxisLabel>\n <addXAxisTickers>false</addXAxisTickers>\n <topMargin>30</topMargin>\n <bottomMargin>50</bottomMargin>\n <rightMargin>60</rightMargin>\n <leftMargin>100</leftMargin>\n </chartAdditionalOptions>\n <folderId>NULL</folderId>\n <drillURLInPoPUpPresent>false</drillURLInPoPUpPresent>\n <isOneTimeScheduleAllowed>N</isOneTimeScheduleAllowed>\n <isHourlyScheduleAllowed>N</isHourlyScheduleAllowed>\n <isDailyScheduleAllowed>N</isDailyScheduleAllowed>\n <isDailyMFScheduleAllowed>N</isDailyMFScheduleAllowed>\n <isWeeklyScheduleAllowed>N</isWeeklyScheduleAllowed>\n <isMonthlyScheduleAllowed>N</isMonthlyScheduleAllowed>\n</customReport>\n', - 1, - now(), - 1, - now(), - '', - 'N', - (select user_id from fn_user where org_user_id = 'demo'), - NULL, - 'N', - 'N' - ); - - -insert into ep_app_function (app_id, function_cd, function_name) values -(1, 'url|edit_notification|*', 'User Notification'), -(1, 'url|getAdminNotifications|*', 'Admin Notifications'), -(1, 'url|login|*', 'Login'), -(1, 'menu|menu_admin|*','Admin Menu'), -(1,'menu|menu_home|*','Home Menu'), -(1, 'menu|menu_logout|*','Logout Menu'), -(1, 'menu|menu_web_analytics|*','Web Analytics'), -(1, 'url|saveNotification|*','publish notifications'), -(1, 'url|url_role.htm|*','role page'), -(1, 'url|url_welcome.htm|*','welcome page'), -(1, 'menu|menu_acc_admin|*','Admin Account Menu'), -(1,'url|addWebAnalyticsReport|*','Add Web Analytics Report'), -(1,'url|appsFullList|*','Apps Full List'), -(1,'url|centralizedApps|*','Centralized Apps'), -(1,'url|functionalMenu|*','Functional Menu'), -(1,'url|getAllWebAnalytics|*','Get All Web Analytics'), -(1,'url|getFunctionalMenuRole|*','Get Functional Menu Role'), -(1,'url|getNotificationAppRoles|*','Get Notification App Roles'), -(1,'url|getUserAppsWebAnalytics|*','Get User Apps Web Analytics'), -(1,'url|getUserJourneyAnalyticsReport|*','Get User Journey Report'), -(1,'url|get_roles%2f%2a|*','getRolesOfApp'), -(1,'url|get_role_functions%2f%2a|*','Get Role Functions'), -(1,'url|notification_code|*','Notification Code'), -(1,'url|role_function_list%2fsaveRoleFunction%2f%2a|*','Save Role Function'), -(1,'url|syncRoles|*','SyncRoles'), -(1,'url|userAppRoles|*','userAppRoles'), -(1,'url|userApps|*','User Apps') -; - - -insert into ep_app_role_function (id, app_id, role_id, function_cd, role_app_id) values -(1, 1, 1, 'url|login|*', null), -(2, 1, 1, 'menu|menu_admin|*', null), -(3, 1, 1, 'menu|menu_home|*', null), -(4, 1, 1, 'menu|menu_logout|*', null), -(5, 1, 16, 'url|login|*', null), -(6, 1, 16, 'menu|menu_home|*', null), -(7, 1, 16, 'menu|menu_logout|*', null), -(8, 1, 950, 'url|edit_notification|*', null), -(9, 1, 950, 'url|getAdminNotifications|*', null), -(10,1, 950, 'url|saveNotification|*', null), -(11,1, 999,'url|userAppRoles|*', null), -(12,1, 999, 'url|getAdminNotifications|*', null), -(13,1, 999,'url|userApps|*', null), -(14,1, 1010, 'menu|menu_web_analytics|*', null), -(15, 1, 2115, 'menu|menu_web_analytics|*', null), -(16, 1 , 1, 'menu|menu_acc_admin|*' , null), -(17, 1 , 999 ,'menu|menu_acc_admin|*', null), -(18,1,999,'url|centralizedApps|*', null), -(19,1,999,'url|getAllWebAnalytics|*', null), -(20,1,999,'url|getFunctionalMenuRole|*', null), -(21,1,999,'url|getNotificationAppRoles|*', null), -(22,1,999,'url|getUserAppsWebAnalytics|*', null), -(23,1,999,'url|getUserJourneyAnalyticsReport|*', null), -(24,1,999,'url|get_roles%2f%2a|*', null), -(25,1,999,'url|get_role_functions%2f%2a|*', null), -(26,1,999,'url|notification_code|*', null), -(27,1,999,'url|role_function_list%2fsaveRoleFunction%2f%2a|*', null), -(28,1,999,'url|syncRoles|*', null); - -commit;
\ No newline at end of file diff --git a/ecomp-portal-DB-os/PortalDMLMySql_2_5_OS.sql b/ecomp-portal-DB-os/PortalDMLMySql_2_5_OS.sql deleted file mode 100644 index f0359ae6..00000000 --- a/ecomp-portal-DB-os/PortalDMLMySql_2_5_OS.sql +++ /dev/null @@ -1,153 +0,0 @@ --- --------------------------------------------------------------------------------------------------------------- --- This is the default data for the 2.1.0 Version of Portal database called portal - the Opensource project --- First run the common Opensource DML; then run this file to add The Opensource only data -USE portal; - -set foreign_key_checks=1; - ---- update fn_menu for roles -UPDATE fn_menu -SET function_cd = 'menu_acc_admin' -WHERE label = 'Roles'; - ---- update fn_menu for users -UPDATE fn_menu -SET function_cd = 'menu_acc_admin' -WHERE label = 'Users'; - - --- fn_user -Insert into fn_user (USER_ID, ORG_ID, MANAGER_ID,FIRST_NAME,MIDDLE_NAME,LAST_NAME,PHONE,FAX,CELLULAR,EMAIL,ADDRESS_ID,ALERT_METHOD_CD,HRID,ORG_USER_ID,ORG_CODE,LOGIN_ID,LOGIN_PWD,LAST_LOGIN_DATE,ACTIVE_YN,CREATED_ID,CREATED_DATE,MODIFIED_ID,MODIFIED_DATE,IS_INTERNAL_YN,ADDRESS_LINE_1,ADDRESS_LINE_2,CITY,STATE_CD,ZIP_CODE,COUNTRY_CD,LOCATION_CLLI,ORG_MANAGER_USERID,COMPANY,DEPARTMENT_NAME,JOB_TITLE,TIMEZONE,DEPARTMENT,BUSINESS_UNIT,BUSINESS_UNIT_NAME,COST_CENTER,FIN_LOC_CODE,SILO_STATUS,is_system_user) values (1,NULL,NULL,'Demo',NULL,'User',NULL,NULL,NULL,'demo@openecomp.org',NULL,NULL,NULL,'demo',NULL,'demo','4Gl6WL1bmwviYm+XZa6pS1vC0qKXWtn9wcZWdLx61L0=','2016-10-20 15:11:16','Y',NULL,'2016-10-14 21:00:00',1,'2016-10-20 15:11:16','N',NULL,NULL,NULL,'NJ',NULL,'US',NULL,NULL,NULL,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,'N'); - --- fn_appokYTaDrhzibcbGVq5mjkVQ== -Insert INTO fn_app (APP_ID, APP_NAME, APP_IMAGE_URL, APP_DESCRIPTION, APP_NOTES, APP_URL, APP_ALTERNATE_URL, APP_REST_ENDPOINT, ML_APP_NAME, ML_APP_ADMIN_ID, MOTS_ID, APP_PASSWORD, OPEN, ENABLED, THUMBNAIL, APP_USERNAME, UEB_KEY, UEB_SECRET, UEB_TOPIC_NAME, APP_TYPE, AUTH_CENTRAL, AUTH_NAMESPACE) values (1,'Default','assets/images/tmp/portal1.png','Some Default Description','Some Default Note','http://localhost','http://localhost','http://localhost:8080/ecompportal','EcompPortal','',NULL,'dR2NABMkxPaFbIbym87ZwQ==','N','N',NULL,'m00468@portal.onap.org','EkrqsjQqZt4ZrPh6',NULL,NULL,1,'Y',NULL); - --- fn_user_role -Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,1,NULL,1); -Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,950,NULL,1); -Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,999,NULL,1); - -INSERT INTO cr_report - (rep_id, title, descr, public_yn, report_xml, create_id, create_date, maint_id, maint_date, menu_id, menu_approved_yn, owner_id, folder_id, dashboard_type_yn, dashboard_yn) - VALUES ( - 15, - 'Application Usage Report Wid', - '', - 'Y', - '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<customReport pageSize="200" reportType="Linear">\n <reportName>Application Usage Report Wid</reportName>\n <reportDescr></reportDescr>\n <dbInfo>local</dbInfo>\n <dbType>mysql</dbType>\n <chartType>BarChart3D</chartType>\n <chartWidth>700</chartWidth>\n <chartHeight>500</chartHeight>\n <showChartTitle>false</showChartTitle>\n <public>false</public>\n <hideFormFieldAfterRun>false</hideFormFieldAfterRun>\n <createId>27</createId>\n <createDate>2017-01-28-05:00</createDate>\n <reportSQL>SELECT \n l.date audit_date, \n app_id app_id, \n IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name) app_name, \n IFNULL(r.ct,0) ct \nfrom\n(\n select a.Date, app_id, app_name\n from (\n select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as Date\n from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c\n ) a, \n (\n SELECT \n app_id, app_name\n from\n (\n select @rn := @rn+1 AS rowId, app_id, app_name from \n (\n select app_id, app_name, ct from \n (\n select affected_record_id, count(*) ct\n from fn_audit_log l\n where audit_date > date_add( curdate(), interval -6 day)\n and affected_record_id not in ( 1, -1)\n and activity_cd in (\'tab_access\', \'app_access\')\n and user_id = [USER_ID]\n group by affected_record_id\n ) a, fn_app f\n where a.affected_record_id = f.app_id\n order by ct desc \n ) b,\n (SELECT @rn := 0) t2\n ) mm where rowId <= 4\n )b\n where a.Date between date_add( curdate(), interval -6 day) and curdate()\n) l left outer join\n(\n select app_name, DATE(audit_date) audit_date_1 ,count(*) ct from fn_audit_log a, fn_app b\n where user_id = [USER_ID]\n and audit_date > date_add( curdate(), interval -6 day)\n and activity_cd in (\'tab_access\', \'app_access\')\n and a.affected_record_id = b.app_id\n and b.app_id <> 1\n and b.app_id in \n (\n SELECT \n app_id\n from\n (\n select @rn := @rn+1 AS rowId, app_id from \n (\n select app_id, ct from \n (\n select affected_record_id app_id, count(*) ct\n from fn_audit_log \n where audit_date > date_add( curdate(), interval -6 day)\n and affected_record_id not in ( 1, -1)\n and activity_cd in (\'tab_access\', \'app_access\')\n and user_id = [USER_ID]\n group by affected_record_id\n ) a\n order by ct desc \n ) b,\n (SELECT @rn := 0) t2\n ) mm \n )\n group by app_name, DATE(audit_date)\n) r\non l.Date = r.audit_date_1\nand l.app_name = r.app_name</reportSQL>\n <reportTitle></reportTitle>\n <reportSubTitle></reportSubTitle>\n <reportHeader></reportHeader>\n <frozenColumns>0</frozenColumns>\n <emptyMessage>Your Search didn\'t yield any results.</emptyMessage>\n <dataGridAlign>left</dataGridAlign>\n <reportFooter></reportFooter>\n <numFormCols>1</numFormCols>\n <displayOptions>NNNNNNN</displayOptions>\n <dataContainerHeight>100</dataContainerHeight>\n <dataContainerWidth>100</dataContainerWidth>\n <allowSchedule>N</allowSchedule>\n <multiGroupColumn>N</multiGroupColumn>\n <topDown>N</topDown>\n <sizedByContent>N</sizedByContent>\n <comment>N|</comment>\n <dataSourceList>\n <dataSource tableId="du0">\n <tableName>DUAL</tableName>\n <tablePK></tablePK>\n <displayName>DUAL</displayName>\n <dataColumnList>\n <dataColumn colId="audit_date">\n <tableId>du0</tableId>\n <dbColName>l.date</dbColName>\n <colName>l.date</colName>\n <displayName>audit_date_1</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>1</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>LEGEND</colOnChart>\n <chartSeq>1</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>false</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n </dataColumn>\n <dataColumn colId="app_id">\n <tableId>du0</tableId>\n <dbColName>app_id</dbColName>\n <colName>app_id</colName>\n <displayName>app_id</displayName>\n <displayWidth>10</displayWidth>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>2</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <dbColType>VARCHAR2</dbColType>\n </dataColumn>\n <dataColumn colId="app_name">\n <tableId>du0</tableId>\n <dbColName>IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</dbColName>\n <colName>IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</colName>\n <displayName>app_name</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>3</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <chartSeq>2</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>true</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n </dataColumn>\n <dataColumn colId="ct">\n <tableId>du0</tableId>\n <dbColName>IFNULL(r.ct,0)</dbColName>\n <colName>IFNULL(r.ct,0)</colName>\n <displayName>ct</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>4</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>0</colOnChart>\n <chartSeq>1</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>false</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n </dataColumn>\n </dataColumnList>\n </dataSource>\n </dataSourceList>\n <reportInNewWindow>false</reportInNewWindow>\n <displayFolderTree>false</displayFolderTree>\n <maxRowsInExcelDownload>500</maxRowsInExcelDownload>\n <chartAdditionalOptions>\n <chartOrientation>vertical</chartOrientation>\n <hidechartLegend>N</hidechartLegend>\n <legendPosition>bottom</legendPosition>\n <labelAngle>up90</labelAngle>\n <rangeAxisUpperLimit></rangeAxisUpperLimit>\n <rangeAxisLowerLimit></rangeAxisLowerLimit>\n <animate>true</animate>\n <animateAnimatedChart>true</animateAnimatedChart>\n <stacked>true</stacked>\n <barControls>false</barControls>\n <xAxisDateType>false</xAxisDateType>\n <lessXaxisTickers>false</lessXaxisTickers>\n <timeAxis>true</timeAxis>\n <logScale>false</logScale>\n <topMargin>30</topMargin>\n <bottomMargin>50</bottomMargin>\n <rightMargin>60</rightMargin>\n <leftMargin>100</leftMargin>\n </chartAdditionalOptions>\n <folderId>NULL</folderId>\n <isOneTimeScheduleAllowed>N</isOneTimeScheduleAllowed>\n <isHourlyScheduleAllowed>N</isHourlyScheduleAllowed>\n <isDailyScheduleAllowed>N</isDailyScheduleAllowed>\n <isDailyMFScheduleAllowed>N</isDailyMFScheduleAllowed>\n <isWeeklyScheduleAllowed>N</isWeeklyScheduleAllowed>\n <isMonthlyScheduleAllowed>N</isMonthlyScheduleAllowed>\n</customReport>\n', - 1, - now(), - 1, - now(), - '', - 'N', - (select user_id from fn_user where org_user_id = 'demo'), - NULL, - 'N', - 'N' - ); - --- new for 1707 -INSERT INTO cr_report - (rep_id, title, descr, public_yn, report_xml, create_id, create_date, maint_id, maint_date, menu_id, menu_approved_yn, owner_id, folder_id, dashboard_type_yn, dashboard_yn) - VALUES ( - 18, - 'Application Usage bar Wid', - '', - 'Y', - '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<customReport pageSize=\"200\" reportType=\"Linear\">\n <reportName>Application Usage Line Wid</reportName>\n <reportDescr></reportDescr>\n <dbInfo>local</dbInfo>\n <dbType>mysql</dbType>\n <chartType>TimeSeriesChart</chartType>\n <chartMultiSeries>N</chartMultiSeries>\n <chartWidth>700</chartWidth>\n <chartHeight>300</chartHeight>\n <showChartTitle>false</showChartTitle>\n <public>false</public>\n <hideFormFieldAfterRun>false</hideFormFieldAfterRun>\n <createId>27</createId>\n <createDate>2017-01-28-05:00</createDate>\n <reportSQL>SELECT \n l.date audit_date, \n IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name) app_name, \n IFNULL(r.ct,0) ct \nfrom\n(\n select a.Date, app_id, app_name\n from (\n select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as Date\n from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c\n ) a, \n (\n SELECT \n app_id, app_name\n from\n (\n select @rn := @rn+1 AS rowId, app_id, app_name from \n (\n select app_id, app_name, ct from \n (\n select affected_record_id, count(*) ct\n from fn_audit_log l\n where audit_date > date_add( curdate(), interval -30 day)\n and affected_record_id not in ( 1, -1)\n and activity_cd in (\'tab_access\', \'app_access\')\n and user_id = [USER_ID]\n group by affected_record_id\n ) a, fn_app f\n where a.affected_record_id = f.app_id\n order by ct desc \n ) b,\n (SELECT @rn := 0) t2\n ) mm where rowId <= 4\n )b\n where a.Date between date_add( curdate(), interval -30 day) and curdate()\n) l left outer join\n(\n select app_name, DATE(audit_date) audit_date_1 ,count(*) ct from fn_audit_log a, fn_app b\n where user_id = [USER_ID]\n and audit_date > date_add( curdate(), interval -30 day)\n and activity_cd in (\'tab_access\', \'app_access\')\n and a.affected_record_id = b.app_id\n and b.app_id <> 1\n and b.app_id in \n (\n SELECT \n app_id\n from\n (\n select @rn := @rn+1 AS rowId, app_id from \n (\n select app_id, ct from \n (\n select affected_record_id app_id, count(*) ct\n from fn_audit_log \n where audit_date > date_add( curdate(), interval -30 day)\n and affected_record_id not in ( 1, -1)\n and activity_cd in (\'tab_access\', \'app_access\')\n and user_id = [USER_ID]\n group by affected_record_id\n ) a\n order by ct desc \n ) b,\n (SELECT @rn := 0) t2\n ) mm \n )\n group by app_name, DATE(audit_date)\n) r\non l.Date = r.audit_date_1\nand l.app_name = r.app_name</reportSQL>\n <reportTitle></reportTitle>\n <reportSubTitle></reportSubTitle>\n <reportHeader></reportHeader>\n <frozenColumns>0</frozenColumns>\n <emptyMessage>Your Search didn\'t yield any results.</emptyMessage>\n <dataGridAlign>left</dataGridAlign>\n <reportFooter></reportFooter>\n <numFormCols>1</numFormCols>\n <displayOptions>NNNNNNN</displayOptions>\n <dataContainerHeight>100</dataContainerHeight>\n <dataContainerWidth>100</dataContainerWidth>\n <allowSchedule>N</allowSchedule>\n <multiGroupColumn>N</multiGroupColumn>\n <topDown>N</topDown>\n <sizedByContent>N</sizedByContent>\n <comment>N|</comment>\n <dataSourceList>\n <dataSource tableId=\"du0\">\n <tableName>DUAL</tableName>\n <tablePK></tablePK>\n <displayName>DUAL</displayName>\n <dataColumnList>\n <dataColumn colId=\"audit_date\">\n <tableId>du0</tableId>\n <dbColName>l.date</dbColName>\n <colName>l.date</colName>\n <displayName>audit_date_1</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>1</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>LEGEND</colOnChart>\n <chartSeq>1</chartSeq>\n <chartSeries>false</chartSeries>\n <isRangeAxisFilled>false</isRangeAxisFilled>\n <drillinPoPUp>false</drillinPoPUp>\n <dbColType>VARCHAR2</dbColType>\n <enhancedPagination>false</enhancedPagination>\n </dataColumn>\n <dataColumn colId=\"app_name\">\n <tableId>du0</tableId>\n <dbColName>IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</dbColName>\n <colName>IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</colName>\n <displayName>app_name</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>2</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>0</colOnChart>\n <chartSeq>2</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>true</chartSeries>\n <isRangeAxisFilled>false</isRangeAxisFilled>\n <drillinPoPUp>false</drillinPoPUp>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n <enhancedPagination>false</enhancedPagination>\n </dataColumn>\n <dataColumn colId=\"ct\">\n <tableId>du0</tableId>\n <dbColName>IFNULL(r.ct,0)</dbColName>\n <colName>IFNULL(r.ct,0)</colName>\n <displayName>ct</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>3</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>0</colOnChart>\n <chartSeq>1</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>false</chartSeries>\n <isRangeAxisFilled>false</isRangeAxisFilled>\n <drillinPoPUp>false</drillinPoPUp>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n <enhancedPagination>false</enhancedPagination>\n </dataColumn>\n </dataColumnList>\n </dataSource>\n </dataSourceList>\n <reportInNewWindow>false</reportInNewWindow>\n <displayFolderTree>false</displayFolderTree>\n <maxRowsInExcelDownload>500</maxRowsInExcelDownload>\n <chartAdditionalOptions>\n <chartOrientation>vertical</chartOrientation>\n <hidechartLegend>N</hidechartLegend>\n <legendPosition>bottom</legendPosition>\n <labelAngle>down45</labelAngle>\n <animate>true</animate>\n <animateAnimatedChart>true</animateAnimatedChart>\n <stacked>true</stacked>\n <barControls>false</barControls>\n <xAxisDateType>false</xAxisDateType>\n <lessXaxisTickers>false</lessXaxisTickers>\n <timeAxis>true</timeAxis>\n <timeSeriesRender>line</timeSeriesRender>\n <multiSeries>false</multiSeries>\n <showXAxisLabel>false</showXAxisLabel>\n <addXAxisTickers>false</addXAxisTickers>\n <topMargin>30</topMargin>\n <bottomMargin>50</bottomMargin>\n <rightMargin>60</rightMargin>\n <leftMargin>100</leftMargin>\n </chartAdditionalOptions>\n <folderId>NULL</folderId>\n <drillURLInPoPUpPresent>false</drillURLInPoPUpPresent>\n <isOneTimeScheduleAllowed>N</isOneTimeScheduleAllowed>\n <isHourlyScheduleAllowed>N</isHourlyScheduleAllowed>\n <isDailyScheduleAllowed>N</isDailyScheduleAllowed>\n <isDailyMFScheduleAllowed>N</isDailyMFScheduleAllowed>\n <isWeeklyScheduleAllowed>N</isWeeklyScheduleAllowed>\n <isMonthlyScheduleAllowed>N</isMonthlyScheduleAllowed>\n</customReport>\n', - 1, - now(), - 1, - now(), - '', - 'N', - (select user_id from fn_user where org_user_id = 'demo'), - NULL, - 'N', - 'N' - ); - -INSERT INTO cr_report - (rep_id, title, descr, public_yn, report_xml, create_id, create_date, maint_id, maint_date, menu_id, menu_approved_yn, owner_id, folder_id, dashboard_type_yn, dashboard_yn) - VALUES ( - 20, - 'Average time spend on portal', - '', - 'Y', - '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<customReport pageSize=\"200\" reportType=\"Linear\">\n <reportName>Average time spend on portal</reportName>\n <reportDescr></reportDescr>\n <dbInfo>local</dbInfo>\n <dbType>mysql</dbType>\n <chartType>TimeSeriesChart</chartType>\n <chartMultiSeries>N</chartMultiSeries>\n <chartWidth>700</chartWidth>\n <chartHeight>300</chartHeight>\n <showChartTitle>false</showChartTitle>\n <public>true</public>\n <hideFormFieldAfterRun>false</hideFormFieldAfterRun>\n <createId>27</createId>\n <createDate>2017-01-28-05:00</createDate>\n <reportSQL>SELECT \n d.dat audit_date, \n \'# of Minutes\' app, \n coalesce(diff, null, 0) mins \nfrom\n(\n select * from\n (\n select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as dat\n from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c \n ) d where d.dat between date_add( curdate(), interval -30 day) and curdate()\n) d left outer join\n(\n select dat, mi, mx, TIMESTAMPDIFF(MINUTE, coalesce(mi, null, 0), coalesce(mx, null, 0)) + 30 diff\n from\n (\n select DATE(audit_date) dat, coalesce(min(audit_date), null, 0) mi, coalesce(max(audit_date), null, 0) mx\n from fn_audit_log \n where user_id = [USER_ID] and DATE(audit_date) between CURDATE()-300 and CURDATE()\n group by DATE(audit_date)\n ) a\n) a\non a.dat = d.dat\norder by 1</reportSQL>\n <reportTitle></reportTitle>\n <reportSubTitle></reportSubTitle>\n <reportHeader></reportHeader>\n <frozenColumns>0</frozenColumns>\n <emptyMessage>Your Search didn\'t yield any results.</emptyMessage>\n <dataGridAlign>left</dataGridAlign>\n <reportFooter></reportFooter>\n <numFormCols>1</numFormCols>\n <displayOptions>NNNNNNN</displayOptions>\n <dataContainerHeight>100</dataContainerHeight>\n <dataContainerWidth>100</dataContainerWidth>\n <allowSchedule>N</allowSchedule>\n <multiGroupColumn>N</multiGroupColumn>\n <topDown>N</topDown>\n <sizedByContent>N</sizedByContent>\n <comment>N|</comment>\n <dataSourceList>\n <dataSource tableId=\"du0\">\n <tableName>DUAL</tableName>\n <tablePK></tablePK>\n <displayName>DUAL</displayName>\n <dataColumnList>\n <dataColumn colId=\"audit_date\">\n <tableId>du0</tableId>\n <dbColName>d.dat</dbColName>\n <colName>d.dat</colName>\n <displayName>audit_date_1</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>1</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>LEGEND</colOnChart>\n <chartSeq>1</chartSeq>\n <chartSeries>false</chartSeries>\n <isRangeAxisFilled>false</isRangeAxisFilled>\n <drillinPoPUp>false</drillinPoPUp>\n <dbColType>VARCHAR2</dbColType>\n <enhancedPagination>false</enhancedPagination>\n </dataColumn>\n <dataColumn colId=\"app\">\n <tableId>du0</tableId>\n <dbColName>\'# of Minutes\'</dbColName>\n <colName>\'# of Minutes\'</colName>\n <displayName>app</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>2</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <chartSeries>true</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n </dataColumn>\n <dataColumn colId=\"mins\">\n <tableId>du0</tableId>\n <dbColName>coalesce(diff, null, 0)</dbColName>\n <colName>coalesce(diff, null, 0)</colName>\n <displayName>mins</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>3</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>0</colOnChart>\n <chartSeq>1</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>false</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n </dataColumn>\n </dataColumnList>\n </dataSource>\n </dataSourceList>\n <reportInNewWindow>false</reportInNewWindow>\n <displayFolderTree>false</displayFolderTree>\n <maxRowsInExcelDownload>500</maxRowsInExcelDownload>\n <chartAdditionalOptions>\n <chartOrientation>vertical</chartOrientation>\n <hidechartLegend>N</hidechartLegend>\n <legendPosition>bottom</legendPosition>\n <labelAngle>down45</labelAngle>\n <animate>true</animate>\n <animateAnimatedChart>true</animateAnimatedChart>\n <stacked>true</stacked>\n <barControls>false</barControls>\n <xAxisDateType>false</xAxisDateType>\n <lessXaxisTickers>false</lessXaxisTickers>\n <timeAxis>true</timeAxis>\n <timeSeriesRender>line</timeSeriesRender>\n <multiSeries>false</multiSeries>\n <showXAxisLabel>false</showXAxisLabel>\n <addXAxisTickers>false</addXAxisTickers>\n <topMargin>30</topMargin>\n <bottomMargin>50</bottomMargin>\n <rightMargin>60</rightMargin>\n <leftMargin>100</leftMargin>\n </chartAdditionalOptions>\n <folderId>NULL</folderId>\n <drillURLInPoPUpPresent>false</drillURLInPoPUpPresent>\n <isOneTimeScheduleAllowed>N</isOneTimeScheduleAllowed>\n <isHourlyScheduleAllowed>N</isHourlyScheduleAllowed>\n <isDailyScheduleAllowed>N</isDailyScheduleAllowed>\n <isDailyMFScheduleAllowed>N</isDailyMFScheduleAllowed>\n <isWeeklyScheduleAllowed>N</isWeeklyScheduleAllowed>\n <isMonthlyScheduleAllowed>N</isMonthlyScheduleAllowed>\n</customReport>\n', - 1, - now(), - 1, - now(), - '', - 'N', - (select user_id from fn_user where org_user_id = 'demo'), - NULL, - 'N', - 'N' - ); - - -insert into ep_app_function (app_id, function_cd, function_name) values -(1, 'url|edit_notification|*', 'User Notification'), -(1, 'url|getAdminNotifications|*', 'Admin Notifications'), -(1, 'url|login|*', 'Login'), -(1, 'menu|menu_admin|*','Admin Menu'), -(1,'menu|menu_home|*','Home Menu'), -(1, 'menu|menu_logout|*','Logout Menu'), -(1, 'menu|menu_web_analytics|*','Web Analytics'), -(1, 'url|saveNotification|*','publish notifications'), -(1, 'url|url_role.htm|*','role page'), -(1, 'url|url_welcome.htm|*','welcome page'), -(1, 'menu|menu_acc_admin|*','Admin Account Menu'), -(1,'url|addWebAnalyticsReport|*','Add Web Analytics Report'), -(1,'url|appsFullList|*','Apps Full List'), -(1,'url|centralizedApps|*','Centralized Apps'), -(1,'url|functionalMenu|*','Functional Menu'), -(1,'url|getAllWebAnalytics|*','Get All Web Analytics'), -(1,'url|getFunctionalMenuRole|*','Get Functional Menu Role'), -(1,'url|getNotificationAppRoles|*','Get Notification App Roles'), -(1,'url|getUserAppsWebAnalytics|*','Get User Apps Web Analytics'), -(1,'url|getUserJourneyAnalyticsReport|*','Get User Journey Report'), -(1,'url|get_roles%2f%2a|*','getRolesOfApp'), -(1,'url|get_role_functions%2f%2a|*','Get Role Functions'), -(1,'url|notification_code|*','Notification Code'), -(1,'url|role_function_list%2fsaveRoleFunction%2f%2a|*','Save Role Function'), -(1,'url|syncRoles|*','SyncRoles'), -(1,'url|userAppRoles|*','userAppRoles'), -(1,'url|userApps|*','User Apps') -; - - -insert into ep_app_role_function (id, app_id, role_id, function_cd, role_app_id) values -(1, 1, 1, 'url|login|*', null), -(2, 1, 1, 'menu|menu_admin|*', null), -(3, 1, 1, 'menu|menu_home|*', null), -(4, 1, 1, 'menu|menu_logout|*', null), -(5, 1, 16, 'url|login|*', null), -(6, 1, 16, 'menu|menu_home|*', null), -(7, 1, 16, 'menu|menu_logout|*', null), -(8, 1, 950, 'url|edit_notification|*', null), -(9, 1, 950, 'url|getAdminNotifications|*', null), -(10,1, 950, 'url|saveNotification|*', null), -(11,1, 999,'url|userAppRoles|*', null), -(12,1, 999, 'url|getAdminNotifications|*', null), -(13,1, 999,'url|userApps|*', null), -(14,1, 1010, 'menu|menu_web_analytics|*', null), -(15, 1, 2115, 'menu|menu_web_analytics|*', null), -(16, 1 , 1, 'menu|menu_acc_admin|*' , null), -(17, 1 , 999 ,'menu|menu_acc_admin|*', null), -(18,1,999,'url|centralizedApps|*', null), -(19,1,999,'url|getAllWebAnalytics|*', null), -(20,1,999,'url|getFunctionalMenuRole|*', null), -(21,1,999,'url|getNotificationAppRoles|*', null), -(22,1,999,'url|getUserAppsWebAnalytics|*', null), -(23,1,999,'url|getUserJourneyAnalyticsReport|*', null), -(24,1,999,'url|get_roles%2f%2a|*', null), -(25,1,999,'url|get_role_functions%2f%2a|*', null), -(26,1,999,'url|notification_code|*', null), -(27,1,999,'url|role_function_list%2fsaveRoleFunction%2f%2a|*', null), -(28,1,999,'url|syncRoles|*', null); - -commit;
\ No newline at end of file diff --git a/ecomp-portal-DB-os/PortalDMLMySql_2_6_OS.sql b/ecomp-portal-DB-os/PortalDMLMySql_2_6_OS.sql deleted file mode 100644 index cbc24411..00000000 --- a/ecomp-portal-DB-os/PortalDMLMySql_2_6_OS.sql +++ /dev/null @@ -1,156 +0,0 @@ --- --------------------------------------------------------------------------------------------------------------- --- This is the default data for the 2.1.0 Version of Portal database called portal - the Opensource project --- First run the common Opensource DML; then run this file to add The Opensource only data -USE portal; - -set foreign_key_checks=1; - ---- update fn_menu for roles -UPDATE fn_menu -SET function_cd = 'menu_acc_admin' -WHERE label = 'Roles'; - ---- update fn_menu for users -UPDATE fn_menu -SET function_cd = 'menu_acc_admin' -WHERE label = 'Users'; - - --- fn_user -Insert into fn_user (USER_ID, ORG_ID, MANAGER_ID,FIRST_NAME,MIDDLE_NAME,LAST_NAME,PHONE,FAX,CELLULAR,EMAIL,ADDRESS_ID,ALERT_METHOD_CD,HRID,ORG_USER_ID,ORG_CODE,LOGIN_ID,LOGIN_PWD,LAST_LOGIN_DATE,ACTIVE_YN,CREATED_ID,CREATED_DATE,MODIFIED_ID,MODIFIED_DATE,IS_INTERNAL_YN,ADDRESS_LINE_1,ADDRESS_LINE_2,CITY,STATE_CD,ZIP_CODE,COUNTRY_CD,LOCATION_CLLI,ORG_MANAGER_USERID,COMPANY,DEPARTMENT_NAME,JOB_TITLE,TIMEZONE,DEPARTMENT,BUSINESS_UNIT,BUSINESS_UNIT_NAME,COST_CENTER,FIN_LOC_CODE,SILO_STATUS,is_system_user,language_id) values (1,NULL,NULL,'Demo',NULL,'User',NULL,NULL,NULL,'demo@openecomp.org',NULL,NULL,NULL,'demo',NULL,'demo','4Gl6WL1bmwviYm+XZa6pS1vC0qKXWtn9wcZWdLx61L0=','2016-10-20 15:11:16','Y',NULL,'2016-10-14 21:00:00',1,'2016-10-20 15:11:16','N',NULL,NULL,NULL,'NJ',NULL,'US',NULL,NULL,NULL,NULL,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,'N',1); - --- fn_appokYTaDrhzibcbGVq5mjkVQ== -Insert INTO fn_app (APP_ID, APP_NAME, APP_IMAGE_URL, APP_DESCRIPTION, APP_NOTES, APP_URL, APP_ALTERNATE_URL, APP_REST_ENDPOINT, ML_APP_NAME, ML_APP_ADMIN_ID, MOTS_ID, APP_PASSWORD, OPEN, ENABLED, THUMBNAIL, APP_USERNAME, UEB_KEY, UEB_SECRET, UEB_TOPIC_NAME, APP_TYPE, AUTH_CENTRAL, AUTH_NAMESPACE) values (1,'Default','assets/images/tmp/portal1.png','Some Default Description','Some Default Note','http://localhost','http://localhost','http://localhost:8080/ecompportal','EcompPortal','',NULL,'dR2NABMkxPaFbIbym87ZwQ==','N','N',NULL,'m00468@portal.onap.org','EkrqsjQqZt4ZrPh6',NULL,NULL,1,'Y',NULL); - --- fn_user_role -Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,1,NULL,1); -Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,950,NULL,1); -Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,999,NULL,1); - -INSERT INTO cr_report - (rep_id, title, descr, public_yn, report_xml, create_id, create_date, maint_id, maint_date, menu_id, menu_approved_yn, owner_id, folder_id, dashboard_type_yn, dashboard_yn) - VALUES ( - 15, - 'Application Usage Report Wid', - '', - 'Y', - '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<customReport pageSize="200" reportType="Linear">\n <reportName>Application Usage Report Wid</reportName>\n <reportDescr></reportDescr>\n <dbInfo>local</dbInfo>\n <dbType>mysql</dbType>\n <chartType>BarChart3D</chartType>\n <chartWidth>700</chartWidth>\n <chartHeight>500</chartHeight>\n <showChartTitle>false</showChartTitle>\n <public>false</public>\n <hideFormFieldAfterRun>false</hideFormFieldAfterRun>\n <createId>27</createId>\n <createDate>2017-01-28-05:00</createDate>\n <reportSQL>SELECT \n l.date audit_date, \n app_id app_id, \n IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name) app_name, \n IFNULL(r.ct,0) ct \nfrom\n(\n select a.Date, app_id, app_name\n from (\n select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as Date\n from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c\n ) a, \n (\n SELECT \n app_id, app_name\n from\n (\n select @rn := @rn+1 AS rowId, app_id, app_name from \n (\n select app_id, app_name, ct from \n (\n select affected_record_id, count(*) ct\n from fn_audit_log l\n where audit_date > date_add( curdate(), interval -6 day)\n and affected_record_id not in ( 1, -1)\n and activity_cd in (\'tab_access\', \'app_access\')\n and user_id = [USER_ID]\n group by affected_record_id\n ) a, fn_app f\n where a.affected_record_id = f.app_id\n order by ct desc \n ) b,\n (SELECT @rn := 0) t2\n ) mm where rowId <= 4\n )b\n where a.Date between date_add( curdate(), interval -6 day) and curdate()\n) l left outer join\n(\n select app_name, DATE(audit_date) audit_date_1 ,count(*) ct from fn_audit_log a, fn_app b\n where user_id = [USER_ID]\n and audit_date > date_add( curdate(), interval -6 day)\n and activity_cd in (\'tab_access\', \'app_access\')\n and a.affected_record_id = b.app_id\n and b.app_id <> 1\n and b.app_id in \n (\n SELECT \n app_id\n from\n (\n select @rn := @rn+1 AS rowId, app_id from \n (\n select app_id, ct from \n (\n select affected_record_id app_id, count(*) ct\n from fn_audit_log \n where audit_date > date_add( curdate(), interval -6 day)\n and affected_record_id not in ( 1, -1)\n and activity_cd in (\'tab_access\', \'app_access\')\n and user_id = [USER_ID]\n group by affected_record_id\n ) a\n order by ct desc \n ) b,\n (SELECT @rn := 0) t2\n ) mm \n )\n group by app_name, DATE(audit_date)\n) r\non l.Date = r.audit_date_1\nand l.app_name = r.app_name</reportSQL>\n <reportTitle></reportTitle>\n <reportSubTitle></reportSubTitle>\n <reportHeader></reportHeader>\n <frozenColumns>0</frozenColumns>\n <emptyMessage>Your Search didn\'t yield any results.</emptyMessage>\n <dataGridAlign>left</dataGridAlign>\n <reportFooter></reportFooter>\n <numFormCols>1</numFormCols>\n <displayOptions>NNNNNNN</displayOptions>\n <dataContainerHeight>100</dataContainerHeight>\n <dataContainerWidth>100</dataContainerWidth>\n <allowSchedule>N</allowSchedule>\n <multiGroupColumn>N</multiGroupColumn>\n <topDown>N</topDown>\n <sizedByContent>N</sizedByContent>\n <comment>N|</comment>\n <dataSourceList>\n <dataSource tableId="du0">\n <tableName>DUAL</tableName>\n <tablePK></tablePK>\n <displayName>DUAL</displayName>\n <dataColumnList>\n <dataColumn colId="audit_date">\n <tableId>du0</tableId>\n <dbColName>l.date</dbColName>\n <colName>l.date</colName>\n <displayName>audit_date_1</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>1</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>LEGEND</colOnChart>\n <chartSeq>1</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>false</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n </dataColumn>\n <dataColumn colId="app_id">\n <tableId>du0</tableId>\n <dbColName>app_id</dbColName>\n <colName>app_id</colName>\n <displayName>app_id</displayName>\n <displayWidth>10</displayWidth>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>2</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <dbColType>VARCHAR2</dbColType>\n </dataColumn>\n <dataColumn colId="app_name">\n <tableId>du0</tableId>\n <dbColName>IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</dbColName>\n <colName>IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</colName>\n <displayName>app_name</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>3</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <chartSeq>2</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>true</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n </dataColumn>\n <dataColumn colId="ct">\n <tableId>du0</tableId>\n <dbColName>IFNULL(r.ct,0)</dbColName>\n <colName>IFNULL(r.ct,0)</colName>\n <displayName>ct</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>4</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>0</colOnChart>\n <chartSeq>1</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>false</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n </dataColumn>\n </dataColumnList>\n </dataSource>\n </dataSourceList>\n <reportInNewWindow>false</reportInNewWindow>\n <displayFolderTree>false</displayFolderTree>\n <maxRowsInExcelDownload>500</maxRowsInExcelDownload>\n <chartAdditionalOptions>\n <chartOrientation>vertical</chartOrientation>\n <hidechartLegend>N</hidechartLegend>\n <legendPosition>bottom</legendPosition>\n <labelAngle>up90</labelAngle>\n <rangeAxisUpperLimit></rangeAxisUpperLimit>\n <rangeAxisLowerLimit></rangeAxisLowerLimit>\n <animate>true</animate>\n <animateAnimatedChart>true</animateAnimatedChart>\n <stacked>true</stacked>\n <barControls>false</barControls>\n <xAxisDateType>false</xAxisDateType>\n <lessXaxisTickers>false</lessXaxisTickers>\n <timeAxis>true</timeAxis>\n <logScale>false</logScale>\n <topMargin>30</topMargin>\n <bottomMargin>50</bottomMargin>\n <rightMargin>60</rightMargin>\n <leftMargin>100</leftMargin>\n </chartAdditionalOptions>\n <folderId>NULL</folderId>\n <isOneTimeScheduleAllowed>N</isOneTimeScheduleAllowed>\n <isHourlyScheduleAllowed>N</isHourlyScheduleAllowed>\n <isDailyScheduleAllowed>N</isDailyScheduleAllowed>\n <isDailyMFScheduleAllowed>N</isDailyMFScheduleAllowed>\n <isWeeklyScheduleAllowed>N</isWeeklyScheduleAllowed>\n <isMonthlyScheduleAllowed>N</isMonthlyScheduleAllowed>\n</customReport>\n', - 1, - now(), - 1, - now(), - '', - 'N', - (select user_id from fn_user where org_user_id = 'demo'), - NULL, - 'N', - 'N' - ); - --- new for 1707 -INSERT INTO cr_report - (rep_id, title, descr, public_yn, report_xml, create_id, create_date, maint_id, maint_date, menu_id, menu_approved_yn, owner_id, folder_id, dashboard_type_yn, dashboard_yn) - VALUES ( - 18, - 'Application Usage bar Wid', - '', - 'Y', - '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<customReport pageSize=\"200\" reportType=\"Linear\">\n <reportName>Application Usage Line Wid</reportName>\n <reportDescr></reportDescr>\n <dbInfo>local</dbInfo>\n <dbType>mysql</dbType>\n <chartType>TimeSeriesChart</chartType>\n <chartMultiSeries>N</chartMultiSeries>\n <chartWidth>700</chartWidth>\n <chartHeight>300</chartHeight>\n <showChartTitle>false</showChartTitle>\n <public>false</public>\n <hideFormFieldAfterRun>false</hideFormFieldAfterRun>\n <createId>27</createId>\n <createDate>2017-01-28-05:00</createDate>\n <reportSQL>SELECT \n l.date audit_date, \n IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name) app_name, \n IFNULL(r.ct,0) ct \nfrom\n(\n select a.Date, app_id, app_name\n from (\n select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as Date\n from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c\n ) a, \n (\n SELECT \n app_id, app_name\n from\n (\n select @rn := @rn+1 AS rowId, app_id, app_name from \n (\n select app_id, app_name, ct from \n (\n select affected_record_id, count(*) ct\n from fn_audit_log l\n where audit_date > date_add( curdate(), interval -30 day)\n and affected_record_id not in ( 1, -1)\n and activity_cd in (\'tab_access\', \'app_access\')\n and user_id = [USER_ID]\n group by affected_record_id\n ) a, fn_app f\n where a.affected_record_id = f.app_id\n order by ct desc \n ) b,\n (SELECT @rn := 0) t2\n ) mm where rowId <= 4\n )b\n where a.Date between date_add( curdate(), interval -30 day) and curdate()\n) l left outer join\n(\n select app_name, DATE(audit_date) audit_date_1 ,count(*) ct from fn_audit_log a, fn_app b\n where user_id = [USER_ID]\n and audit_date > date_add( curdate(), interval -30 day)\n and activity_cd in (\'tab_access\', \'app_access\')\n and a.affected_record_id = b.app_id\n and b.app_id <> 1\n and b.app_id in \n (\n SELECT \n app_id\n from\n (\n select @rn := @rn+1 AS rowId, app_id from \n (\n select app_id, ct from \n (\n select affected_record_id app_id, count(*) ct\n from fn_audit_log \n where audit_date > date_add( curdate(), interval -30 day)\n and affected_record_id not in ( 1, -1)\n and activity_cd in (\'tab_access\', \'app_access\')\n and user_id = [USER_ID]\n group by affected_record_id\n ) a\n order by ct desc \n ) b,\n (SELECT @rn := 0) t2\n ) mm \n )\n group by app_name, DATE(audit_date)\n) r\non l.Date = r.audit_date_1\nand l.app_name = r.app_name</reportSQL>\n <reportTitle></reportTitle>\n <reportSubTitle></reportSubTitle>\n <reportHeader></reportHeader>\n <frozenColumns>0</frozenColumns>\n <emptyMessage>Your Search didn\'t yield any results.</emptyMessage>\n <dataGridAlign>left</dataGridAlign>\n <reportFooter></reportFooter>\n <numFormCols>1</numFormCols>\n <displayOptions>NNNNNNN</displayOptions>\n <dataContainerHeight>100</dataContainerHeight>\n <dataContainerWidth>100</dataContainerWidth>\n <allowSchedule>N</allowSchedule>\n <multiGroupColumn>N</multiGroupColumn>\n <topDown>N</topDown>\n <sizedByContent>N</sizedByContent>\n <comment>N|</comment>\n <dataSourceList>\n <dataSource tableId=\"du0\">\n <tableName>DUAL</tableName>\n <tablePK></tablePK>\n <displayName>DUAL</displayName>\n <dataColumnList>\n <dataColumn colId=\"audit_date\">\n <tableId>du0</tableId>\n <dbColName>l.date</dbColName>\n <colName>l.date</colName>\n <displayName>audit_date_1</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>1</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>LEGEND</colOnChart>\n <chartSeq>1</chartSeq>\n <chartSeries>false</chartSeries>\n <isRangeAxisFilled>false</isRangeAxisFilled>\n <drillinPoPUp>false</drillinPoPUp>\n <dbColType>VARCHAR2</dbColType>\n <enhancedPagination>false</enhancedPagination>\n </dataColumn>\n <dataColumn colId=\"app_name\">\n <tableId>du0</tableId>\n <dbColName>IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</dbColName>\n <colName>IF(CHAR_LENGTH(l.app_name) >14, CONCAT(CONCAT(SUBSTR(l.app_name,1,7),\'...\'), SUBSTR(l.app_name, CHAR_LENGTH(l.app_name)-3,CHAR_LENGTH(l.app_name))) , l.app_name)</colName>\n <displayName>app_name</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>2</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>0</colOnChart>\n <chartSeq>2</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>true</chartSeries>\n <isRangeAxisFilled>false</isRangeAxisFilled>\n <drillinPoPUp>false</drillinPoPUp>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n <enhancedPagination>false</enhancedPagination>\n </dataColumn>\n <dataColumn colId=\"ct\">\n <tableId>du0</tableId>\n <dbColName>IFNULL(r.ct,0)</dbColName>\n <colName>IFNULL(r.ct,0)</colName>\n <displayName>ct</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>3</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>0</colOnChart>\n <chartSeq>1</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>false</chartSeries>\n <isRangeAxisFilled>false</isRangeAxisFilled>\n <drillinPoPUp>false</drillinPoPUp>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n <enhancedPagination>false</enhancedPagination>\n </dataColumn>\n </dataColumnList>\n </dataSource>\n </dataSourceList>\n <reportInNewWindow>false</reportInNewWindow>\n <displayFolderTree>false</displayFolderTree>\n <maxRowsInExcelDownload>500</maxRowsInExcelDownload>\n <chartAdditionalOptions>\n <chartOrientation>vertical</chartOrientation>\n <hidechartLegend>N</hidechartLegend>\n <legendPosition>bottom</legendPosition>\n <labelAngle>down45</labelAngle>\n <animate>true</animate>\n <animateAnimatedChart>true</animateAnimatedChart>\n <stacked>true</stacked>\n <barControls>false</barControls>\n <xAxisDateType>false</xAxisDateType>\n <lessXaxisTickers>false</lessXaxisTickers>\n <timeAxis>true</timeAxis>\n <timeSeriesRender>line</timeSeriesRender>\n <multiSeries>false</multiSeries>\n <showXAxisLabel>false</showXAxisLabel>\n <addXAxisTickers>false</addXAxisTickers>\n <topMargin>30</topMargin>\n <bottomMargin>50</bottomMargin>\n <rightMargin>60</rightMargin>\n <leftMargin>100</leftMargin>\n </chartAdditionalOptions>\n <folderId>NULL</folderId>\n <drillURLInPoPUpPresent>false</drillURLInPoPUpPresent>\n <isOneTimeScheduleAllowed>N</isOneTimeScheduleAllowed>\n <isHourlyScheduleAllowed>N</isHourlyScheduleAllowed>\n <isDailyScheduleAllowed>N</isDailyScheduleAllowed>\n <isDailyMFScheduleAllowed>N</isDailyMFScheduleAllowed>\n <isWeeklyScheduleAllowed>N</isWeeklyScheduleAllowed>\n <isMonthlyScheduleAllowed>N</isMonthlyScheduleAllowed>\n</customReport>\n', - 1, - now(), - 1, - now(), - '', - 'N', - (select user_id from fn_user where org_user_id = 'demo'), - NULL, - 'N', - 'N' - ); - -INSERT INTO cr_report - (rep_id, title, descr, public_yn, report_xml, create_id, create_date, maint_id, maint_date, menu_id, menu_approved_yn, owner_id, folder_id, dashboard_type_yn, dashboard_yn) - VALUES ( - 20, - 'Average time spend on portal', - '', - 'Y', - '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<customReport pageSize=\"200\" reportType=\"Linear\">\n <reportName>Average time spend on portal</reportName>\n <reportDescr></reportDescr>\n <dbInfo>local</dbInfo>\n <dbType>mysql</dbType>\n <chartType>TimeSeriesChart</chartType>\n <chartMultiSeries>N</chartMultiSeries>\n <chartWidth>700</chartWidth>\n <chartHeight>300</chartHeight>\n <showChartTitle>false</showChartTitle>\n <public>true</public>\n <hideFormFieldAfterRun>false</hideFormFieldAfterRun>\n <createId>27</createId>\n <createDate>2017-01-28-05:00</createDate>\n <reportSQL>SELECT \n d.dat audit_date, \n \'# of Minutes\' app, \n coalesce(diff, null, 0) mins \nfrom\n(\n select * from\n (\n select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as dat\n from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b\n cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c \n ) d where d.dat between date_add( curdate(), interval -30 day) and curdate()\n) d left outer join\n(\n select dat, mi, mx, TIMESTAMPDIFF(MINUTE, coalesce(mi, null, 0), coalesce(mx, null, 0)) + 30 diff\n from\n (\n select DATE(audit_date) dat, coalesce(min(audit_date), null, 0) mi, coalesce(max(audit_date), null, 0) mx\n from fn_audit_log \n where user_id = [USER_ID] and DATE(audit_date) between CURDATE()-300 and CURDATE()\n group by DATE(audit_date)\n ) a\n) a\non a.dat = d.dat\norder by 1</reportSQL>\n <reportTitle></reportTitle>\n <reportSubTitle></reportSubTitle>\n <reportHeader></reportHeader>\n <frozenColumns>0</frozenColumns>\n <emptyMessage>Your Search didn\'t yield any results.</emptyMessage>\n <dataGridAlign>left</dataGridAlign>\n <reportFooter></reportFooter>\n <numFormCols>1</numFormCols>\n <displayOptions>NNNNNNN</displayOptions>\n <dataContainerHeight>100</dataContainerHeight>\n <dataContainerWidth>100</dataContainerWidth>\n <allowSchedule>N</allowSchedule>\n <multiGroupColumn>N</multiGroupColumn>\n <topDown>N</topDown>\n <sizedByContent>N</sizedByContent>\n <comment>N|</comment>\n <dataSourceList>\n <dataSource tableId=\"du0\">\n <tableName>DUAL</tableName>\n <tablePK></tablePK>\n <displayName>DUAL</displayName>\n <dataColumnList>\n <dataColumn colId=\"audit_date\">\n <tableId>du0</tableId>\n <dbColName>d.dat</dbColName>\n <colName>d.dat</colName>\n <displayName>audit_date_1</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>1</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>LEGEND</colOnChart>\n <chartSeq>1</chartSeq>\n <chartSeries>false</chartSeries>\n <isRangeAxisFilled>false</isRangeAxisFilled>\n <drillinPoPUp>false</drillinPoPUp>\n <dbColType>VARCHAR2</dbColType>\n <enhancedPagination>false</enhancedPagination>\n </dataColumn>\n <dataColumn colId=\"app\">\n <tableId>du0</tableId>\n <dbColName>\'# of Minutes\'</dbColName>\n <colName>\'# of Minutes\'</colName>\n <displayName>app</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>2</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <chartSeries>true</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n </dataColumn>\n <dataColumn colId=\"mins\">\n <tableId>du0</tableId>\n <dbColName>coalesce(diff, null, 0)</dbColName>\n <colName>coalesce(diff, null, 0)</colName>\n <displayName>mins</displayName>\n <displayWidth>10</displayWidth>\n <displayWidthInPxls>nullpxpx</displayWidthInPxls>\n <displayAlignment>Left</displayAlignment>\n <orderSeq>3</orderSeq>\n <visible>true</visible>\n <calculated>true</calculated>\n <colType>VARCHAR2</colType>\n <groupBreak>false</groupBreak>\n <colOnChart>0</colOnChart>\n <chartSeq>1</chartSeq>\n <chartColor></chartColor>\n <chartLineType></chartLineType>\n <chartSeries>false</chartSeries>\n <dbColType>VARCHAR2</dbColType>\n <chartGroup></chartGroup>\n <yAxis></yAxis>\n </dataColumn>\n </dataColumnList>\n </dataSource>\n </dataSourceList>\n <reportInNewWindow>false</reportInNewWindow>\n <displayFolderTree>false</displayFolderTree>\n <maxRowsInExcelDownload>500</maxRowsInExcelDownload>\n <chartAdditionalOptions>\n <chartOrientation>vertical</chartOrientation>\n <hidechartLegend>N</hidechartLegend>\n <legendPosition>bottom</legendPosition>\n <labelAngle>down45</labelAngle>\n <animate>true</animate>\n <animateAnimatedChart>true</animateAnimatedChart>\n <stacked>true</stacked>\n <barControls>false</barControls>\n <xAxisDateType>false</xAxisDateType>\n <lessXaxisTickers>false</lessXaxisTickers>\n <timeAxis>true</timeAxis>\n <timeSeriesRender>line</timeSeriesRender>\n <multiSeries>false</multiSeries>\n <showXAxisLabel>false</showXAxisLabel>\n <addXAxisTickers>false</addXAxisTickers>\n <topMargin>30</topMargin>\n <bottomMargin>50</bottomMargin>\n <rightMargin>60</rightMargin>\n <leftMargin>100</leftMargin>\n </chartAdditionalOptions>\n <folderId>NULL</folderId>\n <drillURLInPoPUpPresent>false</drillURLInPoPUpPresent>\n <isOneTimeScheduleAllowed>N</isOneTimeScheduleAllowed>\n <isHourlyScheduleAllowed>N</isHourlyScheduleAllowed>\n <isDailyScheduleAllowed>N</isDailyScheduleAllowed>\n <isDailyMFScheduleAllowed>N</isDailyMFScheduleAllowed>\n <isWeeklyScheduleAllowed>N</isWeeklyScheduleAllowed>\n <isMonthlyScheduleAllowed>N</isMonthlyScheduleAllowed>\n</customReport>\n', - 1, - now(), - 1, - now(), - '', - 'N', - (select user_id from fn_user where org_user_id = 'demo'), - NULL, - 'N', - 'N' - ); - - -insert into ep_app_function (app_id, function_cd, function_name) values -(1, 'url|edit_notification|*', 'User Notification'), -(1, 'url|getAdminNotifications|*', 'Admin Notifications'), -(1, 'url|login|*', 'Login'), -(1, 'menu|menu_admin|*','Admin Menu'), -(1,'menu|menu_home|*','Home Menu'), -(1, 'menu|menu_logout|*','Logout Menu'), -(1, 'menu|menu_web_analytics|*','Web Analytics'), -(1, 'url|saveNotification|*','publish notifications'), -(1, 'url|url_role.htm|*','role page'), -(1, 'url|url_welcome.htm|*','welcome page'), -(1, 'menu|menu_acc_admin|*','Admin Account Menu'), -(1, 'menu|menu_app_onboarding|*','Application Onboarding'), -(1,'url|addWebAnalyticsReport|*','Add Web Analytics Report'), -(1,'url|appsFullList|*','Apps Full List'), -(1,'url|centralizedApps|*','Centralized Apps'), -(1,'url|functionalMenu|*','Functional Menu'), -(1,'url|getAllWebAnalytics|*','Get All Web Analytics'), -(1,'url|getFunctionalMenuRole|*','Get Functional Menu Role'), -(1,'url|getNotificationAppRoles|*','Get Notification App Roles'), -(1,'url|getUserAppsWebAnalytics|*','Get User Apps Web Analytics'), -(1,'url|getUserJourneyAnalyticsReport|*','Get User Journey Report'), -(1,'url|get_roles%2f%2a|*','getRolesOfApp'), -(1,'url|get_role_functions%2f%2a|*','Get Role Functions'), -(1,'url|notification_code|*','Notification Code'), -(1,'url|role_function_list%2fsaveRoleFunction%2f%2a|*','Save Role Function'), -(1,'url|syncRoles|*','SyncRoles'), -(1,'url|userAppRoles|*','userAppRoles'), -(1,'url|userApps|*','User Apps') -; - - -insert into ep_app_role_function (id, app_id, role_id, function_cd, role_app_id) values -(1, 1, 1, 'url|login|*', null), -(2, 1, 1, 'menu|menu_admin|*', null), -(3, 1, 1, 'menu|menu_home|*', null), -(4, 1, 1, 'menu|menu_logout|*', null), -(5, 1, 16, 'url|login|*', null), -(6, 1, 16, 'menu|menu_home|*', null), -(7, 1, 16, 'menu|menu_logout|*', null), -(8, 1, 950, 'url|edit_notification|*', null), -(9, 1, 950, 'url|getAdminNotifications|*', null), -(10,1, 950, 'url|saveNotification|*', null), -(11,1, 999,'url|userAppRoles|*', null), -(12,1, 999, 'url|getAdminNotifications|*', null), -(13,1, 999,'url|userApps|*', null), -(14,1, 1010, 'menu|menu_web_analytics|*', null), -(15, 1, 2115, 'menu|menu_web_analytics|*', null), -(16, 1 , 1, 'menu|menu_acc_admin|*' , null), -(17, 1 , 999 ,'menu|menu_acc_admin|*', null), -(18,1,999,'url|centralizedApps|*', null), -(19,1,999,'url|getAllWebAnalytics|*', null), -(20,1,999,'url|getFunctionalMenuRole|*', null), -(21,1,999,'url|getNotificationAppRoles|*', null), -(22,1,999,'url|getUserAppsWebAnalytics|*', null), -(23,1,999,'url|getUserJourneyAnalyticsReport|*', null), -(24,1,999,'url|get_roles%2f%2a|*', null), -(25,1,999,'url|get_role_functions%2f%2a|*', null), -(26,1,999,'url|notification_code|*', null), -(27,1,999,'url|role_function_list%2fsaveRoleFunction%2f%2a|*', null), -(28,1,999,'url|syncRoles|*', null), -(29, 1, 1, 'menu|menu_app_onboarding|*', null) -; - -commit;
\ No newline at end of file diff --git a/ecomp-portal-DB-os/PortalMySql_3_3_Add.sql b/ecomp-portal-DB-os/PortalMySql_3_3_Add.sql new file mode 100644 index 00000000..1a6731ae --- /dev/null +++ b/ecomp-portal-DB-os/PortalMySql_3_3_Add.sql @@ -0,0 +1,16 @@ +set foreign_key_checks=1; + +use portal; + +ALTER TABLE fn_app +ADD COLUMN mode_of_integration varchar(50) DEFAULT NULL AFTER ueb_topic_name; + +ALTER TABLE fn_app +ADD COLUMN ack_app CHAR(1) DEFAULT 'Y' AFTER ueb_topic_name; + +ALTER TABLE fn_app +ADD COLUMN uses_cadi CHAR(1) DEFAULT NULL AFTER ueb_topic_name; + +update fn_app set uses_cadi='Y' where COALESCE(app_password, '') = ''; + +commit; diff --git a/ecomp-portal-DB-os/PortalMySql_3_3_Remove.sql b/ecomp-portal-DB-os/PortalMySql_3_3_Remove.sql new file mode 100644 index 00000000..f1aba387 --- /dev/null +++ b/ecomp-portal-DB-os/PortalMySql_3_3_Remove.sql @@ -0,0 +1,10 @@ + +use portal; + +alter table fn_app drop column mode_of_integration; + +alter table fn_app drop column ack_app; + +alter table fn_app drop column uses_cadi; + +commit;
\ No newline at end of file diff --git a/ecomp-portal-DB-os/README.md b/ecomp-portal-DB-os/README.md index c6c830ce..dd1cc58a 100644 --- a/ecomp-portal-DB-os/README.md +++ b/ecomp-portal-DB-os/README.md @@ -10,7 +10,7 @@ DDL For an Opensource instance run only -3_2: script PortalDDLMySql_2_1_Common.sql. +3_3: script PortalDDLMySql_3_3_Common.sql. 3_2: PortalDDLMySql_3_2_OS.sql is only a placeholder at this time. @@ -18,7 +18,7 @@ DML For an Opensource instance run -3_2: script PortalDMLMySql_3_2_Common.sql and script PortalDMLMySql_3_2_OS.sql. +3_3: script PortalDMLMySql_3_3_Common.sql and script PortalMySql_3_3_Add.sql. -3_2: PortalDMLMySql_3_2_OS.sql - this is the specific DML entries that only Opensource needs +3_3: PortalMySql_3_3_Add.sql - this is the specific DML entries that only Opensource needs *************************************************************************************************************************************** diff --git a/ecomp-portal-FE-os/pom.xml b/ecomp-portal-FE-os/pom.xml index 735ce79e..29154e82 100644 --- a/ecomp-portal-FE-os/pom.xml +++ b/ecomp-portal-FE-os/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.portal</groupId> <artifactId>onap-portal-parent</artifactId> - <version>3.3.0</version> + <version>3.4.0</version> </parent> <artifactId>portal-FE-os</artifactId> diff --git a/ecomp-portal-widget-ms/common-widgets/pom.xml b/ecomp-portal-widget-ms/common-widgets/pom.xml index 2fdc2f82..7844390a 100644 --- a/ecomp-portal-widget-ms/common-widgets/pom.xml +++ b/ecomp-portal-widget-ms/common-widgets/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.onap.portal</groupId> <artifactId>widget-ms-parent</artifactId> - <version>3.3.0</version> + <version>3.4.0</version> </parent> <artifactId>common-widgets</artifactId> diff --git a/ecomp-portal-widget-ms/pom.xml b/ecomp-portal-widget-ms/pom.xml index 553535d5..913ac445 100644 --- a/ecomp-portal-widget-ms/pom.xml +++ b/ecomp-portal-widget-ms/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.onap.portal</groupId> <artifactId>onap-portal-parent</artifactId> - <version>3.3.0</version> + <version>3.4.0</version> </parent> <artifactId>widget-ms-parent</artifactId> diff --git a/ecomp-portal-widget-ms/widget-ms/pom.xml b/ecomp-portal-widget-ms/widget-ms/pom.xml index 4095388c..2cdf13f3 100644 --- a/ecomp-portal-widget-ms/widget-ms/pom.xml +++ b/ecomp-portal-widget-ms/widget-ms/pom.xml @@ -7,13 +7,13 @@ <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> <groupId>org.onap.portal</groupId> <artifactId>widget-ms</artifactId> - <version>3.3.0</version> + <version>3.4.0</version> <packaging>jar</packaging> <name>widget-microservice</name> @@ -22,10 +22,10 @@ <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> @@ -91,12 +91,12 @@ <dependency> <groupId>org.mariadb.jdbc</groupId> <artifactId>mariadb-java-client</artifactId> - <!-- <version>1.5.8</version> --> + <version>1.5.8</version> </dependency> <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> @@ -109,7 +109,7 @@ <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> - <!-- <version>1.6.1</version> --> + <version>1.6.1</version> <exclusions> <exclusion> <groupId>jaxme</groupId> @@ -151,7 +151,7 @@ <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> @@ -181,7 +181,7 @@ <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> diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/DatabaseFileUploadController.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/DatabaseFileUploadController.java index acdde23b..dc8cb20d 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/DatabaseFileUploadController.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/DatabaseFileUploadController.java @@ -11,8 +11,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; @Controller @@ -24,7 +23,7 @@ public class DatabaseFileUploadController { private static final Logger logger = LoggerFactory.getLogger(DatabaseFileUploadController.class); @ResponseBody - @RequestMapping(value = "/microservices/markup/{widgetId}", method = RequestMethod.GET) + @GetMapping(value = "/microservices/markup/{widgetId}") public String getWidgetMarkup(HttpServletRequest request, HttpServletResponse response, @PathVariable("widgetId") long widgetId){ String markup = null; try{ @@ -37,7 +36,7 @@ public class DatabaseFileUploadController { } @ResponseBody - @RequestMapping(value = "/microservices/{widgetId}/controller.js", method = RequestMethod.GET) + @GetMapping(value = "/microservices/{widgetId}/controller.js") public String getWidgetController(HttpServletRequest request, HttpServletResponse response, @PathVariable("widgetId") long widgetId){ String controller = null; try{ @@ -50,7 +49,7 @@ public class DatabaseFileUploadController { } @ResponseBody - @RequestMapping(value = "/microservices/{widgetId}/framework.js", method = RequestMethod.GET) + @GetMapping(value = "/microservices/{widgetId}/framework.js") public String getWidgetFramework(HttpServletRequest request, HttpServletResponse response, @PathVariable("widgetId") long widgetId){ String framework = null; @@ -64,7 +63,7 @@ public class DatabaseFileUploadController { } @ResponseBody - @RequestMapping(value = "/microservices/{widgetId}/styles.css", method = RequestMethod.GET) + @GetMapping(value = "/microservices/{widgetId}/styles.css") public String getWidgetCSS(HttpServletRequest request, HttpServletResponse response, @PathVariable("widgetId") long widgetId){ String css = null; diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/HealthController.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/HealthController.java index 6814f75a..1eb2c966 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/HealthController.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/HealthController.java @@ -3,14 +3,13 @@ package org.onap.portalapp.widget.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; - + @RestController public class HealthController { - @RequestMapping(value = { "/health" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "/health" }, produces = "application/json") public HealthStatus getWidgetCatalog(HttpServletRequest request, HttpServletResponse response) { return new HealthStatus("ok"); } diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/WidgetsCatalogController.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/WidgetsCatalogController.java index b1450b6d..e6c1c0ac 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/WidgetsCatalogController.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/WidgetsCatalogController.java @@ -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; @@ -21,8 +21,10 @@ import org.springframework.stereotype.Controller; 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.RequestMethod; +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.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.client.RestTemplate; @@ -37,12 +39,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 +61,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 +81,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 +100,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 +119,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 +150,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); @@ -161,13 +163,14 @@ public class WidgetsCatalogController { try { //check the zip file structure first respond = storageService.checkZipFile(file); + logger.debug("Check file validity"+respond.isValid()+respond.getError()); if(respond.isValid()){ //update the widget catalog WidgetCatalog newWidget = new ObjectMapper().readValue(widget, WidgetCatalog.class); widgetCatalogService.updateWidgetCatalog(widgetId, newWidget); logger.debug("WidgetsCatalogController.saveWidgetCatalog: updating widget with widgetId={}", widgetId); //update the widget zip file - storageService.update(file, newWidget, widgetId); + storageService.updateJsFile(file, newWidget, widgetId); } } catch (Exception e) { logger.error("Exception occurred while performing WidgetsCatalogController.saveWidgetCatalog in widget microservices. Details:", e); @@ -176,8 +179,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 +198,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 +219,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 +239,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; diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java index 212826cd..46ee814c 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java @@ -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; diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java index 43e7b2b0..2ed49ab4 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java @@ -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") diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java index 7207d0ae..cd9236da 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java @@ -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; diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java index aae9bfed..173a1430 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java @@ -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; diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java index 1dc0582c..a822c5a2 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java @@ -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; diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/hibernate/HibernateConfiguration.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/hibernate/HibernateConfiguration.java index b52631f1..ac25077b 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/hibernate/HibernateConfiguration.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/hibernate/HibernateConfiguration.java @@ -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; diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/StorageService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/StorageService.java index fbd0f963..d8b56422 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/StorageService.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/StorageService.java @@ -30,5 +30,7 @@ public interface StorageService { void update(MultipartFile file, WidgetCatalog newWidget, long widgetId); + void updateJsFile(MultipartFile file, WidgetCatalog newWidget, long widgetId); + byte[] getWidgetCatalogContent(long widgetId) throws Exception; } diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/MicroserviceServiceImpl.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/MicroserviceServiceImpl.java index fed70ad9..a02667de 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/MicroserviceServiceImpl.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/MicroserviceServiceImpl.java @@ -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; diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java index 7a35ba4e..3bb41b6b 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java @@ -73,7 +73,7 @@ public class StorageServiceImpl implements StorageService { Criteria criteria = session.createCriteria(WidgetFile.class); criteria.add(Restrictions.eq("widgetId", widgetId)); List<WidgetFile> widgetFiles = criteria.list(); - session.flush(); + //session.flush(); session.close(); if (widgetFiles.size() > 0) widgetFile = widgetFiles.get(0); @@ -148,7 +148,7 @@ public class StorageServiceImpl implements StorageService { logger.error("StorageServiceImpl.save: Failed to store file " + file.getOriginalFilename(), e); throw new StorageException("Failed to store file " + file.getOriginalFilename(), e); } - saveHelper(newWidget, widgetId, map); + saveJsHelper(newWidget, widgetId, map); } @Override @@ -167,7 +167,7 @@ public class StorageServiceImpl implements StorageService { throw new StorageException("Failed to store file " + file.getName(), e); } - saveHelper(newWidget, widgetId, map); + saveJsHelper(newWidget, widgetId, map); } /** @@ -259,6 +259,90 @@ public class StorageServiceImpl implements StorageService { widgetId); } + + /** + * Helper method to UnZip File + * + * @param file + */ + private Map<String, byte[]> unZipFile(MultipartFile file) { + UnzipUtil unzipper = new UnzipUtil(); + Map<String, byte[]> map; + File convFile; + try { + if (file.isEmpty()) { + logger.error("StorageServiceImpl.update: Failed to store empty file " + file.getOriginalFilename()); + throw new StorageException("Failed to store empty file " + file.getOriginalFilename()); + } + String fileLocation = file.getOriginalFilename(); + logger.debug("StorageServiceImpl.update: store the widget to:" + fileLocation); + convFile = new File(fileLocation); + try(FileOutputStream fos = new FileOutputStream(convFile)){ + fos.write(file.getBytes()); + } + map = unzipper.unzip_db(fileLocation, ".", "tempWidgets"); + convFile.delete(); + return map; + } catch (IOException e) { + logger.error("StorageServiceImpl.update: Failed to store file " + file.getOriginalFilename(), e); + throw new StorageException("StorageServiceImpl.update: Failed to store file " + file.getOriginalFilename(), + e); + } + } + + /** + * Helper method for saving widget file (controller.js) to ep_widget_catalog_files table in database + * + * @param newWidget + * @param widgetId + * @param map + */ + private void saveJsHelper(WidgetCatalog newWidget, long widgetId, Map<String, byte[]> map) { + + logger.debug("Going to save controller.js " + newWidget); + WidgetFile widgetFile = new WidgetFile(); + widgetFile.setName(newWidget.getName()); + widgetFile.setWidgetId(widgetId); + final byte[] controllerLoc = map.get(WidgetConstant.WIDGET_CONTROLLER_LOCATION); + if (controllerLoc == null || controllerLoc.length == 0) + throw new IllegalArgumentException( + "Map is missing required key " + WidgetConstant.WIDGET_CONTROLLER_LOCATION); + String javascript = new String(controllerLoc); + + widgetFile.setController(javascript.getBytes()); + Session session = sessionFactory.openSession(); + session.save(widgetFile); + session.flush(); + session.close(); + logger.debug( + "StorageServiceImpl.save: saved controller.js file to the database for widget {}", + widgetId); + + } + + @Override + public void updateJsFile(MultipartFile file, WidgetCatalog newWidget, long widgetId) { + Map<String, byte[]> map; + map = unZipFile(file); + //Get existing widget file from DB + WidgetFile widgetFile = getWidgetFile(widgetId); + + String javascript = new String(map.get(WidgetConstant.WIDGET_CONTROLLER_LOCATION)); + widgetFile.setController(javascript.getBytes()); + Session session = sessionFactory.openSession(); + Transaction tx = session.beginTransaction(); + session.update(widgetFile); + tx.commit(); + session.flush(); + session.close(); + logger.debug( + "StorageServiceImpl.save: updated controller.js file to the database for widget {}", + widgetId); + } + + + + @Override public void update(MultipartFile file, WidgetCatalog newWidget, long widgetId) { @@ -424,53 +508,14 @@ public class StorageServiceImpl implements StorageService { public byte[] getWidgetCatalogContent(long widgetId) throws Exception { WidgetCatalog widget = widgetCatalogService.getWidgetCatalog(widgetId); - String namespace = "Portal" + widgetId + "Widget"; - String controllerName = "Portal" + widgetId + "Ctrl"; - String cssName = "portal" + widgetId + "-css-ready"; - - String styles = getWidgetCSS(widgetId).replaceAll(cssName, widget.getName() + "-css-ready"); File f = File.createTempFile("temp", ".zip"); try(ZipOutputStream out = new ZipOutputStream(new FileOutputStream(f))){ - ZipEntry e = new ZipEntry(widget.getName() + "/styles/styles.css"); - out.putNextEntry(new ZipEntry(widget.getName() + "/")); - out.putNextEntry(new ZipEntry(widget.getName() + "/styles/")); - out.putNextEntry(e); - byte[] data = styles.getBytes(); - out.write(data, 0, data.length); - - String widgetData = namespace + "=" + namespace + "||{};" + "var res = " + namespace + ".widgetData;"; - String javascript = getWidgetController(widgetId).replace(widgetData, "").replace(namespace + ".controller =", - ""); - - String functionHeader = javascript.substring(javascript.indexOf("function"), javascript.indexOf(")") + 1); - javascript = javascript.replaceFirst(controllerName, widget.getName() + "Ctrl"); - String functionParam = functionHeader.substring(functionHeader.indexOf("(") + 1, functionHeader.indexOf(")")); - StringBuilder injectStr = new StringBuilder().append("["); - List<String> paramList = Arrays.asList(functionParam.split(",")); - for (int i = 0; i < paramList.size(); i++) { - if (i == paramList.size() - 1) - injectStr.append("'" + paramList.get(i).trim() + "'];"); - else - injectStr.append("'" + paramList.get(i).trim() + "',"); - } - javascript = javascript.replace(";" + namespace + ".controller.$inject = " + injectStr.toString(), ""); + String javascript = getWidgetController(widgetId); - e = new ZipEntry(widget.getName() + "/js/controller.js"); + ZipEntry e = new ZipEntry(widget.getName() + "/js/controller.js"); out.putNextEntry(new ZipEntry(widget.getName() + "/js/")); out.putNextEntry(e); - data = javascript.getBytes(); - out.write(data, 0, data.length); - - String html = getWidgetMarkup(widgetId).replaceFirst(controllerName, widget.getName() + "Ctrl"); - - // new - // String(map.get(WidgetConstant.WIDGET_MARKUP_LOCATION)).replaceFirst(functionName, - // controllerName);; - - e = new ZipEntry(widget.getName() + "/markup/markup.html"); - out.putNextEntry(new ZipEntry(widget.getName() + "/markup/")); - out.putNextEntry(e); - data = html.getBytes(); + byte[] data = javascript.getBytes(); out.write(data, 0, data.length); out.closeEntry(); byte[] result = Files.readAllBytes(Paths.get(f.getPath())); diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java index 59180d37..d71356fb 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java @@ -148,14 +148,13 @@ public class WidgetCatalogServiceImpl implements WidgetCatalogService { @Override public WidgetCatalog getWidgetCatalog(Long widgetCatalogId) { Session session = sessionFactory.getCurrentSession(); - Transaction tx = session.beginTransaction(); WidgetCatalog widget = (WidgetCatalog) session.get(WidgetCatalog.class, widgetCatalogId); - tx.commit(); logger.debug("WidgetCatalogServiceImpl.getWidgetCatalog: getting widget={}", widget); return widget; } @Override + @Transactional public void deleteWidgetCatalog(long widgetCatalogId) { logger.debug("WidgetCatalogServiceImpl.deleteWidgetCatalog: deleting the widget with widgetId={}", widgetCatalogId); WidgetCatalog widget = getWidgetCatalog(widgetCatalogId); @@ -164,7 +163,7 @@ public class WidgetCatalogServiceImpl implements WidgetCatalogService { return; } Session session = sessionFactory.getCurrentSession(); - Transaction tx = session.beginTransaction(); + //Transaction tx = session.beginTransaction(); Query query = session.createSQLQuery("delete from ep_pers_user_widget_sel where widget_id = :widgetId ").setParameter("widgetId", widgetCatalogId); query.executeUpdate(); query = session.createSQLQuery("delete from ep_pers_user_widget_placement where widget_id = :widgetId ").setParameter("widgetId", widgetCatalogId); @@ -174,7 +173,7 @@ public class WidgetCatalogServiceImpl implements WidgetCatalogService { query = session.createSQLQuery("delete from ep_widget_catalog_parameter where widget_id = :widgetId ").setParameter("widgetId", widgetCatalogId); query.executeUpdate(); session.delete(widget); - tx.commit(); + //tx.commit(); } @Override @@ -191,7 +190,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 +216,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 +267,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; diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/UnzipUtil.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/UnzipUtil.java index f20ed1b5..164a6983 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/UnzipUtil.java +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/UnzipUtil.java @@ -51,8 +51,7 @@ public class UnzipUtil { ZipEntry entry = zipIn.getNextEntry(); Map<String, byte[]> map = new HashMap<>(); - String[] requiredKeys = { WidgetConstant.WIDGET_CONTROLLER_LOCATION, WidgetConstant.WIDGET_MARKUP_LOCATION, - WidgetConstant.WIDGET_STYLE_LOCATION }; + String[] requiredKeys = { WidgetConstant.WIDGET_CONTROLLER_LOCATION }; for (String k : requiredKeys) map.put(k, null); diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/resources/application.properties b/ecomp-portal-widget-ms/widget-ms/src/main/resources/application.properties index 42483b7f..82b26d6e 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/main/resources/application.properties +++ b/ecomp-portal-widget-ms/widget-ms/src/main/resources/application.properties @@ -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== diff --git a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImplTest.java b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImplTest.java index 933710d2..2d1fd273 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImplTest.java +++ b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImplTest.java @@ -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() { diff --git a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java index d3dc1cbf..0d01ee50 100644 --- a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java +++ b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java @@ -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); @@ -12,7 +12,7 @@ <groupId>org.onap.portal</groupId> <artifactId>onap-portal-parent</artifactId> - <version>3.3.0</version> + <version>3.4.0</version> <packaging>pom</packaging> <name>portal</name> @@ -28,19 +28,20 @@ <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> <fasterxml.version>2.8.11.4</fasterxml.version> <!-- NOT provided by OParent, unfortunately --> - <jacocoVersion>0.7.6.201602180812</jacocoVersion> + <jacocoVersion>0.8.1</jacocoVersion> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <encoding>UTF-8</encoding> <!-- <sonar.exclusions>**/scripts/**/*,**.js</sonar.exclusions> --> <sonar.test.exclusions>**/test/**/*,**/tests/**/*</sonar.test.exclusions> <enforcer.skip>false</enforcer.skip> <sonar.scm.exclusions.disabled>true</sonar.scm.exclusions.disabled> + <enforcerToDisableSnapshot>false</enforcerToDisableSnapshot> </properties> <!-- Specify the repositories here to avoid coordination of ~/.m2/settings.xml @@ -297,7 +298,27 @@ </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>${enforcerToDisableSnapshot}</fail> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> 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 f3b3a5f7..97f4a260 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 09dd4c1a..429587d9 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 @@ export class HeaderComponent implements OnInit { 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 @@ export class HeaderComponent implements OnInit { 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 @@ export class HeaderComponent implements OnInit { 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-common/src/app/layout/components/tabbar/tabbar.component.html b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.html index 31bb197c..db0b6afd 100644 --- a/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.html +++ b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.html @@ -35,10 +35,21 @@ --> + <style> + .apps-tab { + position: absolute; + width: 100%; + height: 100%; + top: 100px; + left: 5px; + background-color: white; + } + </style> + <div style="display: flex; flex-direction:column"> <mat-tab-group [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)" - (selectedTabChange)="tabChanged($event)"> + (selectedTabChange)="tabChanged($event);auditLog($event)" > <mat-tab [label]="mainTab"> <!-- <mat-grid-list cols="5"> @@ -59,7 +70,7 @@ <div style="display: flex; flex-direction:row;"> <app-sidebar (collapsedEvent)="receiveCollapsed($event)"></app-sidebar> <app-userbar></app-userbar> - <div class="container" style="margin-left: 370px;"> + <div class="container" [ngStyle]="setStyle()"> <router-outlet></router-outlet> </div> </div> @@ -68,10 +79,10 @@ </mat-tab> - <mat-tab *ngFor="let tab of tabs; let index = index"> + <mat-tab *ngFor="let tab of tabs; let index = index" > <ng-template mat-tab-label> {{tab.label | elipsis: 13}} - <i class="icon ion-md-close-circle" (click)="removeTab(index)"></i> + <i class="icon ion-md-close-circle" (click)="removeTab(index);removeAppObject(index)"></i> </ng-template> @@ -79,19 +90,15 @@ </mat-tab-group> - - - - - <div *ngFor="let tab of tabs; let index = index" - [style.display]='tab.active? "inline" : "none"' - [style.position]='tab.active? "static" : "absolute"' - [style.height]='tab.active? "calc(100vh)" : "calc(0vh)"'> - - <iframe id="tabframe-{{tab.label.split(' ').join('-')}}" scrolling='yes' frameBorder='0' width='100%' - scrolling='yes' frameBorder='0' width='100%' height='90%' [src]='tab.url'></iframe> - - </div> - - - </div> + <div class="apps-tab" *ngFor="let tab of tabs; let index = index" + [style.display]='"inline"' + [style.position]='"absolute"' + [style.height]='"calc(100vh)"' + [style.z-index]="tab.active? 1 : 0" + [style.opacity]="tab.active? 1 : 0" + > + <iframe id="tabframe-{{tab.label.split(' ').join('-')}}-{{index}}" scrolling='yes' frameBorder='0' + scrolling='yes' frameBorder='0' width='100%' height='90%' [src]='tab.url'> + </iframe> + </div> +</div> diff --git a/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.spec.ts b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.spec.ts index 76aaa3e7..066d73ff 100644 --- a/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.spec.ts +++ b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.spec.ts @@ -43,6 +43,7 @@ import { NgMaterialModule } from 'src/app/ng-material-module'; import { Component } from '@angular/core'; import { ElipsisPipe } from 'src/app/shared/pipes/elipsis/elipsis.pipe'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { HttpClientTestingModule} from '@angular/common/http/testing'; describe('TabbarComponent', () => { let component: TabbarComponent; @@ -51,7 +52,7 @@ describe('TabbarComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ TabbarComponent, AppSideBarStubComponent, AppUserBarStubComponent,RouterOutletStubComponent,AppFooterBarStubComponent,ElipsisPipe], - imports: [NgMaterialModule,BrowserAnimationsModule] + imports: [NgMaterialModule,BrowserAnimationsModule,HttpClientTestingModule] }) .compileComponents(); })); diff --git a/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.ts b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.ts index 7a10e39d..86f76595 100644 --- a/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.ts +++ b/portal-FE-common/src/app/layout/components/tabbar/tabbar.component.ts @@ -40,6 +40,7 @@ import { FormControl } from '@angular/forms'; import { DomSanitizer } from '@angular/platform-browser'; import { Tab } from './tab'; import { AddTabFunctionService } from 'src/app/shared/services/tab/add-tab-function.service'; +import { AuditLogService } from 'src/app/shared/services/auditLog/audit-log.service'; @Component({ selector: 'app-tabbar', @@ -49,11 +50,12 @@ import { AddTabFunctionService } from 'src/app/shared/services/tab/add-tab-funct export class TabbarComponent implements OnInit { tabs = []; + tabsInfoObject = []; mainTab = 'Home'; selected = new FormControl(0); collapedSideBar: boolean; - constructor(private sanitizer: DomSanitizer, private addTabFuntionService: AddTabFunctionService) { + constructor(private sanitizer: DomSanitizer, private addTabFuntionService: AddTabFunctionService, private auditLogService: AuditLogService) { } @@ -61,7 +63,9 @@ export class TabbarComponent implements OnInit { this.addTabFuntionService.listen().subscribe((m: any) => { console.log(m); + this.createAppObject(m); this.addTab(true, m.title, m.url); + }) } @@ -76,6 +80,15 @@ export class TabbarComponent implements OnInit { } } + createAppObject(app:any) { + this.tabsInfoObject.push(app); + } + + removeAppObject(index:number) { + this.tabsInfoObject.splice(index, 1); + + } + removeTab(index: number) { this.tabs.splice(index, 1); } @@ -85,6 +98,7 @@ export class TabbarComponent implements OnInit { } tabChanged($event) { + console.log("$event.index "+$event.value); for (const ttab of this.tabs) { ttab.active = false; @@ -92,4 +106,28 @@ export class TabbarComponent implements OnInit { if(this.tabs.length != 0 && $event.index != 0) this.tabs[$event.index - 1].active = true; } + + setStyle() { + const style = { + 'margin-left': this.collapedSideBar ? '80px' : '370px', + 'max-width': this.collapedSideBar ? '1540px' : '1140px' + }; + return style; + } + + auditLog($event) { + var app = this.tabsInfoObject[$event.index - 1]; + var comment = ''; + if(app.content==null || app.content==''){ + comment= app.title; + } + else{ + comment = app.content; + } + this.auditLogService.storeAudit(app.appId, 'tab', comment).subscribe(data => { + console.log('Tab action Saved'); + }, error => { + console.log('auditLog Save Error' + error); + }); + } } diff --git a/portal-FE-common/src/app/layout/components/userbar/userbar.component.scss b/portal-FE-common/src/app/layout/components/userbar/userbar.component.scss index 451adfc7..7e0edc10 100644 --- a/portal-FE-common/src/app/layout/components/userbar/userbar.component.scss +++ b/portal-FE-common/src/app/layout/components/userbar/userbar.component.scss @@ -108,8 +108,8 @@ button { display: block; margin-left: auto; margin-right: auto; - height: 55px; - width: 55px; + height: 45px; + width: 45px; border-radius: 50%; } diff --git a/portal-FE-common/src/app/layout/components/userbar/userbar.component.ts b/portal-FE-common/src/app/layout/components/userbar/userbar.component.ts index 2136abb2..d3680c9c 100644 --- a/portal-FE-common/src/app/layout/components/userbar/userbar.component.ts +++ b/portal-FE-common/src/app/layout/components/userbar/userbar.component.ts @@ -82,7 +82,7 @@ export class UserbarComponent implements OnInit { // $log.error('UserbarCtrl::updateActiveUsers: failed to get active user'); this.stop(); } else { - var maxItems = 25; + var maxItems = 5; if (_res.length < maxItems) maxItems = _res.length; for (var i = 0; i < maxItems; i++) { diff --git a/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.ts b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.ts index f571dcaa..4d919b44 100644 --- a/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.ts +++ b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.ts @@ -101,6 +101,7 @@ export class ApplicationCatalogComponent implements OnInit { this.appCatalogData = data; for (let entry of this.appCatalogData) { //console.log("Check the URL" + environment.api.appThumbnail); + if(entry.applicationType != "3"){ var appCatalog = { x: -1, y: -1, @@ -108,7 +109,7 @@ export class ApplicationCatalogComponent implements OnInit { name: entry.name, mlAppName: entry.mlAppName, imageLink: environment.api.appThumbnail.replace(':appId', <string><any>entry.id), - restricted: entry.restricted, + applicationType: entry.applicationType, select: entry.select, access: entry.access, pending: entry.pending, @@ -116,6 +117,7 @@ export class ApplicationCatalogComponent implements OnInit { }; this.applicationCatalogService.addItem(appCatalog); } + } }, error => { console.log('getAppCatalogServices Error Object' + error); }); @@ -148,7 +150,7 @@ export class ApplicationCatalogComponent implements OnInit { }; openAddRoleModal(item: any) { //console.log("OpenModal check" + item.id); - if ((!item.restricted) && (item.mlproperty)) { + if ((item.applicationType == "1") && (item.mlproperty)) { this.modal.open(CatalogModalComponent); } } diff --git a/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.html b/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.html index 3169fa01..4c02d0cc 100644 --- a/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.html +++ b/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.html @@ -70,7 +70,7 @@ 'background-color':'white', 'background-repeat': 'no-repeat', 'background-size': '168px 118px', - 'height': '80%'}" (click)="openAddRoleModal(item)"> + 'height': '80%'}" (click)="openAddRoleModal(item);auditLog(item)"> </div> </div> diff --git a/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.ts b/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.ts index be4c09e2..f26290f5 100644 --- a/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.ts +++ b/portal-FE-common/src/app/pages/dashboard-application-catalog/dashboard-application-catalog.component.ts @@ -46,6 +46,7 @@ import { CatalogModalComponent } from '../catalog-modal/catalog-modal.component' import { ExternalRequestAccessService } from 'src/app/shared/services/external-request-access-service/external-request-access.service'; import { UsersService } from 'src/app/shared/services/users/users.service'; import { AddTabFunctionService } from 'src/app/shared/services/tab/add-tab-function.service'; +import { AuditLogService } from 'src/app/shared/services/auditLog/audit-log.service'; @Component({ selector: 'app-dashboard-application-catalog', @@ -67,7 +68,7 @@ export class DashboardApplicationCatalogComponent implements OnInit { return this.applicationCatalogService.options; } get layout(): GridsterItem[] { return this.applicationCatalogService.layout; - } constructor(private applicationCatalogService: ApplicationCatalogService, private externalRequestAccessService: ExternalRequestAccessService, private userService: UsersService,private addTabFuntionService: AddTabFunctionService) { + } constructor(private applicationCatalogService: ApplicationCatalogService, private externalRequestAccessService: ExternalRequestAccessService, private userService: UsersService,private addTabFuntionService: AddTabFunctionService, private auditLogService: AuditLogService) { this.sortOptions = [{ index: 0, value: 'N', @@ -169,6 +170,7 @@ export class DashboardApplicationCatalogComponent implements OnInit { this.applicationCatalogService.layout = []; for (let entry of data) { //console.log("Check the URL" + environment.api.appThumbnail); + if(entry.applicationType != '3'){ var appCatalog = { x: -1, y: -1, @@ -176,7 +178,7 @@ export class DashboardApplicationCatalogComponent implements OnInit { name: entry.name, subHeaderText: entry.notes, imageLink: environment.api.appThumbnail.replace(':appId', <string><any>entry.id), - restrictedApp: entry.restrictedApp, + applicationType: entry.applicationType, select: entry.select, access: entry.access, pending: entry.pending, @@ -186,6 +188,7 @@ export class DashboardApplicationCatalogComponent implements OnInit { }; this.applicationCatalogService.addItem(appCatalog); } + } } }, error => { console.log('getAppCatalogServices Error Object' + error); @@ -199,7 +202,7 @@ export class DashboardApplicationCatalogComponent implements OnInit { openAddRoleModal(item: any) { //console.log("OpenModal check" + item.id+" "+item.url); - if (item.restrictedApp) { + if (item.applicationType =='2') { // Link-based apps open in their own browser tab window.open(item.url, '_blank'); } else{ @@ -212,4 +215,12 @@ export class DashboardApplicationCatalogComponent implements OnInit { this.addTabFuntionService.filter(tabContent); } } + + auditLog(app:any) { + this.auditLogService.storeAudit(app.appid, 'app', app.url).subscribe(data => { + console.log('App action Saved'); + }, error => { + console.log('auditLog Save Error' + error); + }); + } }
\ No newline at end of file diff --git a/portal-FE-common/src/app/pages/dashboard-widget-catalog/dashboard-widget-catalog.component.ts b/portal-FE-common/src/app/pages/dashboard-widget-catalog/dashboard-widget-catalog.component.ts index dbdd2928..14e5773c 100644 --- a/portal-FE-common/src/app/pages/dashboard-widget-catalog/dashboard-widget-catalog.component.ts +++ b/portal-FE-common/src/app/pages/dashboard-widget-catalog/dashboard-widget-catalog.component.ts @@ -82,7 +82,8 @@ export class DashboardWidgetCatalogComponent implements OnInit { //console.log("What is coming from backend" + JSON.parse(data)); this.widgetCatalogData = data; console.log(this.widgetCatalogData); - for (let entry of this.widgetCatalogData) { + if(this.widgetCatalogData != null){ + for (let entry of this.widgetCatalogData) { if (entry[1] == 'Events' || entry[1] == 'News' || entry[1] == 'Resources') { if(entry[4] === 'S' || entry[4] === null) { @@ -96,6 +97,7 @@ export class DashboardWidgetCatalogComponent implements OnInit { } } } + } }); } }); diff --git a/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.html b/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.html index d898563b..54df2d12 100644 --- a/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.html +++ b/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.html @@ -40,7 +40,7 @@ <h1 class="heading-page">Edit Functional Menu</h1> </div> <div id="jqTree"></div> - <div class="functional-admin-button-container"> + <!-- <div class="functional-admin-button-container"> <button id="regenrate-functionalmenu-btn" class="btn btn-alt btn-small" (click)="regenerateFunctionalMenuAncestors()">Regenerate Menu @@ -48,5 +48,5 @@ <div class="regenerate-functionalmenu-btn-txt"> <span class="n16r">Click when you are done with your changes.</span> </div> - </div> + </div> --> </div> diff --git a/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.ts b/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.ts index d3b5a164..c231061d 100644 --- a/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.ts +++ b/portal-FE-common/src/app/pages/functional-menu/functional-menu.component.ts @@ -151,43 +151,42 @@ export class FunctionalMenuComponent implements OnInit { * @param ngbModal */ buildTree(treedataarray,ngbModal: NgbModal , _self){ - //console.log("treedataarray>>>>",treedataarray); - // $(function() { - // $('#jqTree').tree('loadData', treedataarray); - // $('#jqTree').tree({ - // data: treedataarray, - // autoOpen: false, - // dragAndDrop: true, - // onCreateLi: function(node, $li) { - // ////console.log("node >>",node); - // } - // }).on( - // 'tree.contextmenu', - // function(event:any) { - // // The clicked node is 'event.node' - // var node = event.node; - // openMenuDetailsModal(node, "view"); - // } - // ); + console.log("treedataarray>>>>",treedataarray); + $(function() { + (<any>$('#jqTree')).tree('loadData', treedataarray); + (<any>$('#jqTree')).tree({ + data: treedataarray, + autoOpen: false, + dragAndDrop: true, + onCreateLi: function(node, $li) { + ////console.log("node >>",node); + } + }).on( + 'tree.contextmenu', + function(event:any) { + // The clicked node is 'event.node' + var node = event.node; + openMenuDetailsModal(node, "view"); + } + ); - // var openMenuDetailsModal = function(node: any, actionName: string ){ - // const modalRef = ngbModal.open(FunctionalMenuDialogComponent, { size: 'lg' }); - // modalRef.componentInstance.title = 'Functional Menu ',actionName; - // if(node != 'undefined' && node){ - // modalRef.componentInstance.nodedata = node; - // modalRef.componentInstance.operationName = actionName; - // }else{ - // modalRef.componentInstance.nodedata = {}; - // } - // modalRef.componentInstance.passEntry.subscribe((receivedEntry: any) => { - // //console.log("receivedEntry>>>>",receivedEntry); - // ngbModal.dismissAll(); - // if(receivedEntry.httpStatusCode===200){ - // _self.getFunctionalMenu(); - // } - // }); - // } - // }); - // } + var openMenuDetailsModal = function(node: any, actionName: string ){ + const modalRef = ngbModal.open(FunctionalMenuDialogComponent, { size: 'lg' }); + modalRef.componentInstance.title = 'Functional Menu ',actionName; + if(node != 'undefined' && node){ + modalRef.componentInstance.nodedata = node; + modalRef.componentInstance.operationName = actionName; + }else{ + modalRef.componentInstance.nodedata = {}; + } + modalRef.componentInstance.passEntry.subscribe((receivedEntry: any) => { + //console.log("receivedEntry>>>>",receivedEntry); + ngbModal.dismissAll(); + if(receivedEntry.httpStatusCode===200){ + _self.getFunctionalMenu(); + } + }); + } + }); } } diff --git a/portal-FE-common/src/app/pages/role/role.component.ts b/portal-FE-common/src/app/pages/role/role.component.ts index 0ed39569..6cd14bd7 100644 --- a/portal-FE-common/src/app/pages/role/role.component.ts +++ b/portal-FE-common/src/app/pages/role/role.component.ts @@ -245,7 +245,7 @@ export class RoleComponent implements OnInit { this.roleDataSource = new MatTableDataSource(this.availableRoles); this.applicationsService.getSingleAppInfoById(val).subscribe((res: any) => { this.appName = res.name; - if (res.centralAuth == true) { + if (res.rolesInAAF == true) { this.syncRolesApplied = true; } }); diff --git a/portal-FE-common/src/app/pages/users/users.component.ts b/portal-FE-common/src/app/pages/users/users.component.ts index 935be921..39bf9223 100644 --- a/portal-FE-common/src/app/pages/users/users.component.ts +++ b/portal-FE-common/src/app/pages/users/users.component.ts @@ -212,6 +212,8 @@ export class UsersComponent implements OnInit { this.accountUsers = accountUsers; if (!accountUsers || accountUsers.length === 0) { this.noUsersInApp = true; + this.showSpinner = false; + return null; } this.showSpinner = false; this.adminsDataSource = new MatTableDataSource(this.accountUsers); diff --git a/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.scss b/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.scss index c72d11e5..7e68e1ae 100644 --- a/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.scss +++ b/portal-FE-common/src/app/pages/web-analytics/web-analytics.component.scss @@ -44,6 +44,11 @@ padding-bottom: 15px; padding-right: 40px; font-weight: bold; + white-space: nowrap; +} + +td.mat-cell, td.mat-footer-cell, th.mat-header-cell { + padding-right: 45px; } .ion-md-trash{ diff --git a/portal-FE-common/src/app/shared/model/application-catalog.model.ts b/portal-FE-common/src/app/shared/model/application-catalog.model.ts index a0f368c4..46344b79 100644 --- a/portal-FE-common/src/app/shared/model/application-catalog.model.ts +++ b/portal-FE-common/src/app/shared/model/application-catalog.model.ts @@ -41,7 +41,7 @@ export interface IApplicationCatalog { mlAppName: string; imageUrl: string; url: string; - restricted: boolean; + applicationType: string; open: boolean; access: boolean; select: boolean; diff --git a/portal-FE-common/src/app/shared/model/applications-onboarding/applications.ts b/portal-FE-common/src/app/shared/model/applications-onboarding/applications.ts index a0a93a22..895e4ea2 100644 --- a/portal-FE-common/src/app/shared/model/applications-onboarding/applications.ts +++ b/portal-FE-common/src/app/shared/model/applications-onboarding/applications.ts @@ -37,27 +37,40 @@ */ export interface IApplications { - id ?: any; - name ?: any; - imageUrl ?: any; - imageLink ?: any; - description ?: any; - notes ?: any; - url ?: any - alternateUrl ?: any; - restUrl ?: any; - isOpen ?: any; - isEnabled ?: any; - motsId ?: any; - myLoginsAppName ?: any; - myLoginsAppOwner ?: any; - username ?: any; - appPassword ?: any; - thumbnail ?: any; - uebTopicName ?: any; - uebKey ?: any; - uebSecret ?: any; - restrictedApp ?: any; - isCentralAuth ?: any; - nameSpace ?: any + id?: any; + appName?: any; + imageUrl?: any; + imageLink?: any; + appDescription?: any; + appNotes?: any; + landingPage?: any + alternateUrl?: any; + restUrl?: any; + isOpen?: any; + isEnabled?: any; + motsId?: any; + myLoginsAppName?: any; + myLoginsAppOwner?: any; + appBasicAuthUsername?: any; + appBasicAuthPassword?: any; + thumbnail?: any; + uebTopicName?: any; + uebKey?: any; + uebSecret?: any; + applicationType?: any; + rolesInAAF?: any; + // ---- start ----to be removed + restrictedApp?: any; + name?: any; + isCentralAuth?: any; + description?: any; + notes?: any; + url?: any; + username?: any; + appPassword?: any; + // ---- end ----to be removed + nameSpace?: any; + usesCadi?: any; + modeOfIntegration?: any; + appAck?: any; }
\ No newline at end of file diff --git a/portal-FE-common/src/app/shared/services/auditLog/audit-log.service.spec.ts b/portal-FE-common/src/app/shared/services/auditLog/audit-log.service.spec.ts new file mode 100644 index 00000000..1295915d --- /dev/null +++ b/portal-FE-common/src/app/shared/services/auditLog/audit-log.service.spec.ts @@ -0,0 +1,13 @@ +import { TestBed } from '@angular/core/testing'; + +import { AuditLogService } from './audit-log.service'; +import { HttpClientTestingModule} from '@angular/common/http/testing'; + +describe('AuditLogService', () => { + beforeEach(() => TestBed.configureTestingModule({imports: [HttpClientTestingModule]})); + + it('should be created', () => { + const service: AuditLogService = TestBed.get(AuditLogService); + expect(service).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/shared/services/auditLog/audit-log.service.ts b/portal-FE-common/src/app/shared/services/auditLog/audit-log.service.ts new file mode 100644 index 00000000..0504fb9f --- /dev/null +++ b/portal-FE-common/src/app/shared/services/auditLog/audit-log.service.ts @@ -0,0 +1,23 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { environment } from 'src/environments/environment'; +import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; + +@Injectable({ + providedIn: 'root' +}) +export class AuditLogService { + + constructor(private api: HttpClient) { } + + storeAudit(affectedAppId:any,type:any,comment:any): Observable<any> { + var url = environment.api.storeAuditLog+'?affectedAppId=' + affectedAppId; + if(type!=''){ + url= url+'&type='+type; + } + if(comment!=''){ + url= url+'&comment='+comment; + } + return this.api.get(url); + } +} diff --git a/portal-FE-common/src/app/shared/services/users/users.service.ts b/portal-FE-common/src/app/shared/services/users/users.service.ts index 38ebedd8..d977f724 100644 --- a/portal-FE-common/src/app/shared/services/users/users.service.ts +++ b/portal-FE-common/src/app/shared/services/users/users.service.ts @@ -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); } } diff --git a/portal-FE-os/package-lock.json b/portal-FE-os/package-lock.json index 1c65798c..80d1d289 100644 --- a/portal-FE-os/package-lock.json +++ b/portal-FE-os/package-lock.json @@ -398,9 +398,9 @@ "dev": true }, "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "os-locale": { @@ -816,6 +816,12 @@ "@types/sizzle": "*" } }, + "@types/mime-types": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.0.tgz", + "integrity": "sha1-nKUs2jY/aZxpRmwqbM2q2RPqenM=", + "dev": true + }, "@types/node": { "version": "8.9.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-8.9.5.tgz", @@ -1057,9 +1063,9 @@ } }, "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", "dev": true }, "acorn-dynamic-import": { @@ -1312,6 +1318,14 @@ "bn.js": "^4.0.0", "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + } } }, "assert": { @@ -1354,10 +1368,13 @@ "dev": true }, "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } }, "async-each": { "version": "1.0.3", @@ -1619,9 +1636,9 @@ "dev": true }, "base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", "dev": true }, "base64id": { @@ -1692,9 +1709,9 @@ }, "dependencies": { "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true } } @@ -1706,9 +1723,9 @@ "dev": true }, "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.1.tgz", + "integrity": "sha512-IUTD/REb78Z2eodka1QZyyEk66pciRcP6Sroka0aI3tG/iwIdYLrBD62RsubR7vqdt3WyX8p4jxeatzmRSphtA==", "dev": true }, "body-parser": { @@ -1847,21 +1864,43 @@ "requires": { "bn.js": "^4.1.0", "randombytes": "^2.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + } } }, "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, - "requires": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.1.0.tgz", + "integrity": "sha512-VYxo7cDCeYUoBZ0ZCy4UyEUCP3smyBd4DRQM5nrFS1jJjPJjX7rP3oLRpPoWfkhQfyJ0I9ZbHbKafrFD/SGlrg==", + "dev": true, + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.2", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "browserify-zlib": { @@ -1874,14 +1913,15 @@ } }, "browserslist": { - "version": "4.6.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.6.6.tgz", - "integrity": "sha512-D2Nk3W9JL9Fp/gIcWei8LrERCS+eXu9AM5cfXA8WEZ84lFks+ARnZ0q/R69m2SV3Wjma83QDDPxsNKXUwdIsyA==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.0.tgz", + "integrity": "sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30000984", - "electron-to-chromium": "^1.3.191", - "node-releases": "^1.1.25" + "caniuse-lite": "^1.0.30001043", + "electron-to-chromium": "^1.3.413", + "node-releases": "^1.1.53", + "pkg-up": "^2.0.0" } }, "browserstack": { @@ -1894,9 +1934,9 @@ } }, "buffer": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", - "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", "dev": true, "requires": { "base64-js": "^1.0.2", @@ -1920,6 +1960,12 @@ "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", "dev": true }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, "buffer-fill": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", @@ -2055,9 +2101,9 @@ } }, "caniuse-lite": { - "version": "1.0.30000984", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000984.tgz", - "integrity": "sha512-n5tKOjMaZ1fksIpQbjERuqCyfgec/m9pferkFQbLmWtqLUdmt12hNhjSwsmPdqeiG2NkITOQhr1VYIwWSAceiA==", + "version": "1.0.30001055", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001055.tgz", + "integrity": "sha512-MbwsBmKrBSKIWldfdIagO5OJWZclpJtS4h0Jrk/4HFrXJxTdVdH23Fd+xCiHriVGvYcWyW8mR/CPsYajlH8Iuw==", "dev": true }, "canonical-path": { @@ -2111,9 +2157,9 @@ } }, "chownr": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz", - "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "dev": true }, "chrome-trace-event": { @@ -2362,12 +2408,20 @@ "dev": true }, "compressible": { - "version": "2.0.17", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.17.tgz", - "integrity": "sha512-BGHeLCK1GV7j1bSmQQAi26X+GgWcTjLr/0tzSvMCl3LH1w1IJ4PFSPoV5316b30cneTziC+B1a+3OjoSUcQYmw==", + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", "dev": true, "requires": { - "mime-db": ">= 1.40.0 < 2" + "mime-db": ">= 1.43.0 < 2" + }, + "dependencies": { + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true + } } }, "compression": { @@ -2422,13 +2476,10 @@ "dev": true }, "console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", - "dev": true, - "requires": { - "date-now": "^0.1.4" - } + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", + "dev": true }, "console-control-strings": { "version": "1.1.0", @@ -2557,6 +2608,14 @@ "requires": { "bn.js": "^4.1.0", "elliptic": "^6.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + } } }, "create-hash": { @@ -2672,9 +2731,9 @@ "dev": true }, "cyclist": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", - "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", "dev": true }, "dashdash": { @@ -2692,12 +2751,6 @@ "integrity": "sha1-YV6CjiM90aubua4JUODOzPpuytg=", "dev": true }, - "date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", - "dev": true - }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -2720,10 +2773,18 @@ "dev": true }, "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", - "dev": true + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dev": true, + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + } }, "deep-is": { "version": "0.1.3", @@ -2758,6 +2819,15 @@ } } }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", @@ -2833,6 +2903,12 @@ "dev": true } } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true } } }, @@ -2861,9 +2937,9 @@ "dev": true }, "des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", "dev": true, "requires": { "inherits": "^2.0.1", @@ -2912,6 +2988,14 @@ "bn.js": "^4.1.0", "miller-rabin": "^4.0.0", "randombytes": "^2.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + } } }, "dir-glob": { @@ -2995,15 +3079,15 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.194", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.194.tgz", - "integrity": "sha512-w0LHR2YD9Ex1o+Sz4IN2hYzCB8vaFtMNW+yJcBf6SZlVqgFahkne/4rGVJdk4fPF98Gch9snY7PiabOh+vqHNg==", + "version": "1.3.434", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.434.tgz", + "integrity": "sha512-WjzGrE6appXvMyc2kH9Ide7OxsgTuRzag9sjQ5AcbOnbS9ut7P1HzOeEbJFLhr81IR7n2Hlr6qTTSGTXLIX5Pg==", "dev": true }, "elliptic": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", - "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", + "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", "dev": true, "requires": { "bn.js": "^4.4.0", @@ -3013,6 +3097,14 @@ "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0", "minimalistic-crypto-utils": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + } } }, "emojis-list": { @@ -3028,9 +3120,9 @@ "dev": true }, "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, "requires": { "once": "^1.4.0" @@ -3151,6 +3243,36 @@ "is-arrayish": "^0.2.1" } }, + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -3214,9 +3336,9 @@ }, "dependencies": { "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true } } @@ -3237,9 +3359,9 @@ }, "dependencies": { "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true } } @@ -3269,9 +3391,9 @@ "dev": true }, "events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", - "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.1.0.tgz", + "integrity": "sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg==", "dev": true }, "eventsource": { @@ -3620,6 +3742,35 @@ } } }, + "extract-zip": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz", + "integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==", + "dev": true, + "requires": { + "concat-stream": "^1.6.2", + "debug": "^2.6.9", + "mkdirp": "^0.5.4", + "yauzl": "^2.10.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + } + } + }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -3659,10 +3810,19 @@ "websocket-driver": ">=0.5.1" } }, + "fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "dev": true, + "requires": { + "pend": "~1.2.0" + } + }, "figgy-pudding": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", - "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", "dev": true }, "figures": { @@ -3747,6 +3907,23 @@ "commondir": "^1.0.1", "make-dir": "^1.0.0", "pkg-dir": "^2.0.0" + }, + "dependencies": { + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } } }, "find-up": { @@ -3871,6 +4048,17 @@ "null-check": "^1.0.0" } }, + "fs-extra": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", + "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0" + } + }, "fs-write-stream-atomic": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", @@ -3909,7 +4097,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -3930,12 +4119,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3950,17 +4141,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -4077,7 +4271,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -4089,6 +4284,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -4103,6 +4299,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4110,12 +4307,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -4134,6 +4333,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -4214,7 +4414,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -4226,6 +4427,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4311,7 +4513,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -4347,6 +4550,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4366,6 +4570,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4409,12 +4614,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -4430,6 +4637,12 @@ "rimraf": "2" } }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", @@ -4578,17 +4791,25 @@ "ignore": "^3.3.5", "pify": "^3.0.0", "slash": "^1.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } } }, "globule": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz", - "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.1.tgz", + "integrity": "sha512-OVyWOHgw29yosRHCHo7NncwR1hW5ew0W/UrvtwvjefVJeQ26q4/8r8FmPsSF1hJ93IgWkyv16pCTz6WblMzm/g==", "dev": true, "optional": true, "requires": { "glob": "~7.1.1", - "lodash": "~4.17.10", + "lodash": "~4.17.12", "minimatch": "~3.0.2" } }, @@ -4610,17 +4831,24 @@ "dev": true }, "handlebars": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", - "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", + "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", "dev": true, "requires": { + "minimist": "^1.2.5", "neo-async": "^2.6.0", - "optimist": "^0.6.1", "source-map": "^0.6.1", - "uglify-js": "^3.1.4" + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" }, "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -4659,6 +4887,15 @@ } } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -4697,6 +4934,12 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, "has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", @@ -4736,13 +4979,33 @@ } }, "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", "dev": true, "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } } }, "hash.js": { @@ -4755,6 +5018,16 @@ "minimalistic-assert": "^1.0.1" } }, + "hasha": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", + "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=", + "dev": true, + "requires": { + "is-stream": "^1.0.1", + "pinkie-promise": "^2.0.0" + } + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -4785,9 +5058,9 @@ } }, "html-entities": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz", - "integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.3.1.tgz", + "integrity": "sha512-rhE/4Z3hIhzHAUKbW8jVcCyuT5oJCXXqhN/6mXXVCpzTmvJnoH2HL/bt3EZ6p55jbFJBeAe1ZNpL5BugLujxNA==", "dev": true }, "http-deceiver": { @@ -4864,9 +5137,9 @@ "dev": true }, "https-proxy-agent": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", - "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", "dev": true, "requires": { "agent-base": "^4.3.0", @@ -4988,9 +5261,9 @@ } }, "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -5029,9 +5302,9 @@ "dev": true }, "in-publish": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz", - "integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.1.tgz", + "integrity": "sha512-oDM0kUSNFC31ShNxHKUyfZKy8ZeXZBWMjMdZHKLOk13uvT27VTL/QzRGfRUcevJhpkZAvlhPYuXkF7eNWrtyxQ==", "dev": true, "optional": true }, @@ -5176,9 +5449,9 @@ "dev": true }, "ipaddr.js": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", - "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", "dev": true }, "is-accessor-descriptor": { @@ -5201,6 +5474,12 @@ } } }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -5222,6 +5501,12 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -5242,6 +5527,12 @@ } } }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -5295,13 +5586,10 @@ "dev": true }, "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", @@ -5392,12 +5680,30 @@ "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -5477,6 +5783,12 @@ "wordwrap": "^1.0.0" }, "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, "glob": { "version": "5.0.15", "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", @@ -5508,9 +5820,9 @@ } }, "istanbul-api": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.6.tgz", - "integrity": "sha512-x0Eicp6KsShG1k1rMgBAi/1GgY7kFGEBwQpw3PXGEmu+rBcBNhqU8g2DgY9mlepAsLPzrzrbqSgCGANnki4POA==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.7.tgz", + "integrity": "sha512-LYTOa2UrYFyJ/aSczZi/6lBykVMjCCvUmT64gOe+jPZFy4w6FYfPGqFT2IiQ2BxVHHDOvCD7qrIXb0EOh4uGWw==", "dev": true, "requires": { "async": "^2.6.2", @@ -5521,22 +5833,13 @@ "istanbul-lib-instrument": "^3.3.0", "istanbul-lib-report": "^2.0.8", "istanbul-lib-source-maps": "^3.0.6", - "istanbul-reports": "^2.2.4", + "istanbul-reports": "^2.2.5", "js-yaml": "^3.13.1", "make-dir": "^2.1.0", "minimatch": "^3.0.4", "once": "^1.4.0" }, "dependencies": { - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, "istanbul-lib-coverage": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", @@ -5558,34 +5861,10 @@ "semver": "^6.0.0" } }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - }, - "dependencies": { - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - } - } - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, "semver": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", - "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -5844,9 +6123,9 @@ "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==" }, "js-base64": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz", - "integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.2.tgz", + "integrity": "sha512-Vg8czh0Q7sFBSUMWWArX/miJeBWYBPpdU/3M/DKSaekLMqrqVPaedp+5mZhie/r0lgrcaYBfwXatEew6gwgiQQ==", "dev": true, "optional": true }, @@ -5922,6 +6201,15 @@ "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", "dev": true }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -6030,6 +6318,16 @@ "karma-jasmine": "^1.0.2" } }, + "karma-phantomjs-launcher": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/karma-phantomjs-launcher/-/karma-phantomjs-launcher-1.0.4.tgz", + "integrity": "sha1-0jyjSAG9qYY60xjju0vUBisTrNI=", + "dev": true, + "requires": { + "lodash": "^4.0.1", + "phantomjs-prebuilt": "^2.1.7" + } + }, "karma-source-map-support": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/karma-source-map-support/-/karma-source-map-support-1.3.0.tgz", @@ -6039,6 +6337,12 @@ "source-map-support": "^0.5.5" } }, + "kew": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", + "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=", + "dev": true + }, "killable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", @@ -6046,11 +6350,20 @@ "dev": true }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, "lcid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", @@ -6095,6 +6408,14 @@ "clone": "^2.1.1", "loader-utils": "^1.1.0", "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } } }, "levn": { @@ -6242,9 +6563,9 @@ } }, "loglevel": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.3.tgz", - "integrity": "sha512-LoEDv5pgpvWgPF4kNYuIp0qqSJVWak/dML0RY74xlzMZiT9w77teNAwKYKWBTYjlokMirg+o3jBwp+vlLrcfAA==", + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.8.tgz", + "integrity": "sha512-bsU7+gc9AJ2SqpzxwU3+1fedl8zAntbtC5XYlt3s2j1hJcn2PsXSmgN8TaLG/J1/2mod4+cE/3vNL70/c1RNCA==", "dev": true }, "loose-envify": { @@ -6286,12 +6607,21 @@ } }, "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "dev": true, "requires": { - "pify": "^3.0.0" + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "make-error": { @@ -6405,9 +6735,9 @@ }, "dependencies": { "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true, "optional": true } @@ -6454,6 +6784,14 @@ "requires": { "bn.js": "^4.0.0", "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + } } }, "mime": { @@ -6579,12 +6917,20 @@ } }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } } }, "move-concurrently": { @@ -6684,9 +7030,9 @@ "dev": true }, "node-forge": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.5.tgz", - "integrity": "sha512-MmbQJ2MTESTjt3Gi/3yG1wGpIMhUfcIypUCGtTizFR9IiccFwxSpfp0vtIZlkFclEqERemxfnSdZEMR9VqqEFQ==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", + "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==", "dev": true }, "node-gyp": { @@ -6759,13 +7105,10 @@ } }, "node-releases": { - "version": "1.1.25", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.25.tgz", - "integrity": "sha512-fI5BXuk83lKEoZDdH3gRhtsNgh05/wZacuXkgbiYkceE7+QIMXOg98n9ZV7mz27B+kFHnqHcUpscZZlGRSmTpQ==", - "dev": true, - "requires": { - "semver": "^5.3.0" - } + "version": "1.1.55", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.55.tgz", + "integrity": "sha512-H3R3YR/8TjT5WPin/wOoHOUPHgvj8leuU/Keta/rwelEQN9pA/S2Dx8/se4pZ2LBxSd0nAGzsNzhqwa77v7F1w==", + "dev": true }, "node-sass": { "version": "4.9.3", @@ -7083,6 +7426,28 @@ } } }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, + "object-is": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.2.tgz", + "integrity": "sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, "object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", @@ -7092,6 +7457,18 @@ "isobject": "^3.0.0" } }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", @@ -7197,17 +7574,17 @@ } }, "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, "requires": { "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", + "fast-levenshtein": "~2.0.6", "levn": "~0.3.0", "prelude-ls": "~1.1.2", "type-check": "~0.3.2", - "wordwrap": "~1.0.0" + "word-wrap": "~1.2.3" } }, "original": { @@ -7312,20 +7689,20 @@ "dev": true }, "parallel-transform": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", - "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", "dev": true, "requires": { - "cyclist": "~0.2.2", + "cyclist": "^1.0.1", "inherits": "^2.0.3", "readable-stream": "^2.1.5" } }, "parse-asn1": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", - "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", + "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", "dev": true, "requires": { "asn1.js": "^4.0.0", @@ -7465,6 +7842,14 @@ "dev": true, "requires": { "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } } }, "pbkdf2": { @@ -7480,16 +7865,39 @@ "sha.js": "^2.4.8" } }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, + "phantomjs-prebuilt": { + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", + "integrity": "sha1-79ISpKOWbTZHaE6ouniFSb4q7+8=", + "dev": true, + "requires": { + "es6-promise": "^4.0.3", + "extract-zip": "^1.6.5", + "fs-extra": "^1.0.0", + "hasha": "^2.2.0", + "kew": "^0.7.0", + "progress": "^1.1.8", + "request": "^2.81.0", + "request-progress": "^2.0.1", + "which": "^1.2.10" + } + }, "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, "pinkie": { @@ -7516,6 +7924,15 @@ "find-up": "^2.1.0" } }, + "pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", + "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, "portfinder": { "version": "1.0.17", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.17.tgz", @@ -7525,6 +7942,14 @@ "async": "^1.5.2", "debug": "^2.2.0", "mkdirp": "0.5.x" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + } } }, "posix-character-classes": { @@ -7616,6 +8041,12 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, + "progress": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "dev": true + }, "promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", @@ -7704,9 +8135,9 @@ } }, "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "pify": { @@ -7758,15 +8189,21 @@ } }, "proxy-addr": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", - "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", "dev": true, "requires": { "forwarded": "~0.1.2", - "ipaddr.js": "1.9.0" + "ipaddr.js": "1.9.1" } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -7797,6 +8234,14 @@ "parse-asn1": "^5.0.0", "randombytes": "^2.0.1", "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + } } }, "pump": { @@ -7826,6 +8271,93 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "puppeteer": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-2.1.1.tgz", + "integrity": "sha512-LWzaDVQkk1EPiuYeTOj+CZRIjda4k2s5w4MK4xoH2+kgWV/SDlkYHmxatDdtYrciHUKSXTsGgPgPP8ILVdBsxg==", + "dev": true, + "requires": { + "@types/mime-types": "^2.1.0", + "debug": "^4.1.0", + "extract-zip": "^1.6.6", + "https-proxy-agent": "^4.0.0", + "mime": "^2.0.3", + "mime-types": "^2.1.25", + "progress": "^2.0.1", + "proxy-from-env": "^1.0.0", + "rimraf": "^2.6.1", + "ws": "^6.1.0" + }, + "dependencies": { + "agent-base": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", + "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "https-proxy-agent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", + "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", + "dev": true, + "requires": { + "agent-base": "5", + "debug": "4" + } + }, + "mime": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", + "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", + "dev": true + }, + "mime-db": { + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "dev": true, + "requires": { + "mime-db": "1.43.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "ws": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0" + } + } + } + }, "q": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", @@ -8093,6 +8625,16 @@ "safe-regex": "^1.1.0" } }, + "regexp.prototype.flags": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", + "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, "regexpu-core": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz", @@ -8182,6 +8724,15 @@ "uuid": "^3.3.2" } }, + "request-progress": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-2.0.1.tgz", + "integrity": "sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg=", + "dev": true, + "requires": { + "throttleit": "^1.0.0" + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -8327,9 +8878,9 @@ "dev": true }, "sass-graph": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", - "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.6.tgz", + "integrity": "sha512-MKuEYXFSGuRSi8FZ3A7imN1CeVn9Gpw0/SFJKdL1ejXJneI9a5rwlEZrKejhEFAA3O6yr3eIyl/WuvASvlT36g==", "dev": true, "optional": true, "requires": { @@ -8351,6 +8902,14 @@ "neo-async": "^2.5.0", "pify": "^3.0.0", "semver": "^5.5.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } } }, "saucelabs": { @@ -8432,12 +8991,12 @@ } }, "selfsigned": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.4.tgz", - "integrity": "sha512-9AukTiDmHXGXWtWjembZ5NDmVvP2695EtpgbCsxCa68w3c88B+alqbmZ4O3hZ4VWGXeGWzEVdvqgAJD8DQPCDw==", + "version": "1.10.7", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.7.tgz", + "integrity": "sha512-8M3wBCzeWIJnQfl43IKwOmC4H/RAp50S8DF60znzjW5GVqTcSe2vWclt7hmYVPkKPlHWOu5EaWOMZ2Y6W8ZXTA==", "dev": true, "requires": { - "node-forge": "0.7.5" + "node-forge": "0.9.0" } }, "semver": { @@ -8494,9 +9053,9 @@ } }, "serialize-javascript": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz", - "integrity": "sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.9.1.tgz", + "integrity": "sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==", "dev": true }, "serve-index": { @@ -8924,6 +9483,12 @@ } } }, + "sonar-scanner": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/sonar-scanner/-/sonar-scanner-3.1.0.tgz", + "integrity": "sha1-UcHBEB9UuYq8XYVlIJsdkjKXk0M=", + "dev": true + }, "source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -8944,17 +9509,6 @@ "requires": { "async": "^2.5.0", "loader-utils": "^1.1.0" - }, - "dependencies": { - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - } } }, "source-map-resolve": { @@ -9062,9 +9616,9 @@ } }, "speed-measure-webpack-plugin": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/speed-measure-webpack-plugin/-/speed-measure-webpack-plugin-1.3.1.tgz", - "integrity": "sha512-qVIkJvbtS9j/UeZumbdfz0vg+QfG/zxonAjzefZrqzkr7xOncLVXkeGbTpzd1gjCBM4PmVNkWlkeTVhgskAGSQ==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/speed-measure-webpack-plugin/-/speed-measure-webpack-plugin-1.3.3.tgz", + "integrity": "sha512-2ljD4Ch/rz2zG3HsLsnPfp23osuPBS0qPuz9sGpkNXTN1Ic4M+W9xB8l8rS8ob2cO4b1L+WTJw/0AJwWYVgcxQ==", "dev": true, "requires": { "chalk": "^2.0.1" @@ -9191,9 +9745,9 @@ } }, "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", "dev": true }, "streamroller": { @@ -9236,6 +9790,48 @@ "strip-ansi": "^3.0.0" } }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimleft": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" + } + }, + "string.prototype.trimright": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -9407,9 +10003,9 @@ "dev": true }, "source-map-support": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", - "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -9477,9 +10073,9 @@ } }, "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -9509,16 +10105,6 @@ "yallist": "^3.0.2" } }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - } - }, "mississippi": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", @@ -9538,9 +10124,9 @@ } }, "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -9561,12 +10147,6 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, "pkg-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", @@ -9586,12 +10166,6 @@ "once": "^1.3.1" } }, - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -9608,13 +10182,19 @@ } }, "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true } } }, + "throttleit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", + "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=", + "dev": true + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -9632,15 +10212,15 @@ } }, "thunky": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.0.3.tgz", - "integrity": "sha512-YwT8pjmNcAXBZqrubu22P4FYsh2D4dxRmnWBOL8Jk8bUcRUtc5326kx32tuTmFDAZtLOGEVNl8POAR8j896Iow==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", + "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", "dev": true }, "timers-browserify": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", - "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz", + "integrity": "sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==", "dev": true, "requires": { "setimmediate": "^1.0.4" @@ -9785,9 +10365,9 @@ }, "dependencies": { "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true } } @@ -10196,9 +10776,9 @@ } }, "vm-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", - "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", "dev": true }, "void-elements": { @@ -10208,14 +10788,42 @@ "dev": true }, "watchpack": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", - "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.1.tgz", + "integrity": "sha512-+IF9hfUFOrYOOaKyfaI7h7dquUIOgyEMoQMLA7OP5FxegKA2+XdXThAZ9TU2kucfhDH7rfMHs1oPYziVGWRnZA==", "dev": true, "requires": { - "chokidar": "^2.0.2", + "chokidar": "^2.1.8", "graceful-fs": "^4.1.2", "neo-async": "^2.5.0" + }, + "dependencies": { + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + } } }, "wbuf": { @@ -10328,9 +10936,9 @@ }, "dependencies": { "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.5.tgz", + "integrity": "sha512-3hQhEUF027BuxZjQA3s7rIv/7VCQPa27hN9u9g87sEkWaKwQPuXOkVKtOeiyUrnWqTDiOs8Ed2rwg733mB0R5w==", "dev": true } } @@ -10501,9 +11109,9 @@ } }, "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.5.tgz", + "integrity": "sha512-3hQhEUF027BuxZjQA3s7rIv/7VCQPa27hN9u9g87sEkWaKwQPuXOkVKtOeiyUrnWqTDiOs8Ed2rwg733mB0R5w==", "dev": true }, "ms": { @@ -10524,9 +11132,9 @@ } }, "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -10724,6 +11332,12 @@ "string-width": "^1.0.2 || 2" } }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -10877,6 +11491,16 @@ } } }, + "yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "dev": true, + "requires": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, "yeast": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", diff --git a/portal-FE-os/package.json b/portal-FE-os/package.json index 4371bc4d..5baf36ba 100644 --- a/portal-FE-os/package.json +++ b/portal-FE-os/package.json @@ -50,7 +50,7 @@ "zone.js": "~0.8.26" }, "devDependencies": { - "@angular-devkit/build-angular": "^0.10.0", + "@angular-devkit/build-angular": "^0.10.7", "@angular/cli": "~7.0.6", "@angular/compiler-cli": "~7.0.0", "@angular/language-service": "~7.0.0", diff --git a/portal-FE-os/pom.xml b/portal-FE-os/pom.xml index af265d06..615e7fa9 100644 --- a/portal-FE-os/pom.xml +++ b/portal-FE-os/pom.xml @@ -4,7 +4,7 @@ <groupId>org.onap.portal</groupId> <artifactId>portal-FE-os</artifactId> - <version>3.3.0</version> + <version>3.4.0</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> @@ -70,7 +70,7 @@ </executions> </plugin> - + <plugin> <groupId>com.github.eirslett</groupId> <artifactId>frontend-maven-plugin</artifactId> @@ -135,6 +135,7 @@ </executions> </plugin> + </plugins> </build> </project> diff --git a/portal-FE-os/src/app/.gitignore b/portal-FE-os/src/app/.gitignore index 75b6ddab..fe6b8ee1 100644 --- a/portal-FE-os/src/app/.gitignore +++ b/portal-FE-os/src/app/.gitignore @@ -1,5 +1,6 @@ /ng-material-module.ts /layout/ +!layout/components/search-users /modals/ /shared/ !shared/interceptors/ diff --git a/portal-FE-os/src/app/app.component.html b/portal-FE-os/src/app/app.component.html index dea5177c..2c914c52 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 7a773398..e739496d 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 dbfb568f..389153bd 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-common/src/app/layout/components/search-users/search-users.component.html b/portal-FE-os/src/app/layout/components/search-users/search-users.component.html index 03624491..4c318f9f 100644 --- a/portal-FE-common/src/app/layout/components/search-users/search-users.component.html +++ b/portal-FE-os/src/app/layout/components/search-users/search-users.component.html @@ -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 diff --git a/portal-FE-common/src/app/layout/components/search-users/search-users.component.scss b/portal-FE-os/src/app/layout/components/search-users/search-users.component.scss index 95a2a5ec..95a2a5ec 100644 --- a/portal-FE-common/src/app/layout/components/search-users/search-users.component.scss +++ b/portal-FE-os/src/app/layout/components/search-users/search-users.component.scss diff --git a/portal-FE-common/src/app/layout/components/search-users/search-users.component.spec.ts b/portal-FE-os/src/app/layout/components/search-users/search-users.component.spec.ts index 9db3e395..9db3e395 100644 --- a/portal-FE-common/src/app/layout/components/search-users/search-users.component.spec.ts +++ b/portal-FE-os/src/app/layout/components/search-users/search-users.component.spec.ts diff --git a/portal-FE-common/src/app/layout/components/search-users/search-users.component.ts b/portal-FE-os/src/app/layout/components/search-users/search-users.component.ts index b93ffd61..10e4e041 100644 --- a/portal-FE-common/src/app/layout/components/search-users/search-users.component.ts +++ b/portal-FE-os/src/app/layout/components/search-users/search-users.component.ts @@ -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); + } + } diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.html b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.html index bef37b84..f68d8798 100644 --- a/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.html +++ b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.html @@ -36,240 +36,308 @@ --> <div class="container"> - <!--Modal Headers--> + <!--Modal Headers--> <div class="modal-header"> <h4 class="modal-title">Application Details</h4> <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross')"> <span aria-hidden="true">×</span> </button> </div> - <!--Modal Body goes here--> + <!--Modal Body goes here--> <div class="modal-body"> <div class="application-details-modal"> - <div class="app-properties-main" scroll-top="appDetails.scrollApi"> - <form name="appForm" novalidate autocomplete="off"> - <div id="app-left-container" class="left-container"> - <div class="property-label checkbox-label"> + <div class="app-properties-main" scroll-top="appDetails.scrollApi"> + <form name="appForm" novalidate autocomplete="off"> + <div id="app-left-container" class="left-container"> + <!-- <div class="property-label checkbox-label"> <mat-checkbox name="isRestrictedApp" type="checkbox" [(ngModel)]="applicationObj.restrictedApp" id="checkbox-app-is-restricted" [disabled]="isEditMode" [checked]="applicationObj.restrictedApp"> Hyperlink only application </mat-checkbox> - </div> - - <div class="property required"> - <div class="property-label">Application Name</div> - <input id="input-app-name" type="text" - [(ngModel)]="applicationObj.name" maxlength="100" name="name" - pattern="/^[a-zA-Z0-9_\-\s\&]*$/" required="true" /> - - <div id="error-container-conflict" class="error-container" ng-show="appDetails.conflictMessages.name" - id="conflictMessages-name"> - <small id="app-name-error-conflict" class="err-message" - ng-bind="appDetails.conflictMessages.name"> - </small> - </div> - - <div id="error-container-edit" class="error-container" - *ngIf="(!applicationObj.name || applicationObj.name.length == 0)"> - <small id="app-name-error-required" class="err-message"> - Application name is required - </small> - </div> - </div> - - <div [ngClass]="(applicationObj.isEnabled) ? 'property required' : 'property'"> - <div id="url-property-label" class="property-label">URL</div> - <input id="input-app-url" [(ngModel)]="applicationObj.url" - maxlength="256" name="url" type="url" placeholder="https://" - pattern="/^((?:https?\:\/\/|ftp?\:\/\/)?(w{3}.)?(?:[-a-z0-9]+\.)*[-a-z0-9]+.*)[^-_.]$/i" required /> + </div> --> + + <div class="property required"> + <div class="property-label" style="display: flex;"> + <span style="flex: 9">Application Name</span> + <app-information-tooltip style="flex: 1;" + [textMessage]="'Application Name Information'"> + </app-information-tooltip> + </div> + <input #applicationName id="input-app-name" type="text" [(ngModel)]="applicationObj.appName" + maxlength="100" name="name" pattern="/^[a-zA-Z0-9_\-\s\&]*$/" required="true" /> - <div id="error-container-edit" class="error-container" - *ngIf="(applicationObj.isEnabled && applicationObj.url=='')"> - <small id="app-name-error-required" class="err-message"> - Application URL is required - </small> + <div id="error-container-conflict" class="error-container" + ng-show="appDetails.conflictMessages.name" id="conflictMessages-name"> + <small id="app-name-error-conflict" class="err-message" + ng-bind="appDetails.conflictMessages.name"> + </small> + </div> </div> - </div> - - <div [ngClass]="(applicationObj.isEnabled) ? 'property required' : 'property'" - [hidden] ="applicationObj.restrictedApp"> - <div class="property-label">Rest API URL</div> - <input id="input-app-rest-url" [(ngModel)]="applicationObj.restUrl" - name="restUrl" type="url" placeholder="https://" - pattern="/^((?:https?\:\/\/|ftp?\:\/\/)?(w{3}.)?(?:[-a-z0-9]+\.)*[-a-z0-9]+.*)[^-_.]$/i" maxlength="256" - ng-required="!applicationObj.restrictedApp" /> - - <div id="error-container-edit" class="error-container" - *ngIf="(applicationObj.isEnabled && applicationObj.restUrl=='')"> - <small id="app-name-error-required" class="err-message"> - Rest API URL is required - </small> + + <div id="property-active" class="property-active" style="display: flex; + justify-content: flex-end;margin-right: 16px;"> + <mat-checkbox name="isEnabled" [(ngModel)]="applicationObj.isEnabled" + [checked]="applicationObj.isEnabled" id="checkbox-app-is-enabled">Active + </mat-checkbox> </div> - </div> - - <div [ngClass]="(applicationObj.isEnabled || applicationObj.isCentralAuth) ? 'property required' : 'property'" - [hidden] ="applicationObj.restrictedApp"> - <div id="username-property-label" class="property-label">Username</div> - <input type="text" id="input-username-property" [(ngModel)]="applicationObj.username" name="username" - maxlength="256" ng-required="!appDetails.app.restrictedApp" /> - - <div id="error-container-edit" class="error-container" - *ngIf="((applicationObj.isEnabled || applicationObj.isCentralAuth) && applicationObj.username =='')"> - <small id="app-name-error-required" class="err-message"> - App Username is required - </small> + + <div class="property"> + <div class="property-label" style="display: flex;"> + <mat-label style="flex: 9">Application Type</mat-label> + <app-information-tooltip style="flex: 1;" + [textMessage]="'Application Type Information - Gui, Hyperlink or Non-gui'"> + </app-information-tooltip> + </div> + <mat-select [disabled]="action === 'edit'" [(value)]="applicationObj.applicationType"> + <mat-option *ngFor="let appType of applicationTypeArray" [value]="appType.value"> + {{appType.name}} + </mat-option> + </mat-select> </div> - </div> - - <div [ngClass]="(applicationObj.isEnabled && !applicationObj.isCentralAuth) ? 'property required' : 'property'" - [hidden] ="applicationObj.restrictedApp"> - <div id="pwd-property-label" class="property-label">Password</div> - <input type="password" id="input-mylogins-password" - [(ngModel)]="applicationObj.appPassword" autocomplete="new-password" - name="appPassword" maxlength="256"/> - <div id="error-container-edit" class="error-container" - *ngIf="(applicationObj.isEnabled && !applicationObj.isCentralAuth && applicationObj.appPassword =='')"> - <small id="app-name-error-required" class="err-message"> - Password is required - </small> + <div class="property" *ngIf="applicationObj.applicationType == '1'"> + <div class="property-label" style="display: flex;"> + <mat-label style="flex: 9">Mode of Integration</mat-label> + <app-information-tooltip style="flex: 1;" + [textMessage]="'Mode Of Integration. SDK or Framework'"> + </app-information-tooltip> + </div> + <mat-select [(value)]="applicationObj.modeOfIntegration"> + <mat-option *ngFor="let integrationType of modeOfIntegration" + [value]="integrationType.value"> + {{integrationType.name}} + </mat-option> + </mat-select> </div> - </div> - </div> - - <!-- Right container--> - <div class="right-container"> - <div class="property"> - <div class="property-label">Upload Image</div> - <input type="file" id="input-app-image-upload" - class="input-file-field input-app-image-upload-ht" - accept="image/*" [(ngModel)]="applicationObj.originalImage" - name="appImage" image-upload="applicationObj.originalImage" - image-upload-resize-max-height="300" - image-upload-resize-max-width="360" - image-upload-resize-quality="0.7" - image-upload-api="appDetails.imageApi" - (change)="appImageHandler($event)" /> - - <div id="app-error-image-upload-type" class="error-container" - *ngIf="appImageTypeError" class="ng-hide"> - <div class="error-container"> - <small id="error-app-invalid-image-size" class="err-message">File must be an image</small> + + <div class="property" *ngIf="!(applicationObj.applicationType == '2')"> + <div class="property-label" style="display: flex;"> + <mat-label style="flex: 9">Roles Management Type</mat-label> + <app-information-tooltip style="flex: 1;" [textMessage]="'Roles Management Type'"> + </app-information-tooltip> + </div> + <mat-select [(value)]="applicationObj.rolesInAAF"> + <mat-option *ngFor="let roleRepo of rolesManagementType" [value]="roleRepo.value"> + {{roleRepo.name}} + </mat-option> + </mat-select> </div> - </div> - - <div id="app-error-image-upload" class="error-container" - *ngIf="(applicationObj.originalImage && applicationObj.originalImage.dirty)"> - <div ng-messages="appForm.appImage.$error" - class="error-container"> - <small id="error-app-invalid-image-size" class="err-message" - ng-message="imageSize">Image file must be smaller than - 1MB</small> + + <div *ngIf="!((applicationObj.applicationType=='2') || (!applicationObj.rolesInAAF))" + class="property-active" style="display: flex;"> + <mat-checkbox style="flex: 9" name="appAck" [(ngModel)]="applicationObj.appAck"> + Notify App For AAF Operations + </mat-checkbox> + <app-information-tooltip style="flex: 1;" + [textMessage]="'Notify application for AAF operations'"> + </app-information-tooltip> </div> - </div> - - <div class="property-label preview"> - <span class="left-label">Preview</span> - <span class="remove" (click)="removeImage()">Remove</span> - </div> - <img id="image-app-preview" class="image-preview" - src="{{applicationObj.imageLink || applicationObj.thumbnail || emptyImgForPreview}}" /> - - <br/> - <div id="property-active" class="property-active"> - <mat-checkbox name="isEnabled" [(ngModel)]="applicationObj.isEnabled" - [checked]="applicationObj.isEnabled" - id="checkbox-app-is-enabled">Active - </mat-checkbox> - </div> - - <div id="property-guest-access" class="property-guest-access"> - <mat-checkbox name="isOpen" [(ngModel)]="applicationObj.isOpen" id="checkbox-app-is-open" - [checked]="(applicationObj.isOpen || applicationObj.restrictedApp)" - [disabled]="applicationObj.restrictedApp">Allow guest access</mat-checkbox> - </div> - - <div class="table-control" style="display: inline-flex;" [hidden] ="applicationObj.restrictedApp"> - <div id="property-is-central-auth" class="property" [hidden] ="applicationObj.restrictedApp"> - <mat-checkbox name="isCentralAuth" [(ngModel)]="applicationObj.isCentralAuth" - id="checkbox-app-is-central-auth" [checked]="applicationObj.isCentralAuth"> - Centralized + + <div class="property-active" *ngIf="!(applicationObj.applicationType == '2' + ||(!applicationObj.rolesInAAF))"> + <mat-checkbox name="usesCadi" [(ngModel)]="applicationObj.usesCadi" + [checked]="applicationObj.usesCadi">Is CADI Enabled? </mat-checkbox> </div> - - <div class="centralized-key" aria-haspopup="true" style="padding-left: 150px;"> - <div b2b-flyout-toggler class="notification-div" > - <div id="tooltip" class="icon-primary-flat-info" tabindex="0" - b2b-accessibility-click="13,32" aria-label="notifications" - aria-haspopup="true" - role="button"></div> + + <div class="table-control" style="display: inline-flex;" + *ngIf="!(applicationObj.applicationType == '2' || !applicationObj.rolesInAAF)"> + + <div [ngClass]="(applicationObj.rolesInAAF) ? 'property required' : 'property'" + style="width: 250px;"> + <div id="pwd-property-label" class="property-label">AAF Namespace</div> + <input type="text" id="input-mylogins-auth-namespace" + [(ngModel)]="applicationObj.nameSpace" name="appAuthNameSpace" maxlength="256" + [disabled]="!applicationObj.rolesInAAF" /> </div> - - <!--<div id="notification" align="left"> - <p class="uuid-text" - style="font: normal 12px Omnes-ECOMP-W02, Arial;"> - To convert the non-centralized app to centralized app please - follow below steps. <a href="https://wiki.web.att.com/display/ECops/BulkUpload" target="_blank"> - https://wiki.web.att.com/display/ECops/BulkUpload</a> - </p> + <div class="communitcaion-key" aria-haspopup="true" style="padding-left: 20px;"> + + <div b2b-flyout-toggler class="notification-div"> + <div id="tooltip" class="icon-primary-flat-info" tabindex="0" + b2b-accessibility-click="13,32" aria-label="notifications" aria-haspopup="true" + role="button"></div> + </div> + <!--<div id="notification" align="left"> + <p class="nameSpace-text" style="font: normal 12px Omnes-ECOMP-W02, Arial;">NameSpace should be created in AAF and portal mechid should be admin of the given namespace.</p> </div>--> + </div> + </div> + + <div *ngIf="!(applicationObj.applicationType == '3')" + [ngClass]="(applicationObj.isEnabled) ? 'property required' : 'property'"> + <div class="property-label" style="display: flex;"> + <span style="flex: 9">Landing Page</span> + <app-information-tooltip style="flex: 1;" [textMessage]="'Application URL Information'"> + </app-information-tooltip> + </div> + <input id="input-app-url" [(ngModel)]="applicationObj.landingPage" maxlength="256" + name="url" type="url" placeholder="https://" + pattern="/^((?:https?\:\/\/|ftp?\:\/\/)?(w{3}.)?(?:[-a-z0-9]+\.)*[-a-z0-9]+.*)[^-_.]$/i" + required /> + + <div id="error-container-edit" class="error-container" + *ngIf="(applicationObj.isEnabled && applicationObj.landingPage=='')"> + <small id="app-name-error-required" class="err-message"> + Landing Page URL is required + </small> + </div> + </div> + + <div [ngClass]="(applicationObj.isEnabled) ? 'property required' : 'property'" + *ngIf="!(applicationObj.applicationType == '2' || applicationObj.applicationType == '3')"> + <div class="property-label" style="display: flex;"> + <span style="flex: 9">Rest API URL</span> + <app-information-tooltip style="flex: 1;" [textMessage]="'Rest Api URL Information'"> + </app-information-tooltip> + </div> + <input id="input-app-rest-url" [(ngModel)]="applicationObj.restUrl" name="restUrl" + type="url" placeholder="https://" + pattern="/^((?:https?\:\/\/|ftp?\:\/\/)?(w{3}.)?(?:[-a-z0-9]+\.)*[-a-z0-9]+.*)[^-_.]$/i" + maxlength="256" ng-required="applicationObj.applicationType == '1'" /> + + <div id="error-container-edit" class="error-container" + *ngIf="(applicationObj.isEnabled && applicationObj.restUrl=='')"> + <small id="app-name-error-required" class="err-message"> + Rest API URL is required + </small> + </div> + </div> + + <div [ngClass]="(applicationObj.isEnabled || applicationObj.rolesInAAF) ? 'property required' : 'property'" + *ngIf="!(applicationObj.applicationType == '2')"> + <div id="username-property-label" class="property-label" style="display: flex;"> + <span style="flex: 9">Auth Configured User</span> + <app-information-tooltip style="flex: 1;" + [textMessage]="'Basic Authentication Username Information'"> + </app-information-tooltip> + </div> + <input type="text" id="input-username-property" + [(ngModel)]="applicationObj.appBasicAuthUsername" name="username" maxlength="256" + ng-required="!appDetails.app.restrictedApp" /> + + <div id="error-container-edit" class="error-container" + *ngIf="((applicationObj.isEnabled || applicationObj.rolesInAAF) && applicationObj.appBasicAuthUsername =='')"> + <small id="app-name-error-required" class="err-message"> + App Username is required + </small> + </div> + </div> + + <div [ngClass]="(applicationObj.isEnabled && !applicationObj.rolesInAAF) ? 'property required' : 'property'" + *ngIf="!(applicationObj.applicationType == '2' || (applicationObj.rolesInAAF && applicationObj.usesCadi))"> + <div id="pwd-property-label" class="property-label" style="display: flex;"> + <span style="flex: 9">Basic Auth Password</span> + <app-information-tooltip style="flex: 1;" + [textMessage]="'Basic Authentication Password Information'"> + </app-information-tooltip> + </div> + <input type="password" id="input-mylogins-password" + [(ngModel)]="applicationObj.appBasicAuthPassword" autocomplete="new-password" + name="appPassword" maxlength="256" /> + + <div id="error-container-edit" class="error-container" + *ngIf="(applicationObj.isEnabled && !applicationObj.rolesInAAF && applicationObj.appBasicAuthPassword =='')"> + <small id="app-name-error-required" class="err-message"> + Password is required + </small> + </div> </div> </div> - - <div class="table-control" style="display: inline-flex;" [hidden] ="applicationObj.restrictedApp"> - <div id="property-communication-key" class="property" - [hidden] ="applicationObj.restrictedApp" style="width: 250px;"> - <div id="property-communication-key-label" class="property-label">Application UUID</div> - <input type="text" id="input-UEB-communication-key" - [(ngModel)]="applicationObj.uebKey" name="uebKey" - readonly="readonly" [disabled]="true"/> + + <!-- Right container--> + <div class="right-container"> + + <div class="property" *ngIf="!(applicationObj.applicationType == '3')"> + <div class="property-label" style="display: flex;"> + <span style="flex: 9">Upload + Image</span> + <app-information-tooltip style="flex: 1;" + [textMessage]="'Image file(.png or.jpg or.jpeg with dimension 200X200 pixel) must be smaller than 1MB.'"> + </app-information-tooltip> + </div> + <input #inputAppImageUpload type="file" id="input-app-image-upload" + class="input-file-field input-app-image-upload-ht" accept="image/*" + [(ngModel)]="applicationObj.originalImage" name="appImage" + image-upload="applicationObj.originalImage" image-upload-resize-max-height="300" + image-upload-resize-max-width="360" image-upload-resize-quality="0.7" + image-upload-api="appDetails.imageApi" (change)="appImageHandler($event)" /> + + <div id="app-error-image-upload-type" class="error-container" *ngIf="appImageTypeError" + class="ng-hide"> + <div class="error-container"> + <small id="error-app-invalid-image-size" class="err-message">File must be an + image</small> + </div> + </div> + + <div id="app-error-image-upload" class="error-container" + *ngIf="(applicationObj.originalImage && applicationObj.originalImage.dirty)"> + <div ng-messages="appForm.appImage.$error" class="error-container"> + <small id="error-app-invalid-image-size" class="err-message" + ng-message="imageSize">Image file must be smaller than + 1MB</small> + </div> + </div> + </div> + + + <div class="property" *ngIf="!(applicationObj.applicationType == '3')"> + <div class="property-label preview"> + <span class="left-label">Preview</span> + <span *ngIf="(applicationObj.imageLink && applicationObj.imageLink.indexOf('default_app_image.gif') == -1 + ||applicationObj.thumbnail && applicationObj.thumbnail.indexOf('default_app_image.gif') == -1 + ||emptyImgForPreview && emptyImgForPreview.indexOf('default_app_image.gif') == -1)" + class="remove" (click)="removeImage()">Remove</span> + </div> + <img id="image-app-preview" class="image-preview" + src="{{applicationObj.imageLink || applicationObj.thumbnail || emptyImgForPreview}}" /> + </div> + + <div class="property" *ngIf="!(applicationObj.applicationType == '3')"> + <div id="property-guest-access" class="property-guest-access"> + <mat-checkbox name="isOpen" [(ngModel)]="applicationObj.isOpen" + id="checkbox-app-is-open" + [checked]="(applicationObj.isOpen || applicationObj.applicationType == '2')" + [disabled]="applicationObj.applicationType == '2'">Allow guest access + </mat-checkbox> + </div> </div> - <div class="communitcaion-key" aria-haspopup="true" style="padding-left: 20px;"> - <div b2b-flyout-toggler class="notification-div"> - <div id="tooltip" class="icon-primary-flat-info" tabindex="0" - b2b-accessibility-click="13,32" aria-label="notifications" - aria-haspopup="true" - role="button"></div> + <div class="table-control" style="display: inline-flex;" + *ngIf="!(applicationObj.applicationType == '2')"> + <div id="property-communication-key" class="property" + *ngIf="!(applicationObj.applicationType == '2' || applicationObj.applicationType == '3')" + style="width: 250px;"> + <div id="property-communication-key-label" class="property-label">Application + UUID</div> + <input type="text" id="input-UEB-communication-key" [(ngModel)]="applicationObj.uebKey" + name="uebKey" readonly="readonly" [disabled]="true" /> + </div> + + <div class="communitcaion-key" aria-haspopup="true" style="padding-left: 20px;"> + <div b2b-flyout-toggler class="notification-div"> + <div id="tooltip" class="icon-primary-flat-info" tabindex="0" + b2b-accessibility-click="13,32" aria-label="notifications" aria-haspopup="true" + role="button"></div> + </div> + <!--<div id="notification" align="left"> + <p class="uuid-text" style="font: normal 12px Omnes-ECOMP-W02, Arial;">Application UUID is used as a communication + key between application and portal.Please place this value in + portal.properties</p> + </div>--> + </div> </div> - <!--<div id="notification" align="left"> - <p class="uuid-text" style="font: normal 12px Omnes-ECOMP-W02, Arial;">Application UUID is used as a communication - key between application and portal.Please place this value in - portal.properties</p> - </div>--> - </div> - </div> - - <div class="table-control" style="display: inline-flex;" [hidden] ="applicationObj.restrictedApp"> - - <div [ngClass]="(applicationObj.isCentralAuth) ? 'property required' : 'property'" - [hidden] ="applicationObj.restrictedApp" style="width: 250px;"> - <div id="pwd-property-label" class="property-label" >Name Space</div> - <input type="text" id="input-mylogins-auth-namespace" - [(ngModel)]="applicationObj.nameSpace" name="appAuthNameSpace" - maxlength="256" [disabled]="!applicationObj.isCentralAuth" /> </div> - <div class="communitcaion-key" aria-haspopup="true" style="padding-left: 20px;"> - - <div b2b-flyout-toggler class="notification-div"> - <div id="tooltip" class="icon-primary-flat-info" tabindex="0" - b2b-accessibility-click="13,32" aria-label="notifications" - aria-haspopup="true" - role="button"></div> - </div> - <!--<div id="notification" align="left"> - <p class="nameSpace-text" style="font: normal 12px Omnes-ECOMP-W02, Arial;">NameSpace should be created in AAF and portal mechid should be admin of the given namespace.</p> - </div>--> - </div> - </div> - </div> - </div> - </form> + </form> </div> </div> - </div> - <div class="modal-footer"> - <button type="button" class="btn btn-primary" [disabled]="(!applicationObj.name || applicationObj.name.length == 0)" (click)="saveChanges()">Save</button> - <button type="button" class="btn btn-primary" (click)="activeModal.close('Close')">Cancel</button> + + <div class="modal-footer"> + <button type="button" class="btn btn-primary" + [disabled]="(!applicationObj.appName || applicationObj.appName.length == 0)" + (click)="saveChanges()">Save</button> + <button type="button" class="btn btn-primary" (click)="activeModal.close('Close')">Cancel</button> + </div> + </div> </div>
\ No newline at end of file diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.scss b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.scss index 0e042a96..1106eb5a 100644 --- a/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.scss +++ b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.scss @@ -35,6 +35,10 @@ * * */ + + .application-details-modal{ + min-height: 37vw; + } .application-details-modal .app-properties-mainapp-properties-main{ padding-left: 40px; @@ -58,7 +62,7 @@ .application-details-modal .app-properties-main .property{ position: relative; - margin-bottom: 18px; + margin-bottom: 16px; } .application-details-modal .app-properties-main .checkbox-label{ display: inline-block; @@ -73,7 +77,7 @@ } .application-details-modal .app-properties-main .preview{ width: 220px; - margin-top: 22px; + margin-top: 11px; display: block; } @@ -90,6 +94,17 @@ .application-details-modal .app-properties-main .input-field{ width: 220px; } + +mat-select { + width: 16em; + margin: 0; + font-family: inherit; + font-size: inherit; + line-height: inherit; + border-width: 2px; + border-style: ridge; + border-color: initial; +} .application-details-modal .app-properties-main .input-file-field{ width: 220px; @@ -129,6 +144,10 @@ width: 16em; } +.application-details-modal select { + width: 16em; +} + .application-details-modal input[type="url"] { width: 16em; } @@ -160,4 +179,19 @@ cursor: pointer; color: #007bff; } -
\ No newline at end of file +.application-deatils-radio-group{ + display: flex; + flex-direction: column; +} + +mat-radio-group{ + margin-left: 10%; +} + +.modal-footer{ + width: 100%; +} + +mat-form-field{ + width: 94%; +}
\ No newline at end of file diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.spec.ts b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.spec.ts index 629e5fa6..d1f352cb 100644 --- a/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.spec.ts +++ b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.spec.ts @@ -48,6 +48,9 @@ import { InformationModalComponent } from 'src/app/modals/information-modal/info import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; import { NgbModalBackdrop } from '@ng-bootstrap/ng-bootstrap/modal/modal-backdrop'; import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; +import { InformationTooltipComponent } from '../../information-tooltip/information-tooltip.component'; +import { MatTooltipModule } from '@angular/material'; +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; describe('ApplicationDetailsDialogComponent', () => { @@ -57,9 +60,10 @@ describe('ApplicationDetailsDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ApplicationDetailsDialogComponent,InformationModalComponent,ConfirmationModalComponent], - imports: [NgMaterialModule,FormsModule,HttpClientTestingModule,NgbModule.forRoot()], - providers: [NgbActiveModal] + declarations: [ ApplicationDetailsDialogComponent,InformationModalComponent,ConfirmationModalComponent, InformationTooltipComponent], + imports: [NgMaterialModule,FormsModule,HttpClientTestingModule,NgbModule.forRoot(), MatTooltipModule], + providers: [NgbActiveModal], + schemas: [CUSTOM_ELEMENTS_SCHEMA] }).overrideModule(BrowserDynamicTestingModule, { set: { entryComponents: [InformationModalComponent,ConfirmationModalComponent] } }) .compileComponents(); })); @@ -80,20 +84,20 @@ describe('ApplicationDetailsDialogComponent', () => { expect(component.removeImage).toHaveBeenCalledWith(); }); it('saveChanges should return stubbed value', () => { - component.applicationObj.isCentralAuth = true; + component.applicationObj.rolesInAAF = true; component.applicationObj.isEnabled = false; spyOn(component, 'saveChanges').and.callThrough(); component.saveChanges(); expect(component.saveChanges).toHaveBeenCalledWith(); component.applicationObj.isEnabled = true; - component.applicationObj.url = 'www.test.com' + component.applicationObj.landingPage = 'www.test.com' component.applicationObj.restrictedApp =true; //spyOn(component, 'saveChanges').and.callThrough(); component.saveChanges(); expect(component.saveChanges).toHaveBeenCalledWith(); - component.applicationObj.isCentralAuth = false; - component.applicationObj.url = 'test' + component.applicationObj.rolesInAAF = false; + component.applicationObj.landingPage = 'test' component.applicationObj.restrictedApp =false; component.applicationObj.isOpen = true; component.isEditMode =true; @@ -102,7 +106,7 @@ describe('ApplicationDetailsDialogComponent', () => { expect(component.saveChanges).toHaveBeenCalledWith(); }); it('saveChanges Central Auth is disabled', () => { - component.applicationObj.isCentralAuth = false; + component.applicationObj.rolesInAAF = false; component.applicationObj.isEnabled = false; spyOn(component, 'saveChanges').and.callThrough(); component.saveChanges(); @@ -115,11 +119,11 @@ describe('ApplicationDetailsDialogComponent', () => { }); it('saveChanges URL validation changes', () => { - component.applicationObj.isCentralAuth = true; + component.applicationObj.rolesInAAF = true; component.applicationObj.isEnabled = true; - component.applicationObj.name ='test'; - component.applicationObj.url = 'https://www.test.com' - component.applicationObj.username ='test' + component.applicationObj.appName ='test'; + component.applicationObj.landingPage = 'https://www.test.com' + component.applicationObj.appBasicAuthUsername ='test' component.applicationObj.nameSpace ='ONAP' spyOn(component, 'saveChanges').and.callThrough(); component.saveChanges(); diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.ts b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.ts index 7aad140a..852e9706 100644 --- a/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.ts +++ b/portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.ts @@ -36,7 +36,7 @@ * */ -import { Component, OnInit, Input, Output, EventEmitter, PLATFORM_ID, Inject, Injector} from '@angular/core'; +import { Component, OnInit, Input, Output, EventEmitter, ViewChild, ElementRef, Inject, PLATFORM_ID, Injector } from '@angular/core'; import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { IApplications } from 'src/app/shared/model/applications-onboarding/applications'; import { ApplicationsService } from 'src/app/shared/services'; @@ -51,6 +51,7 @@ import { isPlatformBrowser } from '@angular/common'; }) export class ApplicationDetailsDialogComponent implements OnInit { + addEditAction: any; emptyImg = null; emptyImgForPreview:string; conflictMessages = {}; @@ -71,34 +72,76 @@ export class ApplicationDetailsDialogComponent implements OnInit { } @Input() applicationObj: IApplications; + @Input() action: any; @Output() passEntry: EventEmitter<any> = new EventEmitter(); + @ViewChild('applicationName') applicationNameElement: ElementRef; + @ViewChild('inputAppImageUpload') inputAppImageUpload: ElementRef; newAppModel = { 'id': null, - 'name': null, + 'appName': null, 'imageUrl': null, - 'description': null, - 'notes': null, - 'url': null, + 'appDescription': null, + 'appNotes': null, + 'landingPage': null, 'alternateUrl': null, 'restUrl': null, 'isOpen': false, - 'username': null, - 'appPassword': null, + 'appBasicAuthUsername': null, + 'appBasicAuthPassword': null, 'thumbnail': this.emptyImg, 'isEnabled': false, - 'restrictedApp': false, - 'nameSpace':null, - 'isCentralAuth': false, - 'uebTopicName':null, + 'applicationType': null, + 'rolesInAAF': false, + 'nameSpace': null, + 'uebTopicName': null, 'uebKey': null, 'uebSecret': null, - 'imageLink': null + 'imageLink': null, + 'usesCadi': true, + 'modeOfIntegration': null, + 'appAck': false, + 'restrictedApp': false }; + applicationTypeArray: any[] = [ + { name: 'GUI Application', value: "1" }, + { name: 'HyperLink Application', value: "2" }, + { name: 'Non-GUI Application', value: "3" } + + ]; + + rolesManagementType: any[] = [ + { name: 'Roles in Application (Non-Centralized)', value: false }, + { name: 'Roles in AAF (Centralized)', value: true } + ]; + + modeOfIntegration: any[] = [ + { name: 'Portal SDK Based', value: 'sdk' }, + { name: 'Framework Based', value: 'fw' } + ] ngOnInit() { - if(this.applicationObj.id){ + + this.addEditAction = this.action; + + + if (this.action === 'add') { + this.applicationObj.applicationType = "1"; + if (this.applicationObj.applicationType == '1') { + this.applicationObj.modeOfIntegration = this.modeOfIntegration[0].value; + } + this.applicationObj.rolesInAAF = true; + this.applicationObj.usesCadi = true; + this.applicationObj.appAck = false; + console.log("Action : ", this.action); + console.log("Focus : ", this.applicationNameElement.nativeElement); + setTimeout(() => { // this will make the execution after the above boolean has changed + this.applicationNameElement.nativeElement.focus(); + }, 0); + } + + if (this.applicationObj.id) { this.isEditMode = true; }else{ this.isEditMode = false; @@ -158,6 +201,7 @@ export class ApplicationDetailsDialogComponent implements OnInit { this.applicationObj.imageUrl = null; this.applicationObj.imageLink = null; this.emptyImgForPreview = '../../../assets/images/default_app_image.gif'; + this.inputAppImageUpload.nativeElement.value = ""; } }, (resut) => { return; @@ -167,59 +211,91 @@ export class ApplicationDetailsDialogComponent implements OnInit { /** Add/Edit Application Method*/ saveChanges() { //console.log("addNewApplication getting called.."); - if(this.applicationObj.isCentralAuth){ + if (this.applicationObj.rolesInAAF) { + //if valid. + if (this.applicationObj.applicationType == "1") { + console.log("Gui Application valodations"); //if valid. - if(!this.applicationObj.isEnabled){ - if(((this.applicationObj.name == 'undefined' || !this.applicationObj.name)||(this.applicationObj.nameSpace == 'undefined' - || !this.applicationObj.nameSpace) ||(this.applicationObj.username == 'undefined' || !this.applicationObj.username))) { - this.openConfirmationModal('','Please fill in all required fields(*) for centralized application'); + if (!this.applicationObj.isEnabled) { + if (((this.applicationObj.appName == 'undefined' || !this.applicationObj.appName) || (this.applicationObj.nameSpace == 'undefined' + || !this.applicationObj.nameSpace) || (this.applicationObj.appBasicAuthUsername == 'undefined' || !this.applicationObj.appBasicAuthUsername))) { + this.openConfirmationModal('', 'Please fill in all required fields(*) for centralized application'); return; } } - if(this.applicationObj.isEnabled){ - if(((this.applicationObj.name == 'undefined' || !this.applicationObj.name) - ||(this.applicationObj.url == 'undefined'|| !this.applicationObj.url) - ||(this.applicationObj.username == 'undefined' || !this.applicationObj.username)||(this.applicationObj.nameSpace == 'undefined' - || !this.applicationObj.nameSpace))) { + if (this.applicationObj.isEnabled) { + if (((this.applicationObj.appName == 'undefined' || !this.applicationObj.appName) + || (this.applicationObj.landingPage == 'undefined' || !this.applicationObj.landingPage) + || (this.applicationObj.appBasicAuthUsername == 'undefined' || !this.applicationObj.appBasicAuthUsername) || (this.applicationObj.nameSpace == 'undefined' + || !this.applicationObj.nameSpace))) { - this.openConfirmationModal('','Please fill in all required fields(*) for centralized active application'); + this.openConfirmationModal('', 'Please fill in all required fields(*) for centralized active application'); return; } } - }else{ - if(!this.applicationObj.isEnabled) { - if((this.applicationObj.name == 'undefined' || !this.applicationObj.name)){ - this.openConfirmationModal('','Please fill in all required field(*) ApplicationName to Save the applictaion'); - return; - } - }else if(this.applicationObj.isEnabled && !this.applicationObj.restrictedApp){ - if((this.applicationObj.name == 'undefined' || !this.applicationObj.name) - ||(this.applicationObj.url == 'undefined'|| !this.applicationObj.url) - ||(this.applicationObj.username == 'undefined' || !this.applicationObj.username)|| - (this.applicationObj.appPassword== 'undefined' || !this.applicationObj.appPassword)) { - - this.openConfirmationModal('','Please fill in all required fields(*) along with password as the app is not centralized'); - return; + } else if (this.applicationObj.applicationType == "3") { + console.log("Non-Gui Application valodations"); + if (!this.applicationObj.isEnabled) { + if (((this.applicationObj.appName == 'undefined' || !this.applicationObj.appName) || (this.applicationObj.nameSpace == 'undefined' + || !this.applicationObj.nameSpace) || (this.applicationObj.appBasicAuthUsername == 'undefined' || !this.applicationObj.appBasicAuthUsername))) { + this.openConfirmationModal('', 'Please fill in all required fields(*) for centralized application'); + return; } - }else if(this.applicationObj.isEnabled && this.applicationObj.restrictedApp){ - if((this.applicationObj.name == 'undefined' || !this.applicationObj.name) ||(this.applicationObj.url == 'undefined' - || !this.applicationObj.url)){ - this.openConfirmationModal('','Please fill in all required fields(*)'); - return; - } } + + if (this.applicationObj.isEnabled) { + if (((this.applicationObj.appName == 'undefined' || !this.applicationObj.appName) + || (this.applicationObj.appBasicAuthUsername == 'undefined' || !this.applicationObj.appBasicAuthUsername) || (this.applicationObj.nameSpace == 'undefined' + || !this.applicationObj.nameSpace))) { + + this.openConfirmationModal('', 'Please fill in all required fields(*) for centralized active application'); + return; + } + } + } + } else { + console.log("Non-centralized applications validation"); + this.applicationObj.appAck = null; + if (!this.applicationObj.isEnabled) { + if ((this.applicationObj.appName == 'undefined' || !this.applicationObj.appName)) { + this.openConfirmationModal('', 'Please fill in all required field(*) ApplicationName to Save the applictaion'); + return; + } + } else if (this.applicationObj.isEnabled && (this.applicationObj.applicationType == "1")) { + if ((this.applicationObj.appName == 'undefined' || !this.applicationObj.appName) + || (this.applicationObj.landingPage == 'undefined' || !this.applicationObj.landingPage) + || (this.applicationObj.appBasicAuthUsername == 'undefined' || !this.applicationObj.appBasicAuthUsername) || + (this.applicationObj.appBasicAuthPassword == 'undefined' || !this.applicationObj.appBasicAuthPassword)) { + + this.openConfirmationModal('', 'Please fill in all required fields(*) along with password as the app is not centralized'); + return; + } + } else if (this.applicationObj.isEnabled && (this.applicationObj.applicationType == "3")) { + console.log("Non gui validation"); + if ((this.applicationObj.appName == 'undefined' || !this.applicationObj.appName) + || (this.applicationObj.appBasicAuthUsername == 'undefined' || !this.applicationObj.appBasicAuthUsername)) { + this.openConfirmationModal('', 'Please fill in all required fields(*)'); + return; + } + } else if (this.applicationObj.isEnabled && (this.applicationObj.applicationType == "2")) { + if ((this.applicationObj.appName == 'undefined' || !this.applicationObj.appName) || (this.applicationObj.landingPage == 'undefined' + || !this.applicationObj.landingPage)) { + this.openConfirmationModal('', 'Please fill in all required fields(*)'); + return; + } + } } //URL Validation - if(this.applicationObj.isEnabled){ - if(this.applicationObj.url && this.applicationObj.url !='undefined' && this.applicationObj.url != ''){ - let isValidURL = this.isUrlValid(this.applicationObj.url); - if(!isValidURL){ - this.openConfirmationModal('Error','Application URL must be a valid URL.'); + if (this.applicationObj.isEnabled && this.applicationObj.applicationType == "1") { + if (this.applicationObj.landingPage && this.applicationObj.landingPage != 'undefined' && this.applicationObj.landingPage != '') { + let isValidURL = this.isUrlValid(this.applicationObj.landingPage); + if (!isValidURL) { + this.openConfirmationModal('Error', 'Application URL must be a valid URL.'); return; } - }else{ - this.openConfirmationModal('Error','Application URL is required.'); + } else { + this.openConfirmationModal('Error', 'Application URL is required.'); return; } } @@ -227,34 +303,40 @@ export class ApplicationDetailsDialogComponent implements OnInit { this.isSaving = true; // For a restricted app, null out all irrelevant fields - if(this.applicationObj.restrictedApp) { + if (this.applicationObj.applicationType == "2") { + console.log("Hyperlinka pplication validation"); this.newAppModel.restUrl = null; this.newAppModel.isOpen = true; - this.newAppModel.username = null; - this.newAppModel.appPassword = null; + this.newAppModel.appBasicAuthUsername = null; + this.newAppModel.appBasicAuthPassword = null; this.newAppModel.uebTopicName = null; this.newAppModel.uebKey = null; this.newAppModel.uebSecret = null; + this.newAppModel.restrictedApp = true; /**Need to set below fields values based on input provided in the dialog */ - this.newAppModel.restrictedApp = this.applicationObj.restrictedApp; - this.newAppModel.name = this.applicationObj.name; - this.newAppModel.url = this.applicationObj.url; - if(this.applicationObj.isEnabled){ + this.newAppModel.applicationType = this.applicationObj.applicationType; + this.newAppModel.appName = this.applicationObj.appName; + this.newAppModel.landingPage = this.applicationObj.landingPage; + this.newAppModel.usesCadi = this.applicationObj.usesCadi; + if (this.applicationObj.isEnabled) { this.newAppModel.isEnabled = this.applicationObj.isEnabled; }else{ this.newAppModel.isEnabled = false; } + console.log("New Model : ", this.newAppModel); + } else { - }else{ - - /**Need to set below fields values based on input provided in the dialog */ - this.newAppModel.restrictedApp = false; - this.newAppModel.name = this.applicationObj.name; - this.newAppModel.url = this.applicationObj.url; - this.newAppModel.restUrl = this.applicationObj.restUrl; - this.newAppModel.username = this.applicationObj.username; - this.newAppModel.appPassword = this.applicationObj.appPassword; + /**Need to set below fields values based on input provided in the dialog */ + this.newAppModel.applicationType = this.applicationObj.applicationType; + this.newAppModel.appName = this.applicationObj.appName; + this.newAppModel.landingPage = this.applicationObj.landingPage; + this.newAppModel.restUrl = this.applicationObj.restUrl; + this.newAppModel.appBasicAuthUsername = this.applicationObj.appBasicAuthUsername; + this.newAppModel.appBasicAuthPassword = this.applicationObj.appBasicAuthPassword; + this.newAppModel.modeOfIntegration = this.applicationObj.modeOfIntegration; + this.newAppModel.usesCadi = this.applicationObj.usesCadi; + this.newAppModel.appAck = this.applicationObj.appAck; if(this.applicationObj.isEnabled){ this.newAppModel.isEnabled = this.applicationObj.isEnabled; @@ -269,11 +351,12 @@ export class ApplicationDetailsDialogComponent implements OnInit { } //console.log("this.applicationObj.isOpen",this.applicationObj.isOpen); - if(this.applicationObj.isCentralAuth){ - this.newAppModel.isCentralAuth = this.applicationObj.isCentralAuth; - }else{ - this.newAppModel.isCentralAuth = false; - } + if (this.applicationObj.rolesInAAF) { + this.newAppModel.rolesInAAF = this.applicationObj.rolesInAAF; + } else { + this.newAppModel.rolesInAAF = false; + this.newAppModel.usesCadi = false; + } } @@ -283,7 +366,17 @@ export class ApplicationDetailsDialogComponent implements OnInit { this.newAppModel.nameSpace = this.applicationObj.nameSpace; } - if(this.isEditMode){ + if (this.applicationObj.applicationType == "2" || this.applicationObj.applicationType == "3") { + this.applicationObj.modeOfIntegration = null; + } + + if (this.newAppModel.applicationType == "2" || this.newAppModel.applicationType == "3") { + this.newAppModel.modeOfIntegration = null; + } + + if (this.isEditMode) { + console.log("Edit application Object : ", JSON.stringify(this.applicationObj)); + console.log("Mode Of iNtegration : ", this.applicationObj.modeOfIntegration); this.applicationsService.updateOnboardingApp(this.applicationObj) .subscribe( _data => { this.result = _data; diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.html b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.html index 8a678917..47722471 100644 --- a/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.html +++ b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.html @@ -46,17 +46,18 @@ <input matInput type="text" (keyup)="applyFilter($event.target.value)" placeholder="Search in entire table"> </mat-form-field> - <button type="button" style="float: right;" class="btn btn-primary" (click)="openAddApplicationModal('')"> + <button type="button" style="float: right;" class="btn btn-primary" (click)="openAddApplicationModal('', 'add')"> <i class="icon ion-md-person-add"></i> Add App </button> <div class="apps-table"> + <span class="ecomp-spinner" *ngIf="showEcompSpinner"></span> <!-- Applications Table goes here--> <table mat-table [dataSource]="dataSource" matSort> <!-- Thumbnail Column --> <ng-container matColumnDef="thumbnail"> <th id="col1" mat-header-cell *matHeaderCellDef> Thumbnail </th> - <td (click)="openAddApplicationModal(element)" id="rowheader_t1_{{i}}-thumbnail" + <td (click)="openAddApplicationModal(element, 'edit')" id="rowheader_t1_{{i}}-thumbnail" mat-cell *matCellDef="let element; let i = index;"> <div><img class="small-thumbnail" src={{element.imageLink}}></div> </td> @@ -65,64 +66,71 @@ <!-- Application Name Column --> <ng-container matColumnDef="applicationName"> <th id="col2" mat-header-cell *matHeaderCellDef> Application Name </th> - <td (click)="openAddApplicationModal(element)" id="rowheader_t1_{{i}}-applicationName" - mat-cell *matCellDef="let element; let i=index;"> {{element.name}} </td> + <td (click)="openAddApplicationModal(element, 'edit')" id="rowheader_t1_{{i}}-applicationName" + mat-cell *matCellDef="let element; let i=index;"> {{element.appName}} </td> </ng-container> <!-- Active Column --> <ng-container matColumnDef="active"> <th id="col2" mat-header-cell *matHeaderCellDef> Active </th> - <td (click)="openAddApplicationModal(element)" id="rowheader_t1_{{i}}-active" + <td (click)="openAddApplicationModal(element, 'edit')" id="rowheader_t1_{{i}}-active" mat-cell *matCellDef="let element; let i=index;"> {{(element.isEnabled) ? 'yes' : 'no'}} </td> </ng-container> <!-- Integration Type Column --> <ng-container matColumnDef="integrationType"> <th id="col2" mat-header-cell *matHeaderCellDef> Integration Type </th> - <td (click)="openAddApplicationModal(element)" id="rowheader_t1_{{i}}-integrationType" - mat-cell *matCellDef="let element; let i=index;"> {{(element.restrictedApp) ? 'link' : 'standard'}} </td> + <td (click)="openAddApplicationModal(element, 'edit')" id="rowheader_t1_{{i}}-integrationType" + mat-cell *matCellDef="let element; let i=index;"> {{(element.applicationType == 2) ? 'link' : 'standard'}} </td> + </ng-container> + + <!-- Mode Of Integration Type Column --> + <ng-container matColumnDef="modeOfIntegration"> + <th id="col2" mat-header-cell *matHeaderCellDef> Mode Of Integration </th> + <td (click)="openAddApplicationModal(element, 'edit')" id="rowheader_t1_{{i}}-modeOfIntegration" + mat-cell *matCellDef="let element; let i=index;"> {{element.modeOfIntegration}} </td> </ng-container> <!-- Guest Access Column--> <ng-container matColumnDef="guestAccess"> <th id="col2" mat-header-cell *matHeaderCellDef> Guest Access </th> - <td (click)="openAddApplicationModal(element)" id="rowheader_t1_{{i}}-guestAccess" + <td (click)="openAddApplicationModal(element, 'edit')" id="rowheader_t1_{{i}}-guestAccess" mat-cell *matCellDef="let element; let i=index;">{{(element.isOpen) ? 'yes' : 'no'}} </td> </ng-container> <!-- url column --> - <ng-container matColumnDef="url"> - <th id="col2" mat-header-cell *matHeaderCellDef> Url </th> - <td (click)="openAddApplicationModal(element)" id="rowheader_t1_{{i}}-url" - mat-cell *matCellDef="let element; let i=index;">{{element.url}} </td> + <ng-container matColumnDef="landingPage"> + <th id="col2" mat-header-cell *matHeaderCellDef> Landing Page </th> + <td (click)="openAddApplicationModal(element, 'edit')" id="rowheader_t1_{{i}}-url" + mat-cell *matCellDef="let element; let i=index;">{{element.landingPage}} </td> </ng-container> <!-- rest url column --> <ng-container matColumnDef="restURL"> <th id="col2" mat-header-cell *matHeaderCellDef> REST Url </th> - <td (click)="openAddApplicationModal(element)" id="rowheader_t1_{{i}}-restURL" + <td (click)="openAddApplicationModal(element, 'edit')" id="rowheader_t1_{{i}}-restURL" mat-cell *matCellDef="let element; let i=index;">{{element.restUrl}} </td> </ng-container> <!-- communicationKey column --> <ng-container matColumnDef="communicationKey"> <th id="col2" mat-header-cell *matHeaderCellDef> Communication Key </th> - <td (click)="openAddApplicationModal(element)" id="rowheader_t1_{{i}}-communicationKey" + <td (click)="openAddApplicationModal(element, 'edit')" id="rowheader_t1_{{i}}-communicationKey" mat-cell *matCellDef="let element; let i=index;">{{element.uebKey}} </td> </ng-container> <!-- applicationNamespace column --> <ng-container matColumnDef="applicationNamespace"> <th id="col2" mat-header-cell *matHeaderCellDef> Application Namespace </th> - <td (click)="openAddApplicationModal(element)" id="rowheader_t1_{{i}}-applicationNamespace" + <td (click)="openAddApplicationModal(element, 'edit')" id="rowheader_t1_{{i}}-applicationNamespace" mat-cell *matCellDef="let element; let i=index;">{{element.nameSpace}} </td> </ng-container> <!-- centralAuthAccess column --> <ng-container matColumnDef="centralAuthAccess"> <th id="col2" mat-header-cell *matHeaderCellDef> Central Auth Access </th> - <td (click)="openAddApplicationModal(element)" id="rowheader_t1_{{i}}-centralAuthAccess" - mat-cell *matCellDef="let element; let i=index;">{{(element.isCentralAuth) ? 'yes' : 'no'}} </td> + <td (click)="openAddApplicationModal(element, 'edit')" id="rowheader_t1_{{i}}-centralAuthAccess" + mat-cell *matCellDef="let element; let i=index;">{{(element.rolesInAAF) ? 'yes' : 'no'}} </td> </ng-container> <!-- Delete Column --> diff --git a/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts index 8cbf1d28..83cbfa0e 100644 --- a/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts +++ b/portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts @@ -61,11 +61,12 @@ export class ApplicationOnboardingComponent implements OnInit { emptyImgForPreview: string; isUserSuperAdmin: boolean = false; displayedColumns: string[] = ['thumbnail', 'applicationName','active', - 'integrationType', 'guestAccess', 'url','restURL', + 'integrationType', 'modeOfIntegration', 'guestAccess', 'landingPage','restURL', 'communicationKey', 'applicationNamespace', 'centralAuthAccess']; dataSource = new MatTableDataSource(this.appsList); @ViewChild(MatSort) sort: MatSort; @ViewChild(MatPaginator) paginator: MatPaginator; + showEcompSpinner:boolean = false; constructor(public applicationsService: ApplicationsService, public ngbModal: NgbModal) { } @@ -77,11 +78,13 @@ export class ApplicationOnboardingComponent implements OnInit { getOnboardingApps(){ //console.log("getOnboardingApps called"); + this.showEcompSpinner = true; this.applicationsService.getOnboardingApps() .subscribe(_data => { this.result = _data; if (this.result == null || this.result == 'undefined') { console.log('WidgetOnboardingService::getOnboardingWidgets Failed: Result or result.data is null'); + this.showEcompSpinner = false; }else { this.appsList = _data; for (var i = 0; i < this.appsList.length; i++) { @@ -94,11 +97,14 @@ export class ApplicationOnboardingComponent implements OnInit { } } this.populateTableData(this.appsList); + this.showEcompSpinner = false; } }, error =>{ console.log(error); + this.showEcompSpinner = false; this.openConfirmationModal('Error', error.message); }); + this.showEcompSpinner = false; } applyFilter(filterValue: string) { @@ -112,9 +118,11 @@ export class ApplicationOnboardingComponent implements OnInit { this.dataSource.paginator = this.paginator; }; - openAddApplicationModal(rowData: any) { - const modalRef = this.ngbModal.open(ApplicationDetailsDialogComponent, { size: 'lg' }); + openAddApplicationModal(rowData: any, action:any) { + console.log("Action : ", action); + const modalRef = this.ngbModal.open(ApplicationDetailsDialogComponent, { size: 'lg', backdrop: 'static', keyboard: false }); modalRef.componentInstance.title = 'Application Details'; + modalRef.componentInstance.action = action; //console.log("selectedData in parent",rowData); if(rowData != 'undefined' && rowData){ modalRef.componentInstance.applicationObj = rowData; @@ -134,21 +142,28 @@ export class ApplicationOnboardingComponent implements OnInit { } deleteApplication(application: IApplications){ - let confirmationMsg = 'You are about to delete this App : ' + application.name+ '. Click OK to continue.'; + let confirmationMsg = 'You are about to delete this App : ' + application.appName+ '. Click OK to continue.'; this.openInformationModal("Confirmation",confirmationMsg).result.then((result) => { if (result === 'Ok') { if(!application || application == null){ console.log('ApplicationOnboardingCtrl::deleteApplication: No apllication or ID... cannot delete'); return; } + this.showEcompSpinner = true; this.appsList.splice(this.appsList.indexOf(application), 1); this.applicationsService.deleteOnboardingApp(application.id) .subscribe( data => { this.result = data; this.getOnboardingApps(); + this.showEcompSpinner = false; }, error => { console.log(error); - this.openConfirmationModal('Error', error); + this.showEcompSpinner = false; + if(error && error.status == 405){ + this.openConfirmationModal('', 'Application : ' + application.appName+ ' can not be deleted as it is associsted with one of the Microservices.'); + }else{ + this.openConfirmationModal('Error', error.message); + } }); } }, (resut) => { @@ -162,7 +177,7 @@ export class ApplicationOnboardingComponent implements OnInit { if(res) { this.isUserSuperAdmin = true; this.displayedColumns = ['thumbnail', 'applicationName','active', - 'integrationType', 'guestAccess', 'url','restURL', + 'integrationType', 'modeOfIntegration', 'guestAccess', 'landingPage','restURL', 'communicationKey', 'applicationNamespace', 'centralAuthAccess', 'delete']; } //console.log("isUserSuperAdmin :: ",this.isUserSuperAdmin); diff --git a/portal-FE-os/src/app/pages/information-tooltip/information-tooltip.component.html b/portal-FE-os/src/app/pages/information-tooltip/information-tooltip.component.html new file mode 100644 index 00000000..92f13c8c --- /dev/null +++ b/portal-FE-os/src/app/pages/information-tooltip/information-tooltip.component.html @@ -0,0 +1,3 @@ +<span matTooltip="{{textMessage}}" [matTooltipPosition]="'above'"> + <i class="icon ion-md-help-circle" style="color: #087ac2;"></i> +</span>
\ No newline at end of file diff --git a/portal-FE-os/src/app/pages/information-tooltip/information-tooltip.component.scss b/portal-FE-os/src/app/pages/information-tooltip/information-tooltip.component.scss new file mode 100644 index 00000000..3d72a79e --- /dev/null +++ b/portal-FE-os/src/app/pages/information-tooltip/information-tooltip.component.scss @@ -0,0 +1,13 @@ +.material-icons { + font-size: 17px !important; + cursor: default; +} + +.mat-tooltip { + font-size: 1.5rem !important; + } + + img{ + width: 16px; + } +
\ No newline at end of file diff --git a/portal-FE-os/src/app/pages/information-tooltip/information-tooltip.component.spec.ts b/portal-FE-os/src/app/pages/information-tooltip/information-tooltip.component.spec.ts new file mode 100644 index 00000000..9c8c6214 --- /dev/null +++ b/portal-FE-os/src/app/pages/information-tooltip/information-tooltip.component.spec.ts @@ -0,0 +1,8 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { InformationTooltipComponent } from './information-tooltip.component'; + +describe('InformationTooltipComponent', () => { + + +}); diff --git a/portal-FE-os/src/app/pages/information-tooltip/information-tooltip.component.ts b/portal-FE-os/src/app/pages/information-tooltip/information-tooltip.component.ts new file mode 100644 index 00000000..3c05d074 --- /dev/null +++ b/portal-FE-os/src/app/pages/information-tooltip/information-tooltip.component.ts @@ -0,0 +1,19 @@ +import { Component, OnInit, Input } from '@angular/core'; + +@Component({ + selector: 'app-information-tooltip', + templateUrl: './information-tooltip.component.html', + styleUrls: ['./information-tooltip.component.scss'] +}) +export class InformationTooltipComponent implements OnInit { + + @Input() textMessage : any; + constructor() { } + + message : string; + ngOnInit() { + console.log("Message ", this.textMessage); + this.message = this.textMessage; + } + +} diff --git a/portal-FE-os/src/app/pages/pages.module.ts b/portal-FE-os/src/app/pages/pages.module.ts index 7ccb3f95..b7163da3 100644 --- a/portal-FE-os/src/app/pages/pages.module.ts +++ b/portal-FE-os/src/app/pages/pages.module.ts @@ -35,7 +35,7 @@ * * */ -import { NgModule } from '@angular/core'; +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ReactiveFormsModule, FormsModule } from '@angular/forms'; import { MatIconModule } from '@angular/material/icon'; @@ -96,7 +96,9 @@ import { ApplicationPipesModule } from '../shared/pipes/application-pipes.module import { UsersComponent } from './users/users.component'; import { NewUserModalComponent } from './users/new-user-modal/new-user-modal.component'; import { BulkUserComponent } from './users/bulk-user/bulk-user.component'; +import { InformationTooltipComponent } from './information-tooltip/information-tooltip.component'; import { UserDetailsFormComponent } from './users/user-details-form/user-details-form.component'; +import { MatTooltipModule } from '@angular/material'; @NgModule({ @@ -149,7 +151,8 @@ import { UserDetailsFormComponent } from './users/user-details-form/user-details DashboardWidgetCatalogComponent, FunctionalMenuDialogComponent, GetAccessComponent, - UserDetailsFormComponent + UserDetailsFormComponent, + InformationTooltipComponent ], imports: [ CommonModule, @@ -163,7 +166,8 @@ import { UserDetailsFormComponent } from './users/user-details-form/user-details MatIconModule, MatCheckboxModule, FormsModule, - PluginModule + PluginModule, + MatTooltipModule ], entryComponents: [ SchedulerComponent, @@ -193,7 +197,9 @@ import { UserDetailsFormComponent } from './users/user-details-form/user-details useClass: HeaderInterceptor, multi: true, }], - + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] }) export class PagesModule { diff --git a/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.html b/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.html index 7fc35e44..bd9d69b6 100644 --- a/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.html +++ b/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.html @@ -113,6 +113,6 @@ </form> </div> <div class="modal-footer"> - <button type="submit" class="btn btn-primary" (click)="addUser()" [disabled]="addNewUserForm.invalid">Next</button> + <button type="submit" class="btn btn-primary" (click)="addUser()">Next</button> <button type="button" class="btn btn-primary" aria-label="Close" (click)="activeModal.dismiss('Cross')">Close</button> </div> diff --git a/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.ts b/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.ts index bea0fcdb..33d2b331 100644 --- a/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.ts +++ b/portal-FE-os/src/app/pages/users/user-details-form/user-details-form.component.ts @@ -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(); } diff --git a/portal-FE-os/src/environments/environment.prod.ts b/portal-FE-os/src/environments/environment.prod.ts index db6b5bf5..7cc34da5 100644 --- a/portal-FE-os/src/environments/environment.prod.ts +++ b/portal-FE-os/src/environments/environment.prod.ts @@ -125,7 +125,8 @@ export const environment = { "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 0482c20c..d412522f 100644 --- a/portal-FE-os/src/environments/environment.ts +++ b/portal-FE-os/src/environments/environment.ts @@ -129,7 +129,8 @@ export const environment = { "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 Binary files differindex d2c5e0fc..cb712ebd 100644 --- a/portal-FE-os/src/favicon.ico +++ b/portal-FE-os/src/favicon.ico |